示例#1
0
        private unsafe void Process_AuthAccountExPacket(LoginPlayer client, AccountExPacket packet)
        {
            var account = Database.ServerDatabase.Context.Accounts.GetByName(packet.Account);

            AuthResponsePacket reply = AuthResponsePacket.Create();

            if (account == null)
            {
                reply.Data1 = Constants.RESPONSE_INVALID;
            }
            else if (account.Permission == Enum.PlayerPermission.Banned)
            {
                reply.Data1 = Constants.RESPONSE_BANNED;
            }
            else if (account.Password.Equals(packet.Password))
            {
                client.Account       = new Account(account);
                client.Account.Token = (uint)LoginCounter.Counter;
                client.Account.AllowLogin();
                reply.Data1      = Constants.RESPONSE_VALID;
                reply.ServerPort = Constants.GAME_PORT;
                reply.Info       = Constants.GAME_IP;
                reply.AccountId  = account.Token;
                Console.WriteLine("Client {0} Connecting to server {1}", packet.Account, packet.Server);
            }
            client.Send(reply);
        }
示例#2
0
        private void Process_AuthMacAddressPacket(LoginPlayer client, MacAddressPacket packet)
        {
            ConnectAuthPacket msg;

            if (ConnectAuthPacket.Create(packet.AccountId, 20, "version.dat", out msg))
            {
                client.Send(msg);
            }
        }