本文整理汇总了C#中PacketWriter.Byte方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.Byte方法的具体用法?C# PacketWriter.Byte怎么用?C# PacketWriter.Byte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.Byte方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: News
public static byte[] News()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_MAIN);
Writer.Byte(0);
Writer.Byte((byte)Systems.News_List.Count);
foreach (NewsList n in Systems.News_List)
{
Writer.Text(n.Head);
Writer.Text(n.Msg);
Writer.Word(0);
Writer.Word(n.Month);
Writer.Word(n.Day);
Writer.Word(0);
Writer.LWord(0);
}
Writer.Word(0);
return Writer.GetBytes();
}
示例2: ServerListPacket
public static byte[] ServerListPacket(int cliVersion)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_SERVERLIST);
Writer.Word(0x0201);
Writer.Text("SRX_DARKEMU");
Writer.Byte(0);
foreach (KeyValuePair<int, Systems.SRX_Serverinfo> GS in Systems.GSList)
{
if (GS.Value.Version == 0 || cliVersion == GS.Value.Version)
{
Writer.Bool(true);
Writer.Word(GS.Value.id);
Writer.Text("1"+GS.Value.name);
Writer.Word(GS.Value.usedSlots);
Writer.Word(GS.Value.maxSlots);
Writer.Byte(GS.Value.status);
}
}
Writer.Byte(0);
return Writer.GetBytes();
}
示例3: ServerIsFull
public static byte[] ServerIsFull()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_AUTH);
Writer.Byte(0x02);
Writer.Byte(0x04);
return Writer.GetBytes();
}
示例4: AllreadyConnected
public static byte[] AllreadyConnected()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_AUTH);
Writer.Byte(0x02);
Writer.Byte(0x03);
return Writer.GetBytes();
}
示例5: UserFail
public static byte[] UserFail(byte _code)
{
PacketWriter pack = new PacketWriter();
pack.Create(0x03);
pack.Byte(0x00);
pack.Byte(_code);
return pack.GetBytes();
}
示例6: NoSuchUser
public static byte[] NoSuchUser()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(0xA102);
Writer.Byte(3);
Writer.Byte(0x0F);
Writer.Byte(2);
Writer.Text("[DARKEMU] Account not found");
return Writer.GetBytes();
}
示例7: LoadGame_2
public static byte[] LoadGame_2()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_MAIN);
Writer.Word(0x0100);
Writer.Word(0x0100);
Writer.Byte(0x69);
Writer.Byte(0x0C);
Writer.DWord(0x00000005);
Writer.Byte(0x02);
return Writer.GetBytes();
}
示例8: BannedUser
public static byte[] BannedUser(string sReason)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_AUTH);
Writer.Byte(3);
Writer.Byte(0x0F);
Writer.Byte(2);
Writer.Text(string.Format("[DARKEMU] Banned: {0}", sReason));
Writer.Word(0);
return Writer.GetBytes();
}
示例9: GateWayPacket
public static byte[] GateWayPacket()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_INFO);
Writer.Text("GatewayServer");
Writer.Byte(0);
return Writer.GetBytes();
}
示例10: LoadGame_5
public static byte[] LoadGame_5()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_MAIN);
Writer.Word(0x0101);
Writer.Word(0);
Writer.Byte(0xA1);
return Writer.GetBytes();
}
示例11: ConnectSucces
public static byte[] ConnectSucces(string ip, ushort port, byte type)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_AUTH);
Writer.Byte(0x01);
Writer.DWord(0x1234); // Session
Writer.Text(ip);
Writer.Word(port);
//Console.WriteLine("Connect Succes to: Ip:{0} Port:{1}",ip,port);
return Writer.GetBytes();
}
示例12: SomethingWentWrong
public static byte[] SomethingWentWrong()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_AUTH);
Writer.Byte(3);
Writer.Byte(0x0F);
Writer.Byte(2);
Writer.Text("[DARKEMU]: Account not found");
Writer.Word(0);
return Writer.GetBytes();
}
示例13: WrongInformation
public byte[] WrongInformation()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(SERVER.SERVER_AUTH);
Writer.Byte(3);
Writer.Byte(0x0F);
Writer.Byte(2);
Writer.Text(string.Format("[DARKEMU]: Incorrect password: {0}/3 times.", WrongPassword));
Writer.Word(0);
return Writer.GetBytes();
}
示例14: Patch
public void Patch()
{
//PacketReader Reader = new PacketReader(PacketInformation.buffer);
//Reader.Skip(1);
try
{
PacketWriter writer = new PacketWriter();
writer.Create(SERVER.SERVER_MAIN);
writer.DWord(0x05000101);
writer.Byte(0x20);
client.Send(writer.GetBytes());
writer.Create(SERVER.SERVER_MAIN);
writer.DWord(0x01000100);
writer.DWord(0x00050628);
writer.Word(0x00);
writer.Byte(0x02);
client.Send(writer.GetBytes());
writer.Create(SERVER.SERVER_MAIN);
writer.DWord(0x05000101);
writer.Byte(0x60);
client.Send(writer.GetBytes());
writer.Create(SERVER.SERVER_MAIN);
writer.DWord(0x02000300);
writer.Word(0x0200);
client.Send(writer.GetBytes());
writer.Create(SERVER.SERVER_MAIN);
writer.DWord(0x00000101);
writer.Byte(0xA1);
client.Send(writer.GetBytes());
writer.Create(SERVER.SERVER_MAIN);
writer.Word(0x0100);
client.Send(writer.GetBytes());
/*if (Reader.Text() == "SR_Client")
{
int version = Reader.Int32();
client.Version = version;
//We must keep the version equal to implent patch server later on in development.
//When a client isnt equal to our server information, disconnect or update.
if (version == LoginServer.Global.Versions.clientVersion)
{
client.Send(LoadGame_1());
client.Send(LoadGame_2());
client.Send(LoadGame_3());
client.Send(LoadGame_4());
client.Send(LoadGame_5());
client.Send(Clientok());
}
else
{
// client.Send(PatchRequest());
}
}*/
}
catch (Exception)
{
}
}