Ejemplo n.º 1
0
        public void AuthenticationTicketMessageFrame(WorldClient client, AuthenticationTicketMessage authenticationTicketMessage)
        {
            string ticket = AuthenticationUtils.DecodeTicket(authenticationTicketMessage.ticket);

            //client.SendPacket(new AuthenticationTicketAcceptedMessage());
            var account = AccountRepository.Instance.GetAccountByTicket(ticket);

            if (account == null)
            {
                client.SendPacket(new AuthenticationTicketRefusedMessage());
                return;
            }

            client.Account = account;
            Console.WriteLine("'{0}' switched to world with Ticket={1}", client.Account.Login, ticket);
            client.SendPacket(new AuthenticationTicketAcceptedMessage());
            client.SendPacket(new TrustStatusMessage(true, false));
        }