ok the Q may be seem trivial to you but I just started learning networking I don’t understand aloot.
I was starting to trying to figure out how to give each player a specific class when he logs in and so and how to destroy that class he “owns” on server and stuff like that, … but I’ve run in to the documentation witch turned my head around (like I understood gravity but now I don’t any longer), …
Been reading this 2 manuals:
-
using UnityEngine;
using System.Collections;public class Example : MonoBehaviour {
void OnPlayerDisconnected(NetworkPlayer player) {
Debug.Log("Clean up after player " + player);
Network.RemoveRPCs(player);
Network.DestroyPlayerObjects(player);
}
}
well I’ve figure out I’ll probably need OnPlayerDisconnected since I was searching for:
[RPC]
void SomeFunction (NetworkMessageInfo Info){
}
so I would somehow figure out how to determen witch class to destroy, …
BUT as far as I knew the:
- client was sending RPC functions to server
- server was verifying if server knows that exact RPC functions and executed them
but now I’m reading:
Network.RemoveRPCs(player);
so what does it do?:
- connects back to client and deletes the functions I’ve wrote on client? kinda highly unlikely, …
- Deletes the RPC functions on the server to witch server has access since client has disconnected and deletes them so other clients cannot use them any longer?
- OR even more strange thing to reverse the process and calculates the WHOLE thing how else would physics go if that player wouldn’t do any RPC calls, …
like the title says uhm WHAT?, … it puts all the logic I understand on the head, …
the second thing if there’s a function call:
Network.DestroyPlayerObjects(player);
how do I tell that function what objects ARE the objects this particular client has? or will it delete everything this client has touched meaning half of my HDD with him, …
I’m sorry this documentation totally confuses me and puts all my logic on the head, … can some one turn it back on please, … OR my head will start to hurt, …