mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-03-15 01:58:07 +00:00
Compare commits
1 Commits
4b15b3ee9c
...
4b0fd14838
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b0fd14838 |
@@ -30,7 +30,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
|||||||
if (hotReload)
|
if (hotReload)
|
||||||
{
|
{
|
||||||
ServerLoaded = false;
|
ServerLoaded = false;
|
||||||
_serverLoading = false;
|
|
||||||
OnGameServerSteamAPIActivated();
|
OnGameServerSteamAPIActivated();
|
||||||
OnMapStart(string.Empty);
|
OnMapStart(string.Empty);
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ namespace CS2_SimpleAdmin;
|
|||||||
|
|
||||||
public partial class CS2_SimpleAdmin
|
public partial class CS2_SimpleAdmin
|
||||||
{
|
{
|
||||||
private bool _serverLoading;
|
|
||||||
|
|
||||||
private void RegisterEvents()
|
private void RegisterEvents()
|
||||||
{
|
{
|
||||||
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
RegisterListener<Listeners.OnMapStart>(OnMapStart);
|
||||||
@@ -51,10 +49,6 @@ public partial class CS2_SimpleAdmin
|
|||||||
|
|
||||||
private void OnGameServerSteamAPIActivated()
|
private void OnGameServerSteamAPIActivated()
|
||||||
{
|
{
|
||||||
if (_serverLoading)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_serverLoading = true;
|
|
||||||
new ServerManager().LoadServerData();
|
new ServerManager().LoadServerData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,11 +334,11 @@ public partial class CS2_SimpleAdmin
|
|||||||
if (Config.OtherSettings.ReloadAdminsEveryMapChange && ServerLoaded && ServerId != null)
|
if (Config.OtherSettings.ReloadAdminsEveryMapChange && ServerLoaded && ServerId != null)
|
||||||
AddTimer(3.0f, () => ReloadAdmins(null));
|
AddTimer(3.0f, () => ReloadAdmins(null));
|
||||||
|
|
||||||
// AddTimer(34, () =>
|
AddTimer(34, () =>
|
||||||
// {
|
{
|
||||||
// if (!ServerLoaded)
|
if (!ServerLoaded)
|
||||||
// OnGameServerSteamAPIActivated();
|
OnGameServerSteamAPIActivated();
|
||||||
// });
|
});
|
||||||
|
|
||||||
GodPlayers.Clear();
|
GodPlayers.Clear();
|
||||||
SilentPlayers.Clear();
|
SilentPlayers.Clear();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class ServerManager
|
|||||||
{
|
{
|
||||||
if (CS2_SimpleAdmin.ServerLoaded || CS2_SimpleAdmin.ServerId != null || CS2_SimpleAdmin.Database == null) return;
|
if (CS2_SimpleAdmin.ServerLoaded || CS2_SimpleAdmin.ServerId != null || CS2_SimpleAdmin.Database == null) return;
|
||||||
|
|
||||||
if (_getIpTryCount > 16 && Helper.GetServerIp().StartsWith("0.0.0.0") || string.IsNullOrEmpty(Helper.GetServerIp()))
|
if (_getIpTryCount > 16)
|
||||||
{
|
{
|
||||||
CS2_SimpleAdmin._logger?.LogError("Unable to load server data - can't fetch ip address!");
|
CS2_SimpleAdmin._logger?.LogError("Unable to load server data - can't fetch ip address!");
|
||||||
return;
|
return;
|
||||||
@@ -39,8 +39,6 @@ public class ServerManager
|
|||||||
var address = $"{ipAddress}:{ConVar.Find("hostport")?.GetPrimitiveValue<int>()}";
|
var address = $"{ipAddress}:{ConVar.Find("hostport")?.GetPrimitiveValue<int>()}";
|
||||||
var hostname = ConVar.Find("hostname")!.StringValue;
|
var hostname = ConVar.Find("hostname")!.StringValue;
|
||||||
CS2_SimpleAdmin.IpAddress = address;
|
CS2_SimpleAdmin.IpAddress = address;
|
||||||
|
|
||||||
CS2_SimpleAdmin._logger?.LogInformation("Loaded server with ip {ip}", ipAddress);
|
|
||||||
|
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user