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); }
public override Stream StartPacket(String typeName) { return(StartPacket(PacketManager.GetType(typeName))); }
protected override bool ReadPacket(Stream stream) { base.ReadPacket(stream); return(PacketManager.HandlePacket(this, stream)); }