private void LoadSleepers() { foreach (BasePlayer player in BasePlayer.sleepingPlayerList) { PlayerData.TryLoad(player); } }
void Loaded() { foreach (var player in BasePlayer.activePlayerList) { PlayerData.TryLoad(player); } }
void OnServerInitialized() { foreach (var player in BasePlayer.activePlayerList) { PlayerData.TryLoad(player); } }
void OnPlayerDisconnected(BasePlayer player) { PlayerData.TryLoad(player); if (!AllPlayerIds.Contains(player.userID)) { AllPlayerIds.Add(player.userID); SaveAllPlayers(); } }
void LoadAllPlayers() { AllPlayerIds = Interface.Oxide.DataFileSystem.ReadObject <HashSet <ulong> >($"KDRGui/allPlayerIds"); foreach (ulong playerId in AllPlayerIds) { PrintWarning($"player '{playerId}' from AllPlayerIds"); PlayerData.TryLoad(playerId); } }
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())); }
void OnPlayerConnected(BasePlayer player) { PlayerData.TryLoad(player); if (!FAllPlayerIds.Contains(player.userID)) { FAllPlayerIds.Add(player.userID); AllPlayersDataHasChanged(); } }
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(); } }
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(); } } }
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(); }
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(); }
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(); } }); }
//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); }
void OnPlayerInit(BasePlayer player) { PlayerData.TryLoad(player); }