-add protocol w/unique hex identifier
-send message to server from client with string body/proto id and parse using switch statement/message type
-same in reverse
-need to add client ids to map with velocity, color, etc
-change self.vx and self.fire in the server file once map is set up
- Split server and client into separate files. Both inherit from scgame, and server has several scgame functions overriden in it that remove player creation, etc.
- Server calls a function that adds a player to its game when a new client is added/greet message is received. It also adds a new client id with a color/velocity/fire boolean to a map that can be referenced later.
- When movement happens in a client player, a proto message is sent to the server that holds the velocity, which is applied to the player with the id of that client. Then, in the update for the player, the player's velocity is changed to the velocity stored in the map.
- Have changed the message sending so that messages are only sent once when velocity changes to limit lag.
- Shooting works similarly and sets/sends a boolean when the player in the server version needs to fire.
No comments:
Post a Comment