예제 #1
0
        private ModPacket GetPacket(SAXCoreMessageType type)
        {
            ModPacket packet = mod.GetPacket();

            packet.Write((byte)JoostModMessageType.SAXCore);
            packet.Write(npc.whoAmI);
            packet.Write((byte)type);
            return(packet);
        }
예제 #2
0
        public void HandlePacket(BinaryReader reader)
        {
            SAXCoreMessageType type = (SAXCoreMessageType)reader.ReadByte();

            if (type == SAXCoreMessageType.ShellHit)
            {
                int ai2 = reader.ReadInt32();
                npc.ai[2] = ai2;
                if (Main.netMode == 2)
                {
                    ModPacket netMessage = GetPacket(SAXCoreMessageType.ShellHit);
                    int       ignore     = reader.ReadInt32();
                    netMessage.Write(ai2);
                    netMessage.Send(-1, ignore);
                }
            }
        }