コード例 #1
0
 private void LoadSleepers()
 {
     foreach (BasePlayer player in BasePlayer.sleepingPlayerList)
     {
         PlayerData.TryLoad(player);
     }
 }
コード例 #2
0
ファイル: KDRGui.cs プロジェクト: wilddip/oxideplugins
 void Loaded()
 {
     foreach (var player in BasePlayer.activePlayerList)
     {
         PlayerData.TryLoad(player);
     }
 }
コード例 #3
0
 void OnServerInitialized()
 {
     foreach (var player in BasePlayer.activePlayerList)
     {
         PlayerData.TryLoad(player);
     }
 }
コード例 #4
0
 void OnPlayerDisconnected(BasePlayer player)
 {
     PlayerData.TryLoad(player);
     if (!AllPlayerIds.Contains(player.userID))
     {
         AllPlayerIds.Add(player.userID);
         SaveAllPlayers();
     }
 }
コード例 #5
0
 void LoadAllPlayers()
 {
     AllPlayerIds = Interface.Oxide.DataFileSystem.ReadObject <HashSet <ulong> >($"KDRGui/allPlayerIds");
     foreach (ulong playerId in AllPlayerIds)
     {
         PrintWarning($"player '{playerId}' from AllPlayerIds");
         PlayerData.TryLoad(playerId);
     }
 }
コード例 #6
0
ファイル: KDRGui.cs プロジェクト: wilddip/oxideplugins
        string GetTopList()
        {
            foreach (BasePlayer player in BasePlayer.sleepingPlayerList)
            {
                PlayerData.TryLoad(player);
            }

            return(string.Join("\n", LoadedPlayerData.OrderByDescending((d) => d.kills).Select((d) => $"{d.kills}                                                {d.deaths}                                                {d.KDR.ToString("0.00")}                                              {d.name}").Take(15).ToArray()));
        }
コード例 #7
0
 void OnPlayerConnected(BasePlayer player)
 {
     PlayerData.TryLoad(player);
     if (!FAllPlayerIds.Contains(player.userID))
     {
         FAllPlayerIds.Add(player.userID);
         AllPlayersDataHasChanged();
     }
 }
コード例 #8
0
 void OnPlayerConnected(BasePlayer player)
 {
     PrintWarning($"Try to load '{player.userID}/{player.displayName}' from OnPlayerConnected");
     PlayerData.TryLoad(player);
     if (!AllPlayerIds.Contains(player.userID))
     {
         AllPlayerIds.Add(player.userID);
         SaveAllPlayers();
     }
 }
コード例 #9
0
 private void LoadSleepers()
 {
     foreach (BasePlayer player in BasePlayer.sleepingPlayerList)
     {
         PrintWarning($"Try to load '{player.userID}/{player.displayName}' from the sleepers list");
         PlayerData.TryLoad(player);
         if (!AllPlayerIds.Contains(player.userID))
         {
             AllPlayerIds.Add(player.userID);
             SaveAllPlayers();
         }
     }
 }
コード例 #10
0
 void OnServerInitialized()
 {
     LoadAllPlayers();
     foreach (var player in BasePlayer.activePlayerList)
     {
         PrintWarning($"Try to load '{player.userID}/{player.displayName}' from the active player list");
         PlayerData.TryLoad(player);
         if (!AllPlayerIds.Contains(player.userID))
         {
             AllPlayerIds.Add(player.userID);
         }
     }
     SaveAllPlayers();
 }
コード例 #11
0
        void Loaded()
        {
            if (!Scoreboards)
            {
                PrintWarning("The Scoreboard API must be enabled for this plugin to fully function, Get it here: http://oxidemod.org/plugins/scoreboards-api.2054/");
            }

            Instance = this;

            foreach (var player in BasePlayer.activePlayerList)
            {
                PlayerData.TryLoad(player);
            }

            KDR_Scoreboard();
            KillsScoreboard();
            DeathsScoreboard();
        }
コード例 #12
0
        void OnServerInitialized()
        {
            FInstance = this;
            if (!AshTools)
            {
                PrintError("AshTools is not present, this plugins will not works");
                Unsubscribe("OnEntityTakeDamage");
                Unsubscribe("OnEntityDeath");
                return;
            }

            LoadAllPlayers();
            foreach (BasePlayer player in BasePlayer.activePlayerList)
            {
                PlayerData.TryLoad(player);
                PrintWarning($"Loaded ICL data from OnServerInitialized for '{player.userID}/{player.displayName}= {PlayerData.Find(player)?.FImprovedHitInfos.Count.ToString() ?? "0"}'");
                if (!FAllPlayerIds.Contains(player.userID))
                {
                    FAllPlayerIds.Add(player.userID);
                    AllPlayersDataHasChanged();
                }
            }
            foreach (ulong playerId in FAllPlayerIds)
            {
                if (PlayerData.TryLoad(playerId))
                {
                    PrintWarning($"Loaded ICL data from OnServerInitialized/FAllPlayerIds for '{playerId}= {PlayerData.Find(playerId)?.FImprovedHitInfos.Count.ToString() ?? "0"}'");
                }
            }

            timer.Every(FConfigFile.DelayBetweenSave, () =>
            {
                SaveAllPlayersIFN();
                foreach (PlayerData playerData in FLoadedPlayerData)
                {
                    playerData.ForceSave();
                }
            });
        }
コード例 #13
0
        //void LoadSleeperData()
        //{
        //    var sleepers = BasePlayer.sleepingPlayerList;
        //    foreach(var sleeper in sleepers)
        //    {
        //        PlayerData.TryLoad(sleeper);
        //        Puts("Loaded sleeper data");
        //    }
        //}

        void OnPlayerDisconnected(BasePlayer player)
        {
            PlayerData.TryLoad(player);
        }
コード例 #14
0
 void OnPlayerInit(BasePlayer player)
 {
     PlayerData.TryLoad(player);
 }