예제 #1
0
        public AuthGameGuard(L2Client Client, byte[] Packet) : base(Client, Packet)
        {
            _SessionId = ReadInt();

            if (_Client.GetSessionId() == _SessionId)
            {
                _Client.SendPacket(new GGAuth(_SessionId));
            }
        }
예제 #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());
     }
 }
예제 #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);
            }
        }
예제 #4
0
 public ClientPacketHandler(L2Client Client, byte[] Packet)
 {
     _Client = Client;
     _Packet = Packet;
     HandlePacket();
 }
예제 #5
0
 public ReceivablePacket(L2Client Client, byte[] Packet)
 {
     _Client = Client;
     _Packet = Packet;
 }
예제 #6
0
 int ISendablePacket.Write(L2Client client, out byte[] buffer)
 {
     return(Write(client as T, out buffer));
 }
예제 #7
0
 public L2ClientPacket(L2Client Client, byte[] Packet) : base(Client, Packet)
 {
 }
예제 #8
0
파일: Init.cs 프로젝트: Shinhwe/l2se
 public Init(L2Client Client)
 {
     _SessionId   = Client.GetSessionId();
     _PublicKey   = Client.GetPublicKey();
     _BlowfishKey = Client.GetBlowfishKey();
 }