Exemplo n.º 1
0
        public void ServerAction(Lobby lobby, Server.Client client)
        {
            lock (lobby.entityCheckLock)
            {
                //Check for existing
                NetworkEntity[] networkEntities = lobby.NetworkEntities;
                for (int i = 0; i < networkEntities.Length; i++)
                {
                    if (networkEntities[i].ClientIndex == networkEntityData.ClientIndex && networkEntities[i].EntityIndex == networkEntityData.EntityIndex)
                    {
                        //Set data
                        networkEntityData.SetNetworkEntity(networkEntities[i], null);
                        return;
                    }
                }

                //None exist, create new
                lobby.AddNetworkEntity(networkEntityData.DeployNetworkEntity(null, null, lobby));
            }
        }