diff --git a/.gitignore b/.gitignore index 081b23ae..890f16a1 100644 --- a/.gitignore +++ b/.gitignore @@ -229,3 +229,4 @@ bootstrap-custom.min.css /DiscordWebhook/env /DiscordWebhook/config.dev.json /GameLogServer/env +launchSettings.json \ No newline at end of file diff --git a/Plugins/ScriptPlugins/SharedGUIDKick.js b/Plugins/ScriptPlugins/SharedGUIDKick.js index b82f0ac5..c0cc3a95 100644 --- a/Plugins/ScriptPlugins/SharedGUIDKick.js +++ b/Plugins/ScriptPlugins/SharedGUIDKick.js @@ -1,6 +1,6 @@ var plugin = { author: 'RaidMax', - version: 1.0, + version: 1.1, name: 'Shared GUID Kicker Plugin', onEventAsync: function (gameEvent, server) { @@ -10,8 +10,7 @@ var plugin = { } // connect or join event - if (gameEvent.Type === 3 || - gameEvent.Type === 4) { + if (gameEvent.Type === 3) { // this GUID seems to have been packed in a IW4 torrent and results in an unreasonable amount of people using the same GUID if (gameEvent.Origin.NetworkId === -805366929435212061) { gameEvent.Origin.Kick('Your GUID is generic. Delete players/guids.dat and rejoin', _IW4MAdminClient); diff --git a/SharedLibraryCore/RCon/StaticHelpers.cs b/SharedLibraryCore/RCon/StaticHelpers.cs index d09c6243..f30ba176 100644 --- a/SharedLibraryCore/RCon/StaticHelpers.cs +++ b/SharedLibraryCore/RCon/StaticHelpers.cs @@ -39,7 +39,7 @@ namespace SharedLibraryCore.RCon /// /// timeout in seconds to wait for a socket send or receive before giving up /// - public static readonly int SocketTimeout = 7500; + public static readonly int SocketTimeout = 10000; /// /// interval in milliseconds to wait before sending the next RCon request /// diff --git a/SharedLibraryCore/ScriptPlugin.cs b/SharedLibraryCore/ScriptPlugin.cs index ad0f0d9b..e7d43b82 100644 --- a/SharedLibraryCore/ScriptPlugin.cs +++ b/SharedLibraryCore/ScriptPlugin.cs @@ -57,7 +57,16 @@ namespace SharedLibraryCore } Manager = mgr; - string script = File.ReadAllText(FileName); + string script; + + using (var stream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + using (var reader = new StreamReader(stream, Encoding.Default)) + { + script = await reader.ReadToEndAsync(); + } + } + ScriptEngine = new Jint.Engine(cfg => cfg.AllowClr(new[] {