本文整理汇总了C#中PacketIn.Read方法的典型用法代码示例。如果您正苦于以下问题:C# PacketIn.Read方法的具体用法?C# PacketIn.Read怎么用?C# PacketIn.Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketIn
的用法示例。
在下文中一共展示了PacketIn.Read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public int HandlePacket(BaseClient client, PacketIn packet)
{
LobbyClient cclient = (LobbyClient)client;
byte FileId = packet.GetUint8();
UInt32 Version = packet.GetUint32Reversed();
byte[] File = new byte[packet.Length - packet.Position];
packet.Read(File, 0, File.Length);
File = ZlibMgr.Decompress(File);
Log.Debug("ConfigSave", "Config saved! FileId = " + FileId + " | Version = " + Version + " | Size = " + File.Length);
Program.FileMgr.SaveInfo((int)cclient.Account.Index, FileId, File);
PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CONFIGFILE_SAVE);
Out.WriteUInt32Reverse((uint)ResponseCodes.RC_SUCCESS);
Out.WriteByte(FileId);
Out.Write(File, 0, File.Length);
cclient.Send(Out);
return 0;
}
示例2: HandlePacket
public int HandlePacket(BaseClient client, PacketIn packet)
{
LobbyClient cclient = client as LobbyClient;
Byte freeSlot = GetFreeSlot(cclient);
if (freeSlot == 0) ANS_CHARACTER_CREATE.Send(cclient);
else
{
cclient.Pending.Slot = freeSlot;
cclient.Pending.Faction = packet.GetUint8();
cclient.Pending.Gender = packet.GetUint8();
cclient.Pending.Version = (Byte)packet.GetUint32Reversed();
packet.GetUint32Reversed();
Byte[] Custom = new Byte[packet.Length - packet.Position];
packet.Read(Custom, 0, Custom.Length);
cclient.Pending.Appearance = BitConverter.ToString(Custom);
Databases.CharacterTable.Add(cclient.Pending);
ANS_CHARACTER_CREATE.Send(cclient);
}
return 0;
}