Exemple #1
0
        public override void ProcessPacket(TrashSystemNewTrashCreatedPacket packet, NebulaConnection conn)
        {
            bool valid = true;

            if (IsHost)
            {
                Player player = playerManager.GetPlayer(conn);
                if (player != null)
                {
                    playerManager.SendPacketToOtherPlayers(packet, player);
                }
                else
                {
                    valid = false;
                }
            }

            if (valid)
            {
                int myId = SimulatedWorld.GenerateTrashOnPlayer(packet);

                //Check if myID is same as the ID from the host
                if (myId != packet.TrashId)
                {
                    TrashManager.SwitchTrashWithIds(myId, packet.TrashId);
                }
            }
        }
Exemple #2
0
 public void ProcessPacket(TrashSystemCorrectionIdPacket packet, NebulaConnection conn)
 {
     if (packet.OriginalId != packet.NewId)
     {
         //Server sent correction packet for the trashId
         //Switch item on position NewId, with item on position OriginalId
         TrashManager.SwitchTrashWithIds(packet.OriginalId, packet.NewId);
     }
 }
Exemple #3
0
        public void ProcessPacket(TrashSystemNewTrashCreatedPacket packet, NebulaConnection conn)
        {
            int myId = SimulatedWorld.GenerateTrashOnPlayer(packet);

            //Check if myID is same as the ID from the host
            if (myId != packet.TrashId)
            {
                TrashManager.SwitchTrashWithIds(myId, packet.TrashId);
            }
        }