Beispiel #1
0
 private void OnReply(TriggerBase trigger, AccountAnswerMessage reply)
 {
     trigger.Reply("Account : {0} ({1})", new object[]
     {
         trigger.Bold(reply.Account.Login),
         trigger.Bold(reply.Account.Id)
     });
     trigger.Reply("Banned : {0}", new object[]
     {
         trigger.Bold(reply.Account.IsBanned)
     });
     trigger.Reply("Jailed : {0}", new object[]
     {
         trigger.Bold(reply.Account.IsJailed)
     });
     if (reply.Account.IsBanned)
     {
         trigger.Reply("Reason : {0}", new object[]
         {
             trigger.Bold(reply.Account.BanReason)
         });
         trigger.Reply("Until : {0}", new object[]
         {
             trigger.Bold(reply.Account.BanEndDate)
         });
     }
 }
Beispiel #2
0
        private static void OnReply(TriggerBase trigger, AccountAnswerMessage reply)
        {
            trigger.Reply("Account : {0} ({1})", trigger.Bold(reply.Account.Login),
                          trigger.Bold(reply.Account.Id));

            trigger.Reply("Banned : {0}", trigger.Bold(reply.Account.IsBanned));
            trigger.Reply("Jailed : {0}", trigger.Bold(reply.Account.IsJailed));
            trigger.Reply("Reason : {0}", trigger.Bold(reply.Account.BanReason));
            trigger.Reply("Until : {0}", trigger.Bold(reply.Account.BanEndDate));
        }
        private static void OnAccountReceived(AccountAnswerMessage message, WorldClient client)
        {
            lock (ApproachHandler.ConnectionQueue.SyncRoot)
            {
                ApproachHandler.ConnectionQueue.Remove(client);
            }
            if (client.QueueShowed)
            {
                ApproachHandler.SendQueueStatusMessage(client, 0, 0);
            }
            AccountData account = message.Account;

            if (account == null)
            {
                client.Send(new AuthenticationTicketRefusedMessage());
                client.DisconnectLater(1000);
            }
            else
            {
                WorldAccount worldAccount = Singleton <AccountManager> .Instance.FindById(account.Id);

                if (worldAccount != null)
                {
                    client.WorldAccount = worldAccount;
                    if (client.WorldAccount.ConnectedCharacter.HasValue)
                    {
                        Character character = Singleton <World> .Instance.GetCharacter(client.WorldAccount.ConnectedCharacter.Value);

                        if (character != null)
                        {
                            character.LogOut();
                        }
                    }
                }

                client.SetCurrentAccount(account);
                client.Send(new AuthenticationTicketAcceptedMessage());

                BasicHandler.SendBasicTimeMessage(client);
                ApproachHandler.SendServerOptionalFeaturesMessage(client, new sbyte[1] {
                    7
                });
                ApproachHandler.SendAccountCapabilitiesMessage(client);
                client.Send(new TrustStatusMessage(true, false));
                if (client.UserGroup.Role >= RoleEnum.Moderator)
                {
                    ApproachHandler.SendConsoleCommandsListMessage(client);
                }
            }
        }
Beispiel #4
0
        static void OnAccountReceived(AccountAnswerMessage message, WorldClient client)
        {
            var character = client.Character;

            if (character == null)
            {
                return;
            }

            client.Account.LastVote = message.Account.LastVote;

            if (World.Instance.GetCharacters(x => x != character && x.Account.LastHardwareId == message.Account.LastHardwareId &&
                                             x.Account.LastVote >= VoteDateTime).Any())
            {
                return;
            }

            client.Character.DisplayNotification(
                "Plus de 3H se sont écoulées depuis votre dernier vote, vous pouvez à nouveau voter pour gagner des Ogrines en cliquant <u><b><a href='http://www.azote.us/vote' target='_blank'><font color='#0000FF'>ICI</font></a></b></u>",
                NotificationEnum.ERREUR);
        }
Beispiel #5
0
        static void OnAccountReceived(AccountAnswerMessage message, WorldClient client)
        {
            if (AccountManager.Instance.IsAccountBlocked(message.Account.Id, out Character dummy))
            {
                logger.Error($"{client} - Account({message.Account.Id}) blocked, connection unallowed");
                client.Disconnect();
            }

            lock (ConnectionQueue.SyncRoot)
                ConnectionQueue.Remove(client);

            if (client.QueueShowed)
            {
                SendQueueStatusMessage(client, 0, 0); // close the popup
            }
            var ticketAccount = message.Account;

            /* Check null ticket */
            if (ticketAccount == null)
            {
                client.Send(new AuthenticationTicketRefusedMessage());
                client.DisconnectLater(1000);
                return;
            }

            var clients = WorldServer.Instance.FindClients(x => x.Account != null && x.Account.Id == ticketAccount.Id).ToArray();

            clients.ForEach(x => x.Disconnect());

            // not an expected situation
            if (clients.Length > 0)
            {
                client.Disconnect();
                return;
            }

            /* Bind WorldAccount if exist */
            var account = AccountManager.Instance.FindById(ticketAccount.Id);

            if (account != null)
            {
                client.WorldAccount = account;

                if (client.WorldAccount.ConnectedCharacter != null)
                {
                    var character = World.Instance.GetCharacter(client.WorldAccount.ConnectedCharacter.Value);

                    if (character != null)
                    {
                        character.LogOut();
                    }
                }
            }

            /* Bind Account & Characters */
            client.SetCurrentAccount(ticketAccount);

            /* Ok */
            client.Send(new AuthenticationTicketAcceptedMessage());
            SendServerOptionalFeaturesMessage(client, OptionalFeaturesEnum.PvpArena);
            SendServerSessionConstantsMessage(client,
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.TIME_BEFORE_DISCONNECTION, BaseServer.Settings.InactivityDisconnectionTime * 1000 ?? -1),
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.KOH_DURATION, 7200000),
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.KOH_WINNING_SCORE, 30),
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.MINIMAL_TIME_BEFORE_KOH, 86400000),
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.TIME_BEFORE_WEIGH_IN_KOH, 60000),
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.UNKOWN_6, 10),
                                              new ServerSessionConstantInteger((short)ServerConstantTypeEnum.UNKNOW_7, 2000));
            SendAccountCapabilitiesMessage(client);

            client.Send(new TrustStatusMessage(true, true)); // Restrict actions if account is not trust

            /* Just to get console AutoCompletion */
            if (client.UserGroup.IsGameMaster)
            {
                SendConsoleCommandsListMessage(client, CommandManager.Instance.AvailableCommands.Where(x => client.UserGroup.IsCommandAvailable(x)));
            }
        }