NetworkServer.Send and NetworkClient.Send or synchronising on player prefab?
Hello
I'm quite new to the whole networking thing. I made some research for my project to work and found two ways of establishing a working communication between the server and the clients. I am using NetworkManager derived class.
My game is a turn based strategy with communication required at the end of each game phase - client says, what they did, the server processes all the data after everyone sent their messages and then messages everyone back with results.
So. firstly I can simply make every Client use the "Send" method to send some kind of message that I crafted myself, as I understand, and then answer it with the same method od the NetworkServer, correct (or better - with NetworkServer.SendAll)?
Or, i can use my playerPrefab, that the NetworkManager creates for everyone and simply update some values there and work on them (some lists or dictionaries that would store most recent events on every client, then send the values to the server via Command attributed method, then process everything and invoke ClientRpc method on every of these prefabs - only for localClients).
So... which one would be more efficient? I guess that sometimes the data could require some more space - it won't simply be a mass of strings. Of course, it can be if it would be better (so, a third option). Any thoughts will be appreciated.
Thanks in advance!
Your answer
Follow this Question
Related Questions
Issuing SetClientReady causes duplicate network objects on local client 1 Answer
How should I verify that all of my client Object are created and ready after loading a new scene? 0 Answers
Adding Clients after Log in 1 Answer
UNET - Both client and server player disappears for client after scene load 0 Answers
Synchronize scene loading networking 1 Answer