Example #1
0
        ////////////////

        public override void HandlePacket(BinaryReader reader, int player_who)
        {
            if (Main.netMode == 1)                  // Client
            {
                ClientPacketHandlers.HandlePacket(this, reader);
            }
            else if (Main.netMode == 2)                     // Server
            {
                ServerPacketHandlers.HandlePacket(this, reader, player_who);
            }
        }
        ////////////////

        public override void HandlePacket(BinaryReader reader, int playerWho)
        {
            try {
                if (Main.netMode == 1)
                {
                    ClientPacketHandlers.HandlePacket(reader);
                }
                else if (Main.netMode == 2)
                {
                    ServerPacketHandlers.HandlePacket(reader, playerWho);
                }
            } catch (Exception e) {
                LogHelpers.Log("HandlePacket " + e.ToString());
            }
        }