Exemple #1
0
        public void SendLoginResponse(byte[] data)
        {
            var iPkt = new UA_LOGIN_REQ();

            iPkt.SetData(data);
            SysCons.LogInfo("UA_LOGIN_REQ UserID({0}) CodePage({1}) Version({2}.{3})", iPkt.UserID, iPkt.CodePage, iPkt.MajorVer, iPkt.MinorVer);
            Username  = iPkt.UserID;
            Password  = iPkt.UserPW;
            AccountID = (uint)AuthDB.GetAccountID(Username);

            using (var oPkt = new AU_COMMERCIAL_SETTING_NFY())
            {
                oPkt.BuildPacket();
                Client.Send(oPkt.Data);
            }

            using (var oPkt = new AU_LOGIN_RES())
            {
                oPkt.UserID    = iPkt.UserID;
                oPkt.AccountID = AccountID;
                oPkt.AllowedFunctionForDeveloper = 65535;
                oPkt.AuthKey       = "SE@WASDE#$RFWD@D";
                oPkt.ResultCode    = (ushort)AuthDB.CheckAccount(this.Username, this.Password);
                oPkt.lastServerID  = 255;
                oPkt.lastChannelID = 255;
                oPkt.BuildCharServerList();
                oPkt.BuildPacket();
                Client.Send(oPkt.Data);
            }
        }
Exemple #2
0
        public void SendLoginResponse(byte[] data)
        {
            Packet oPkt = new Packet();

            oPkt.Opcode = (ushort)PacketOpcodes.AU_COMMERCIAL_SETTING_NFY;
            oPkt.BuildPacket();
            this.Client.Send(oPkt.Data);

            UA_LOGIN_REQ inPkt = new UA_LOGIN_REQ();

            inPkt.SetData(data);
            SysCons.LogInfo("UA_LOGIN_REQ {0} CodePage({1}) {2}.{3}", inPkt.UserID, inPkt.CodePage, inPkt.MajorVer, inPkt.MinorVer);
            this.Username  = inPkt.UserID;
            this.Password  = inPkt.UserPW;
            this.AccountID = (uint)AuthDB.GetAccountID(this.Username);

            AU_LOGIN_RES sPkt = new AU_LOGIN_RES();

            sPkt.UserID    = inPkt.UserID;
            sPkt.AccountID = this.AccountID;
            sPkt.AllowedFunctionForDeveloper = 65535;
            sPkt.AuthKey       = Encoding.ASCII.GetBytes("SE@WASDE#$RFWD@D");
            sPkt.ResultCode    = (ushort)AuthDB.CheckAccount(this.Username, this.Password);
            sPkt.lastServerID  = 255;
            sPkt.lastChannelID = 255;
            sPkt.BuildCharServerList();
            sPkt.BuildPacket();
            this.Client.Send(sPkt.Data);
        }