public async Task StatusExtra()
        {
            var _Builder = new EmbedBuilder
            {
                Color  = new Color(65, 105, 225),
                Footer = new EmbedFooterBuilder()
                {
                    Text = $"Requested by @{Context.User.Username}"
                },
                Timestamp = DateTime.UtcNow,
            };

            _Builder.WithTitle(Utils.ParseConfigString("DiscordServerName") + " Status");


            _Builder.AddInlineField("SocketAsyncEventArgs", $"Created: {Gateway.NumberOfArgsCreated}\nIn-use: {Gateway.NumberOfArgsInUse}\nAvailable: {Gateway.NumberOfArgs}");
            _Builder.AddInlineField("Buffer", $"Created: {Gateway.NumberOfBuffersCreated}\nIn-use: {Gateway.NumberOfBuffersInUse}\nAvailable: {Gateway.NumberOfBuffers}");

            _Builder.AddInlineField("Online Players", $"{ResourcesManager.OnlinePlayers.Count}");
            _Builder.AddInlineField("In Memory Clans", $"{ResourcesManager.GetInMemoryAllianceCount()}");
            _Builder.AddInlineField("Saved Players", MySQL_V2.GetPlayerCount());
            _Builder.AddInlineField("Saved Clans", MySQL_V2.GetClanCount());

            await ReplyAsync("", false, _Builder);
        }
Exemple #2
0
        internal void Fetch()
        {
            foreach (var _Id in MySQL_V2.GetTopPlayer())
            {
                this.Add("INTERNATIONAL", Players.Get(_Id));
            }

            Timer Timer = new Timer
            {
                Interval  = TimeSpan.FromMinutes(0.5).TotalMilliseconds,
                AutoReset = true,
            };


            Timer.Elapsed += (_Sender, _Args) =>
            {
                this.TryRemove("INTERNATIONAL");
                foreach (var _Id in MySQL_V2.GetTopPlayer())
                {
                    this.Add("INTERNATIONAL", Players.Get(_Id));
                }
            };

            this.LTimers.Add(Timer);
        }
Exemple #3
0
        internal Classes()
        {
            this.MFactory = new MessageFactory();
            this.CFactory = new CommandFactory();
            this.DFactory = new DebugFactory();
            Loggers.Initialize();
            Fingerprint      = new Fingerprint();
            this.CSV         = new CSV();
            this.Home        = new Home();
            this.Npc         = new NPC();
            this.Game_Events = new Game_Events();
            this.Fingerprint = new Fingerprint();
            switch (Constants.Database)
            {
            case DBMS.Redis:
            case DBMS.Both:
                this.Redis = new Redis();
                break;
            }

            this.Events = new EventsHandler();
#if DEBUG
            Console.WriteLine("We loaded " + MessageFactory.Messages.Count + " messages, " + CommandFactory.Commands.Count + " commands, and " + DebugFactory.Debugs.Count + " debug commands.\n");
#endif
            this.Timers = new Timers();

            this.Test = new Test();

            MySQL_V2.GetAllSeed();
        }
Exemple #4
0
 internal static void Initialize()
 {
     MessageFactory.Initialize();
     CSV.Initialize();
     Home.Initialize();
     NPC.Initialize();
     Fingerprint.Initialize();
     MySQL_V2.GetAllSeed();
 }
 public static long GetMaxPlayerId()
 {
     try
     {
         return(MySQL_V2.GetPlayerSeed());
     }
     catch (Exception ex)
     {
         ExceptionLogger.Log(ex, "Exception while trying to retrieve max player ID; check config.");
     }
     return(-1);
 }
 public static long GetMaxAllianceId()
 {
     try
     {
         return(MySQL_V2.GetAllianceSeed());
     }
     catch (Exception ex)
     {
         ExceptionLogger.Log(ex, "Exception while trying to retrieve max alliance ID; check config.");
     }
     return(-1);
 }
 public Friend_List_Data(Device Device, List <string> ID) : base(Device)
 {
     this.Identifier = 20105;
     this.Players    = MySQL_V2.GetPlayerViaFID(ID);
     this.Players    = this.Players?.OrderByDescending(t => t.Avatar.Trophies).ToList();
 }
 internal Players()
 {
     this.Seed = MySQL_V2.GetPlayerSeed() + 1;
 }