本文整理汇总了C#中PacketIn.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# PacketIn.Skip方法的具体用法?C# PacketIn.Skip怎么用?C# PacketIn.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketIn
的用法示例。
在下文中一共展示了PacketIn.Skip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public int HandlePacket(BaseClient bcclient, PacketIn packet)
{
LobbyClient client = bcclient as LobbyClient;
packet.Skip(24);
String Email = packet.GetParsedString();
Log.Notice("ASK_LOGIN", "Account: " + Email);
Account account;
try
{
account = new Account(Email);
}
catch (ArgumentNullException)
{
Log.Error("ASK_LOGIN", "Database is busy");
ANS_LOGIN_FAILED.Send(client, (int)ResponseCodes.RC_DATABASE_BUSY);
client.Disconnect();
return 0;
}
catch (Exception e)
{
Log.Error("ASK_LOGIN", "Account's not found");
Log.Debug("ASK_LOGIN", e.ToString());
ANS_LOGIN_FAILED.Send(client, (int)ResponseCodes.RC_LOGIN_INVALID_ACCOUNT);
client.Disconnect();
return 0;
}
Log.Succes("ASK_LOGIN", "Account exists");
client.Account = account;
if (client.Account.extrn_login == 1)
{
if (client.Account.Verifier.Length <= 2 || client.Account.Salt.Length <= 2) Register(client);
client.Salt = new FrameWork.NetWork.Crypto.BigInteger(client.Account.Salt, 16).ToByteArrayUnsigned();
client.Verifier = new FrameWork.NetWork.Crypto.BigInteger(client.Account.Verifier, 16);
LOGIN_SALT.Send(client);
return 0;
}
else
{
ANS_LOGIN_FAILED.Send(client, (int)ResponseCodes.RC_LOGIN_APB_INACTIVATED);
client.Disconnect();
return 0;
}
}