Exemple #1
0
        protected override void Init()
        {
            Settings          = DedimaniaUISettings.ReadFromFile(PluginSettingsFilePath);
            UpdateListTimer   = new TimedVolatileExecutionQueue <DedimaniaRanking[]>(TimeSpan.FromSeconds(Settings.UpdateInterval));
            UpdateRecordTimer = new TimedVolatileExecutionQueue <object>(TimeSpan.FromSeconds(Settings.UpdateInterval));

            HostPlugin.RankChanged     += HostPlugin_RankChanged;
            HostPlugin.RankingsChanged += HostPlugin_RankingsChanged;
            Context.RPCClient.Callbacks.PlayerConnect += Callbacks_PlayerConnect;
            Context.RPCClient.Callbacks.EndRace       += Callbacks_EndRace;
        }
Exemple #2
0
        protected override void Init()
        {
            PodiumStage  = false;
            Settings     = LiveRankingsSettings.ReadFromFile(PluginSettingsFilePath);
            LastRankings = new PlayerRank[] {};
            UpdateUI(this);
            UpdateTimer = new TimedVolatileExecutionQueue <LiveRankingPlugin>(TimeSpan.FromSeconds(Settings.UpdateInterval));

            Context.RPCClient.Callbacks.PlayerConnect += Callbacks_PlayerConnect;
            Context.RPCClient.Callbacks.BeginRace     += Callbacks_BeginRace;
            Context.RPCClient.Callbacks.EndRace       += Callbacks_EndRace;
            Context.RPCClient.Callbacks.PlayerFinish  += Callbacks_PlayerFinish;
        }
Exemple #3
0
        public void Test1()
        {
            TimedVolatileExecutionQueue <object[]> queue = new TimedVolatileExecutionQueue <object[]>(TimeSpan.FromSeconds(1));

            const int millisecondsToRun = 5500;

            List <int> addedValues = new List <int>();

            Console.WriteLine(string.Format("[{0}] Start", DateTime.Now));
            for (int i = 0; i < millisecondsToRun / 50; i++)
            {
                queue.Enqueue(Execute, new object[] { addedValues, i });
                Thread.Sleep(50);
            }

            Assert.AreEqual(5, addedValues.Count);
        }
Exemple #4
0
        protected override void Init()
        {
            LastRankings = new RankEntry[] { };
            Settings     = LocalRecordsUISettings.ReadFromFile(PluginSettingsFilePath);

            if (Settings.MaxRecordsToShow > HostPlugin.Settings.MaxRecordsToReport)
            {
                Settings.MaxRecordsToShow = HostPlugin.Settings.MaxRecordsToReport;
            }

            UpdateListTimer        = new TimedVolatileExecutionQueue <RankEntry[]>(TimeSpan.FromSeconds(Settings.UpdateInterval));
            UpdateLocalRecordTimer = new TimedVolatileExecutionQueue <string>(TimeSpan.FromSeconds(Settings.UpdateInterval));

            //SendPBManiaLinkPageToAll(null);
            HostPlugin.PlayerNewRecord                += HostPlugin_PlayerNewRecord;
            HostPlugin.LocalRecordsDetermined         += HostPlugin_LocalRecordsDetermined;
            HostPlugin.PlayerWins                     += HostPlugin_PlayerWins;
            Context.RPCClient.Callbacks.EndRace       += Callbacks_EndRace;
            Context.RPCClient.Callbacks.PlayerConnect += Callbacks_PlayerConnect;
            Context.RPCClient.Callbacks.PlayerChat    += Callbacks_PlayerChat;
        }