本文整理汇总了C#中Packets.GetByte方法的典型用法代码示例。如果您正苦于以下问题:C# Packets.GetByte方法的具体用法?C# Packets.GetByte怎么用?C# Packets.GetByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packets
的用法示例。
在下文中一共展示了Packets.GetByte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSendUniversal
public void OnSendUniversal(Packets.Server.SendUniversal p)
{
ClientManager.LeaveCriticalArea();
while (!Client.netIO.Crypt.IsReady)
{
System.Threading.Thread.Sleep(100);
}
ClientManager.EnterCriticalArea();
string tmp = "Sender:{0}\r\nOpcode:0x{1:X4}\r\nName:{2}\r\n\r\n{5}\r\n\r\nLength:{3}\r\nData:\r\n{4}\r\n";
string tmp2 = this.DumpData(p);
tmp = string.Format(tmp, "Server" , p.ID, this.ToString(), p.data.Length, tmp2, "{0}");
Console.WriteLine(tmp);
Packets.Server.SendUniversal p1 = new PacketProxy.Packets.Server.SendUniversal();
p1.data = new byte[p.data.Length];
p.data.CopyTo(p1.data, 0);
this.Client.packetContainerServer.Add(p1);
this.Client.packets.Add(p1);
if (p.ID == 0x33 && this.Client.firstlevel != 2)
{
byte serverid = p.GetByte(2);
byte size = p.GetByte(3);
size--;
string ip = System.Text.Encoding.ASCII.GetString(p.GetBytes(size, 4));
int port = p.GetInt((ushort)(5 + size));
if (Program.pm != null)
{
Program.pm.Stop();
}
Program.pm = new ProxyClientManager();
Program.pm.firstlvlen = 2;
Program.pm.IP = ip;
Program.pm.port = port;
Program.pm.packetContainerServer = PacketContainer.Instance.packetsMap;
Program.pm.packetContainerClient = PacketContainer.Instance.packetsClient;
Program.pm.packets = PacketContainer.Instance.packets2;
Program.pm.StartNetwork(port);
Program.pm.ready = true;
byte[] buf = System.Text.Encoding.UTF8.GetBytes("127.0.0.001");
p.data = new byte[buf.Length + 9];
p.ID = 0x33;
p.PutByte(serverid, 2);
p.PutByte((byte)(buf.Length + 1), 3);
p.PutBytes(buf, 4);
p.PutInt(port, (ushort)(5 + buf.Length));
}
if (p.ID == 0x157C)
{
}
Client.netIO.SendPacket(p);
}