- Home /
Online TPS problem
Hi everyone. I'm developing a simple online third person shooter. It works but I have a problem when client disconnect from server. I use a peer to peer approach, so one player is the server, other players connect as client and I use RPC calls for syncronization. The problem is for projectile, when a client player disconnect and reconnect to the server he will be re-hit from the projectile that have hit him before disconnecting from the server. How can I solve my problem?
Is it possible that the events affecting the player are remaining in the RPC buffer and are being re-applied at reconnect? If so, couldn't you just clear the buffer? Disclaimer: I have little RPC experience...
Answer by Vincent22 · Jun 07, 2011 at 07:05 AM
I think this is the problem (RPC buffer), but the server should clear RPCbuffered when a client disconnect:
function OnPlayerDisconnected (player : NetworkPlayer)
{
Debug.Log("Server destroying player");
Network.RemoveRPCs(player, 0);
Network.DestroyPlayerObjects(player);
}
but it doesn't work
Your answer