You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resync(instanceId) - Pulls in a fresh copy from the API and trashes all data both in the state and triggers a special API call to nuke the data for that instance, then calculates the result and updates the instance via the PS2Alerts API
update(instanceId, newOwner) - Updates the state, but calls first:
check(instanceId, oldOwner) - This checks if the oldOwner matches the current state, if it doesn't somethings wrong, which triggers a resync
scan(instanceId)- Periodically calls Census and initiates a scan of the continent to detect early any state inconsistencies. It will loop through each facility Census returns and checks our state compared to theirs, callingcheck()` each time. If there's a difference, we re-sync the state.
The text was updated successfully, but these errors were encountered:
Idea to better manage map state:
Create an
InstanceMapStateAuthority
which has the following responsibilities:FacilityCapture
message and performs the following checks on each message:newFaction
value in theFacilityCapture
message equal to the current facility owner current "pre-capture" state?Maintains state via holding various maps, which are hydrated from an PS2Alerts API call to
/instance/facilities
upon script start:MapStates
=Map<InstanceID><FacilityID>
=Methods:
resync(instanceId)
- Pulls in a fresh copy from the API and trashes all data both in the state and triggers a special API call to nuke the data for that instance, then calculates the result and updates the instance via the PS2Alerts APIupdate(instanceId, newOwner)
- Updates the state, but calls first:check(instanceId, oldOwner)
- This checks if the oldOwner matches the current state, if it doesn't somethings wrong, which triggers a resync- Periodically calls Census and initiates a scan of the continent to detect early any state inconsistencies. It will loop through each facility Census returns and checks our state compared to theirs, calling
check()` each time. If there's a difference, we re-sync the state.The text was updated successfully, but these errors were encountered: