Question about Network and NetworkViewID

Hello,

I am trying to make a reactionary-game, like whack-a-mole. The clients send an RPC to the server which does Network.Destroy() on the object and then sends an RPC back to the client who sent the RPC in the first place, and only him.

It works fine unless two clients presses pretty much the same time; then both gets an RPC back, which I do not want - only the fastest sender should get an RPC back.

Here’s what the server gets from the client when the client clicks a mole:

    [RPC]
	void OnClientKillMole(NetworkViewID mole,NetworkMessageInfo info) 
	{
		try 
		{
			Network.RemoveRPCs(mole);
			Network.Destroy(mole);
			networkView.RPC("OnClientKillMoleSuccess",info.sender);  
		}
		catch (UnityException e) { Debug.Log(e); }
	}

How do I make this NetworkViewID ‘marked’ or something? How can I check if I have already destroyed it with Network.Destroy()?

Maybe you should make an array of killed moles? Something like that:

Array killedMoles = new Array();
[RPC]
void OnClientKillMole(NetworkViewID mole,NetworkMessageInfo info) 
{
     try 
     {
         for(NetworkViewID moleID in killedMoles){
             if(moleID == mole)   return;
         }
         Network.RemoveRPCs(mole);
         Network.Destroy(mole);
         networkView.RPC("OnClientKillMoleSuccess",info.sender);
         killedMoles.Add(mole); 
     }
     catch (UnityException e) { Debug.Log(e); }
}