本文整理汇总了C#中PacketWriter.WriteSkip方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteSkip方法的具体用法?C# PacketWriter.WriteSkip怎么用?C# PacketWriter.WriteSkip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteSkip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessShopItemList
public static void ProcessShopItemList(Client pClient, PacketReader pPacket)
{
PacketWriter pResponseShop = new PacketWriter(Operation.MatchResponseShopItemList, CryptFlags.Decrypt);
pResponseShop.Write(1, 12);
pResponseShop.WriteSkip(12);
pResponseShop.Write(Program.mShop.Count, 4);
foreach (uint item in Program.mShop)
pResponseShop.Write(item);
pClient.Send(pResponseShop);
}
示例2: ResponseLogin
public static void ResponseLogin(Client client, Results results, string user, UGradeId ugrade, PGradeId pgrade, Muid playerId)
{
using (var packetWriter = new PacketWriter(Operation.MatchLoginResponse, CryptFlags.Encrypt))
{
packetWriter.Write((Int32)results);
packetWriter.Write(Globals.Config.Server.Name);
switch (Globals.Config.Server.Mode.ToLower())
{
case "match":
packetWriter.Write((byte)0);
break;
case "clan":
packetWriter.Write((byte)1);
break;
case "quest":
packetWriter.Write((byte)4);
break;;
case "test":
packetWriter.Write((byte)4);
break;
case "develop":
packetWriter.Write((byte)3);
break;
default:
packetWriter.Write((byte)1);
break;
}
packetWriter.Write(user);
packetWriter.Write((byte)ugrade);
packetWriter.Write((byte)pgrade);
packetWriter.Write(playerId);
packetWriter.Write(Globals.Config.Server.Survival);
packetWriter.Write(Globals.Config.Server.DuelTourney);
packetWriter.Write(1, 20);
packetWriter.WriteSkip(20);
client.Send(packetWriter);
}
}
示例3: ProcessLogin
public static void ProcessLogin(Client client, PacketReader pPacket)
{
/* @ARGS
* UserID - string
* Password - string
* CommandVersion - int
* Checksum - int
* MD5 - Blob
*/
var UserID = pPacket.ReadString();
var Password = pPacket.ReadString();
var CommandID = pPacket.ReadInt32();
var Checksum = pPacket.ReadInt32();
var totalSize = pPacket.ReadInt32();
var blobSize = pPacket.ReadInt32();
var count = pPacket.ReadInt32();
Results result = Results.Accepted;
if (blobSize > 32)
{
client.Disconnect();
return;
}
if (!Program.mRegex.IsMatch(UserID) || !Program.mRegex.IsMatch(Password))
result = Results.LoginIncorrectPassword;
else
{
Log.Write("Login: {0} {1}", UserID, Password);
Database.GetAccount(UserID, Password, ref client.mAccount);
if (client.mAccount.nAID == 0)
result = Results.LoginIncorrectPassword;
else if (client.mAccount.nUGradeID == MMatchUserGradeID.Banned || client.mAccount.nUGradeID == MMatchUserGradeID.Penalty)
result = Results.LoginBannedID;
else if (client.mAccount.nAID > 0)
client.mClientFlags = PacketFlags.Login;
}
PacketWriter pLoginResponse = new PacketWriter(Operation.MatchLoginResponse, CryptFlags.Encrypt);
pLoginResponse.Write((Int32)result);
pLoginResponse.Write("Lol Emu Test");
pLoginResponse.Write((byte)2);//Moode
pLoginResponse.Write(UserID);
pLoginResponse.Write((byte)client.mAccount.nUGradeID);
pLoginResponse.Write((byte)client.mAccount.nPGradeID);
pLoginResponse.Write(client.mClientUID);
pLoginResponse.Write(false);
pLoginResponse.Write(1, 20);
pLoginResponse.WriteSkip(20);
client.Send(pLoginResponse);
if (client.mAccount.nUGradeID == MMatchUserGradeID.Banned || client.mAccount.nUGradeID == MMatchUserGradeID.Penalty)
client. Disconnect();
}