//
        // Network Game Object Events
        //

        private void Client_Receive_GameObject(NetworkReader reader)
        {
            if (networkSocket.IsHost)
            {
                DevTools.Logger.LogError(NetworkService.NetworkLog, "Client Method called on a host.");
                return;
            }

            Pool.PoolDefinition poolDefinition = ServiceLocator.SaveService.SavedObjectReferences.GetSavedObject <Pool.PoolDefinition>(reader.ReadInt16());
            NetworkGameObject   networkObject  = ServiceLocator.PoolService.SpawnDefinition <NetworkGameObject>(poolDefinition);

            networkObject.Client_ReceiveGameObject(this, reader);
        }
        private void NoneOwner_Receive_Update_GameObject(NetworkReader reader)
        {
            short             networkID     = reader.ReadInt16();
            NetworkGameObject networkObject = ServiceLocator.NetworkService.GetNetworkGameObject(networkID);

            if (networkObject != null)
            {
                networkObject.Client_ReceiveGameObjectUpdate(reader);
            }
            else
            {
                DevTools.Logger.LogWarning(NetworkService.NetworkLog, "Received NetworkID {} which does not exist.", () => new object[] { networkID });
            }
        }
        private void Client_Receive_Ownership_GameObject(NetworkReader reader)
        {
            if (networkSocket.IsHost)
            {
                DevTools.Logger.LogError(NetworkService.NetworkLog, "Client Method called on a host.");
                return;
            }

            short             networkID     = reader.ReadInt16();
            NetworkGameObject networkObject = ServiceLocator.NetworkService.GetNetworkGameObject(networkID);

            if (networkObject != null)
            {
                networkObject.Client_ReceiveOwnershipChange(this, reader);
            }
            else
            {
                DevTools.Logger.LogWarning(NetworkService.NetworkLog, "Received NetworkID {} which does not exist.", () => new object[] { networkID });
            }
        }
Ejemplo n.º 4
0
 public void RemoveNetworkGameObject(NetworkGameObject netObj)
 {
 }
Ejemplo n.º 5
0
 public void AddNetworkGameObject(NetworkGameObject netObj)
 {
 }
Ejemplo n.º 6
0
 public void RemoveNetworkGameObject(NetworkGameObject netObj)
 {
     activeNetworkGameObjects.Remove(netObj.NetworkID);
 }
Ejemplo n.º 7
0
 public void AddNetworkGameObject(NetworkGameObject netObj)
 {
     activeNetworkGameObjects[netObj.NetworkID] = netObj;
 }