Reputation: 85
I am responsible of the network part of a multiplayergame. I hope anybody of you got some eperience with that. My questions are:
Should I create an Object which contains all information (Coordinates, Stats, Chat) or is it better to send an own Object for each of them?
And how can i avoid the Object/s beeing cached at the client so i can update the Object and send it again? (i tried ObjectInputStream.reset() but it still received the same)
(Sorry for my bad english ;))
Upvotes: 2
Views: 1037
Reputation: 1412
1.in the logic layer, you can split the objects, and in transmission layer you send what you want, of course you can combine them and send.
2.you can maintain a version for each user and the client also have the version number, when things change, update the corresponding version in the server and then send the updates to all the clients, then the client should update version. it should be a subcribe
mode.
Upvotes: 1
Reputation: 1578
Upvotes: 2