Skip to content

Instantly share code, notes, and snippets.

@timothyhahn
Created February 27, 2014 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timothyhahn/9255423 to your computer and use it in GitHub Desktop.
Save timothyhahn/9255423 to your computer and use it in GitHub Desktop.
updated design
NetworkMessageInterpreter
Network Message Comes In
-> Init
-> Create Character Entity
-> Create SockoSender
-> Associate websocket id to User's ID
-> Other
-> Look up user's id based on websocket id
-> Look up user's world's name
-> Toss onto queue the message + id + room name
MessageQueue
Single Queue
-> Associates worlds to messages by name
MessageProcessor
One for each world
-> Needs a user to do these things on/with
-> Has user id
-> has room
-> Can send messages to event queue when they need to send events to client
EventQueue
Single Queue
-> Essentially outgoing messages
-> Room independent
EventProcessor
One for each world
-> As many as is needed
-> Sends out messages to the correct room
SocketUserMap
Actor
-> Associates websocket ids to user ids
UserRoomMap
Actor
-> Associates users to rooms
-> Handles swapping between rooms
Serializer
One for each world
-> Serializes room
-> Sends information to client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment