Skip to content

Conversation

@acostarelli
Copy link
Contributor

No description provided.

sirpython and others added 4 commits August 4, 2015 18:55
updating to most recent code
At some points, the code may try to send a message to the server even
though the server is not ready yet. To fix this, the sendMessage method of
the server API will now check to make sure that the socket is ready
before the message is sent. If the socket is not ready, sendMessage will
---stop drop and roll--- throw a new SocketNotReadyException that contains
the current state of the socket
Now, the socket will listen for messages from the server and will stick
them into an array. This is all done by the onmessage event of Websocket.
Then, when the main game code is ready to accept/receive the server message,
it simply needs to call .getMessage, which gets the gets the first message
in the messages queue (in actuality, this is the last element of the array),
and returns it. This is done easily by using Array.prototype.shift
added exception throwing to sendMessage, added getMessage
acostarelli pushed a commit that referenced this pull request Aug 5, 2015
@acostarelli acostarelli merged commit 7961fbb into dynamic-page-allocation Aug 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants