-
-
Save ricehornet/6d844a26f2b98a178d3c37f0d275d758 to your computer and use it in GitHub Desktop.
Generating dlight unit keycode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generating dlight unit keycode | |
#dlight server index is unknown | |
Angaza index is X* | |
get_dlight_server_latest_token_data -> unit number exists on dlight server? | |
unit number exists on dlight server? | |
yes? -> dlight latest token index is X minus 1 or None? | |
no? -> Raise error require ticket to add unit on dlight side | |
dlight latest token index is X minus 1 or None? | |
yes? -> dlight_create_token_with_id_x | |
no? -> is dlight server index and token value equal to Angaza index and requested value? | |
dlight_create_token_with_id_x | |
success -> store token and update Angaza index to token index | |
failure -> Angaza index is X | |
is dlight server index and token value equal to Angaza index and requested value? | |
yes? -> store token and update Angaza index to token index | |
no? -> is dlight server index and token value greater than Angaza index and requested value? | |
is dlight server index and token value greater than Angaza index and requested value? | |
yes? -> dlight_create_token_with latest token value from dlight | |
no? -> Fail as this indicates angaza is ahead of dlight somehow and we can adjust our index | |
dlight_create_token_with latest token value from dlight | |
always -> store token and update Angaza index to token index | |
Raise error require ticket to add unit on dlight side | |
store token and update Angaza index to token index | |
Fail as this indicates angaza is ahead of dlight somehow and we can adjust our index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${current_state_name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment