示例#1
0
        protected bool OnReceivePacketDictionary(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);
            UInt16       count  = reader.ReadUInt16();

            for (int i = 0; i < count; ++i)
            {
                String name = reader.ReadString();
                UInt16 id   = reader.ReadUInt16();

                try
                {
                    PacketManager.SetTypeID(name, id);
                }
                catch (KeyNotFoundException)
                {
                    return(false);
                }
            }

            SendPacketDictionary();
            return(true);
        }
示例#2
0
 public override Stream StartPacket(String typeName)
 {
     return(StartPacket(PacketManager.GetType(typeName)));
 }
示例#3
0
 protected override bool ReadPacket(Stream stream)
 {
     base.ReadPacket(stream);
     return(PacketManager.HandlePacket(this, stream));
 }