internal void Initialize() { System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.Highest; R.Log("[Anticheat] is loading..."); aconf = RowacCore.LoadConfig <Config>(Path.Combine(RowacCore.rowacFolder, "anticheat.json")); if (aconf != null && aconf.enabled) { takeCoordsTimer = new Timer(aconf.checkInterval * 1000); takeCoordsTimer.Elapsed += takeCoordsEvent; takeCoordsTimer.Start(); R.Log("[Anticheat] loaded!"); } else { R.Log("[Anticheat] disabled! Check your config."); } }
// TODO: remove ping and guid on user disconnect private void ParsePing(string ping, ulong steamID) { try { #if DEBUG R.Log("Ping: " + ping); #endif string[] data = ping.Split('|'); // [1] - GUID; [2] - ShortTime string guid = data[1]; //if (RowAnticheat.userGuids[steamID] == guid) //RustAPI.KickUser(RustAPI.FindByUserID(steamID), NetError.ApprovalDenied, true); RowacCore.pingTimeTable[steamID] = RowacCore.GetTimeInSeconds(); R.Log(string.Format("[Ping] {0} ({1}) - {2}", steamID, guid, RowacCore.pingTimeTable[steamID])); } catch (Exception ex) { R.LogEx("Ping", ex); } }
public static void Init() { RowacCore.Init(); }