Ejemplo n.º 1
0
        public AuthGameGuard(L2Client Client, byte[] Packet) : base(Client, Packet)
        {
            _SessionId = ReadInt();

            if (_Client.GetSessionId() == _SessionId)
            {
                _Client.SendPacket(new GGAuth(_SessionId));
            }
        }
Ejemplo n.º 2
0
 public RequestServerList(L2Client Client, byte[] Packet) : base(Client, Packet)
 {
     _loginOkId1 = ReadInt();
     _loginOkId2 = ReadInt();
     if (_Client.CheckLogin(_loginOkId1, _loginOkId2))
     {
         //TODO: ServerList
         //_Client.SendPacket(new ServerList());
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 public ClientPacketHandler(L2Client Client, byte[] Packet)
 {
     _Client = Client;
     _Packet = Packet;
     HandlePacket();
 }
Ejemplo n.º 5
0
 public ReceivablePacket(L2Client Client, byte[] Packet)
 {
     _Client = Client;
     _Packet = Packet;
 }
Ejemplo n.º 6
0
 int ISendablePacket.Write(L2Client client, out byte[] buffer)
 {
     return(Write(client as T, out buffer));
 }
Ejemplo n.º 7
0
 public L2ClientPacket(L2Client Client, byte[] Packet) : base(Client, Packet)
 {
 }
Ejemplo n.º 8
0
Archivo: Init.cs Proyecto: Shinhwe/l2se
 public Init(L2Client Client)
 {
     _SessionId   = Client.GetSessionId();
     _PublicKey   = Client.GetPublicKey();
     _BlowfishKey = Client.GetBlowfishKey();
 }