public AuthGameGuard(L2Client Client, byte[] Packet) : base(Client, Packet) { _SessionId = ReadInt(); if (_Client.GetSessionId() == _SessionId) { _Client.SendPacket(new GGAuth(_SessionId)); } }
public RequestServerList(L2Client Client, byte[] Packet) : base(Client, Packet) { _loginOkId1 = ReadInt(); _loginOkId2 = ReadInt(); if (_Client.CheckLogin(_loginOkId1, _loginOkId2)) { //TODO: ServerList //_Client.SendPacket(new ServerList()); } }
public RequestAuthLogin(L2Client Client, byte[] Packet) : base(Client, Packet) { _Raw = ReadBytes(_Raw.Length); string UserName = ""; string PassWord = ""; AsymmetricKeyParameter PrivateKey = _Client.GetPrivateKey(); RsaEngine rsa = new RsaEngine(); rsa.Init(false, PrivateKey); byte[] decrypt = rsa.ProcessBlock(_Raw, 0, 128); if (decrypt.Length < 128) { byte[] temp = new byte[128]; Array.Copy(decrypt, 0, temp, 128 - decrypt.Length, decrypt.Length); decrypt = temp; } UserName = PrepareString(Encoding.UTF8.GetString(decrypt, 0x5E, 14).ToLower()); PassWord = PrepareString(Encoding.UTF8.GetString(decrypt, 0x6C, 16)); if (Regex.Match(UserName, LoginConfig.ACCOUNT_TEMPLATE).Success&& Regex.Match(PassWord, LoginConfig.PASSWORD_TEMPLATE).Success) { Account AC = new Account(UserName, PassWord); if (AC.IsExist()) { if (AC.IsPassWordCorrect()) { LoginSession Session = new LoginSession(); _Client.SetLoginSession(Session); _Client.SendPacket(new LoginSuccess(Session)); } else { _Client.DisConnetion(LoginFailReason.REASON_USER_OR_PASS_WRONG); } } else { if (LoginConfig.AUTO_CREATE_ACCOUNT) { AC.Register(); LoginSession Session = new LoginSession(); _Client.SetLoginSession(Session); _Client.SendPacket(new LoginSuccess(Session)); } else { _Client.DisConnetion(LoginFailReason.REASON_ACCOUNT_INFO_INCORR); } } } else { _Client.DisConnetion(LoginFailReason.REASON_USER_OR_PASS_WRONG); } }
public ClientPacketHandler(L2Client Client, byte[] Packet) { _Client = Client; _Packet = Packet; HandlePacket(); }
public ReceivablePacket(L2Client Client, byte[] Packet) { _Client = Client; _Packet = Packet; }
int ISendablePacket.Write(L2Client client, out byte[] buffer) { return(Write(client as T, out buffer)); }
public L2ClientPacket(L2Client Client, byte[] Packet) : base(Client, Packet) { }
public Init(L2Client Client) { _SessionId = Client.GetSessionId(); _PublicKey = Client.GetPublicKey(); _BlowfishKey = Client.GetBlowfishKey(); }