When the front-end polls the back-end for the game-state, the back-end includes
a "date_updated" String in the JSON. If the String is the same as in the
front-end, then no updates are needed, but if they are not the same, then the
front-end will update the board. Because the front-end polls the back-end's
board state approximately every second, this should make the front-end more
efficient.
When the front-end connects to the back-end, it creates a callback that
sends a disconnect message with the received ID on "pagehide" and
"beforeunload" events. The previous implementation did not "undo" these
callbacks when the game was reset and a new ID was received. This fix
prevents the front-end from resending disconnect messages with
previously received IDs on browser window/tab close.
Sometimes the player would not disconnect from the Network Multiplayer
session on the back-end. Seems to work on PC browsers, not so well with
moblie browsers. This commit hopefully fixes this for mobile browsers.
The frontend "server" and backend server must be served via the same
port/address. This can be done by using nginx as the server, and using
reverse-proxies from nginx to the frontend and backend servers.
This commit is also a stepping-stone towards handling http requests
which will require deferred callbacks on Yew Components. By figuring
out how to delay callbacks in this commit, it should be easier to
figure out how to handle http requests that may require a deferred
callback.
Can place tokens, and not place tokens where there already is a token.
Additional info text box added to the side of the board.
More information to the UI regarding placed tokens.
Remove state::MessageBus in favor of String messages sent to Wrapper
from Slot.
Update Slot state from inside Wrapper::update such that changes should
be immediately visible per Slot (moved code from Wrapper::rendered,
fixing updates not being immediately visble).