本文整理汇总了C#中FrameWork.PacketOut.WritePacketLength方法的典型用法代码示例。如果您正苦于以下问题:C# PacketOut.WritePacketLength方法的具体用法?C# PacketOut.WritePacketLength怎么用?C# PacketOut.WritePacketLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameWork.PacketOut
的用法示例。
在下文中一共展示了PacketOut.WritePacketLength方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: F_REQUEST_CHAR
static public void F_REQUEST_CHAR(BaseClient client, PacketIn packet)
{
GameClient cclient = client as GameClient;
cclient.State = (int)eClientState.CharScreen;
UInt16 Operation = packet.GetUint16();
if (Operation == 0x2D58)
{
PacketOut Out = new PacketOut((byte)Opcodes.F_REQUEST_CHAR_ERROR);
Out.WriteByte((byte)CharMgr.GetAccountRealm(cclient._Account.AccountId));
cclient.SendPacket(Out);
}
else
{
PacketOut Out = new PacketOut((byte)Opcodes.F_REQUEST_CHAR_RESPONSE);
Out.FillString(cclient._Account.Username, 21);
Out.WriteByte(0);
Out.WriteByte(0);
Out.WriteByte(0);
Out.WriteByte(4);
if (cclient._Account.GmLevel == 0 && !Program.Config.CreateBothRealms)
Out.WriteByte((byte)CharMgr.GetAccountRealm(cclient._Account.AccountId));
else
Out.WriteByte(0);
byte[] Chars = CharMgr.BuildCharacters(cclient._Account.AccountId);
Out.Write(Chars, 0, Chars.Length);
Out.WritePacketLength();
cclient.SendPacket(Out);
}
}
示例2: SendBuffer
private void SendBuffer(Player Plr,ref PacketOut Buffer,ref byte Count)
{
// On Envoi le Packet des items
byte[] ArrayBuf = Buffer.ToArray();
PacketOut Packet = new PacketOut((byte)Opcodes.F_GET_ITEM);
Packet.WriteByte(Count);
Packet.Fill(0, 3);
Packet.Write(ArrayBuf, 0, ArrayBuf.Length);
Packet.WritePacketLength();
Plr.SendPacket(Packet);
// On Remet le compteur a zero
Count = 0;
// On Initalise un nouveau buffer
Buffer = new PacketOut(0);
Buffer.Position = 0;
}
示例3: SendCopy
public void SendCopy(PacketOut Out)
{
Out.WritePacketLength();
byte[] Buf = Out.ToArray();
PacketOut packet = new PacketOut(0);
packet.Position = 0;
packet.Write(Buf, 0, Buf.Length);
SendPacket(packet);
}
示例4: SendCopy
public void SendCopy(PacketOut Out)
{
Out.WritePacketLength();
PacketOut packet = new PacketOut(0);
packet.Position = 0;
packet.Write(Out.ToArray(), 0, Out.ToArray().Length);
SendPacket(packet);
}
示例5: SendSniff
public void SendSniff(string Str)
{
string Result = "";
using (StringReader Reader = new StringReader(Str))
{
string Line;
while ((Line = Reader.ReadLine()) != null)
{
Result+=Line.Substring(1, 48).Replace(" ", string.Empty);
}
}
Result = Result.Remove(0, 4);
byte Opcode = Convert.ToByte(Result.Substring(0, 2), 16);
Result = Result.Remove(0, 2);
PacketOut Out = new PacketOut(Opcode);
Out.WriteHexStringBytes(Result);
Out.WritePacketLength();
SendPacket(Out);
}