Keep track of reservation time client-side and add debug settings to aid development #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds:
Client-side time tracking
The client now starts a timer when a new reservation is created. This timer ticks until the end of the session, at which point the session manager will log the user out. This prevents "lag switching" the client to get unlimited play time by interrupting its network connection at the moment that the client would receive the end of reservation message through the Phoenix channel. The timer can also be extended by the server over the Phoenix channel to add more play time to the current session.
Better development facilities
Two debug configuration options are added, one allows the client to react to messages destined to any station (i.e. the development computer's hostname doesn't need to match the production hostname scheme. For obvious reasons, this isn't suitable when more than 1 client is connected to the server. The other option allows swapping out the session manager implementation with a dummy one that simply logs to the console instead of starting and stopping interactive windows sessions which are both very disruptive to the development workflow.