why players see objectswhen join game that objects have been destroyed in

Ok , i dont really think pasting my code will help out in this case, cause the entire process is stretched across so many class libraries etc … but i seem to always be running into an issue , where players in a currently running game , have a new player join , and although there is no relics left to pick up , the newly joining player is seeing all the relics on the ground, - but he CAN NOT pick them up , as their not really there. The server knows this, and so does any client already in the game.

I realise that players when joining a server , recieve all the backdated RPC’s (at least i think this is the case), but if this is so , shouldnt they have also recieved the fact that they were picked up?

Im realy not to sure what to do about this … as i said the player can not pick up the objects , so its not benifiting them , or screwing anyone else , but its kinda hindering their ability to know if a relic is a fake (not there) or a real one.

PS : If ya can find one other person to try out the player with , you can get a good example of what i mean. Have player 2 (not the host) collect all the pieces and leave game , sure enough , they all respawn for other player to get, so grab all the relics with player one , and rejoin with player 2, wham! theres all the relics on the ground , but their not there , player two wont be able to pikc them up , cause player one has em all , but why is player 2 seeing them still?.. O>O

PS PS : in order to test this scenario out , make sure you use the SCIFIA theme , and just make a 1x1 cell map …

Web Player is my sig.

Lets pretend for a moment i actually understood unity network framework but my hunch is along these lines as it would seem the most obvious.

You mean liks this exact method i have here … in my code?

function OnPlayerDisconnected(player: NetworkPlayer) {
	Network.RemoveRPCs(player);
	Network.DestroyPlayerObjects(player);
	networkConnections--;
	for(var u : UserData in users){

PS : dont want to post every single library that ties into making all this work , no one will read it anyways , and as i seem to have a record of the most unawnsered questions ever within the forums (haha) , trying to raise my chances and not post to much to read through.

NetworkLogLevel.Full;

Sorry that would be the most sensible recourse

Lol , been on that too , but thanks for tips anyways runner , any tip or reply is better than none :stuck_out_tongue:

Where and how are the relics getting Network.Instantiated, and by whom?

When an object gets network.instantiated it will buffer that action for future joining players to also get that action executed upon connecting.
You need to remove those actions from the buffer if they are not needed anymore.
For example when i delete an object :
Network.RemoveRPCs(GameObjectThatWillBeDestroyed.networkView.viewID);
Network.Destroy(GameObjectThatWillBeDestroyed);

Maybe it would be even better to do it like this :

NetworkViewID Vid = GameObjectThatWillBeDestroyed.networkView.viewID;
Network.Destroy(GameObjectThatWillBeDestroyed);
Network.RemoveRPCs(Vid);

ahh , that could maybe point me in the proper direction … i do alot of network destroys and i do not believe anywhere i am stopping these RPC;s like you have shown. Hmm … im gonna toy around something fierce here and see what i come up with , thanks again Apples :P, i will post back with changes and results sometime later.

Again, Apples, you are my hero networker man , how many times you save me : , worked like a charm , pretty foolish oversight i had there, also fixed a weapon issue that was buggin me on the network for awhile , thanks again m8.

sorry to bump this old thread, but where would i put this piece of advice :slight_smile:

in the connect function of the player or along side the rpc function or…?

OnPlayerDisconnected

but i want to use it to reset the player when a new map is loaded on the server, so the player never actually disconnects from the server… is it still the same then?
i have this now but that only deletes the player gameObjects not the ragdolls it leaves behind for all the times he died for example.

[RPC]
	void resetPlayers()
	{	
		NetworkPlayer player = Network.player;
		Network.RemoveRPCs(player);
		Network.DestroyPlayerObjects(player);
		
		spawnManager= GameObject.Find ("SpawnManager");
		if (spawnManager!=null){
			resetPlayer = spawnManager.GetComponent("SpawnScript")as SpawnScript;
		}
		resetPlayer.justConnectedToServer=true;
	}

if I’m correct in understanding your piece of code it will destroy the player and everything that was instantiated by the player, right?

I have not used it in that way before so you will need to test it but you could clear the buffer before loading a new map.

ok that makes sense… I’ll hijack this thread with my finding if thats ok…

hmm guess I’ll do it like this for now, and rewrite my whole code if i have the time…

[RPC]
	void resetPlayers()
	{	
		NetworkPlayer player = Network.player;
		Network.RemoveRPCs(player);
		Network.DestroyPlayerObjects(player);
		
		GameObject[] Bodies = GameObject.FindGameObjectsWithTag("deadBody");
		
		foreach (GameObject DB in Bodies)
		{
			Network.Destroy(DB);
		}
		
		spawnManager= GameObject.Find ("SpawnManager");
		if (spawnManager!=null){
			resetPlayer = spawnManager.GetComponent("SpawnScript")as SpawnScript;
		}
		resetPlayer.justConnectedToServer=true;
	}