public void OnPlayerConnected(Entity player) { playersInGame = System.IO.File.ReadAllLines(playersInGameTxt); foreach (string playerInGame in playersInGame) { if (player.Name == playerInGame) { WriteLog.Info($"{player.Name} has already been scanned...ignoring them."); return; } } WriteLog.Info($"Detecting if player {player.Name} has a VPN..."); if (isVPN(player.IP.Address.ToString(), player)) { AfterDelay(2000, () => Utilities.ExecuteCommand($"kickclient {player.GetEntityNumber()} \"^1Proxies and VPNs are not allowed in this server.\"")); WriteLog.Warning($"Player {player.Name} has a VPN. Kicking them out."); } else { WriteLog.Info($"Player {player.Name} does not have a VPN. Allowing them in."); } }
void addToPlayersInGame(Entity player) { WriteLog.Info($"Adding {player.Name} to playersInGame.txt..."); System.IO.File.AppendAllText(playersInGameTxt, "\n" + player.Name); }