feat: Multiplayer #2
Reference in New Issue
Block a user
Delete Branch "multiplayer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make this game multiplayer.
Setup:
commonfor common classes used both by the server and the clientgamethe actual clientserverthe serverNow we have working connection and player movement in current room.
Now I have to implement going to another rooms so the state in the server changes and pings other players in other rooms if the player disappeared on their screen or appeared or nothing happened.Edit: DoneThen the complete player movement will be done. Next we have to implement interacting with chests. Taking out items from chest will have to be handled so players cant take the item from both of their chests. This is gonna involve probably a rewrite of the whole chest system because now its managed on the client not the server. Maybe I'm thinking I'll just kinda fuck it and put ID's on the items and just say to client when they have to remove and add items from their state and each client will manage their state independently.
Also we have to do that for dropped items too.
Then we have to implement fighting (maybe even friendly fire) and killing mobs. This will require clients to manage their state too.
And also probably better error handling and better socket disconnect management (retry connection, after some time disconnect player from the game).
@@ -0,0 +28,4 @@@Overridepublic void handle(CreateGame event, Client client) {ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());String pass = PasswordGenerator.generatePassword(Config.WORLD_PASSWORD_LENGTH); // TODO: GenerateRemove
TODO. This is donePlayers can now finally move between rooms. Except storing their player rotation on the server. This will need to be stored and handled properly. Will do it in the future.
Now probably the whole synchronization is done. The only thing left i wanna do is chat but I'll do that in separate PR.
WIP: feat: Multiplayerto feat: Multiplayer