update shared guid kick plugin

script plugins reload without error using the correct file share mode when opening
increase socket timeout to 10 seconds
This commit is contained in:
RaidMax 2018-10-09 20:19:06 -05:00
parent 7caee55a7e
commit b5e9519f0c
4 changed files with 14 additions and 5 deletions

1
.gitignore vendored
View File

@ -229,3 +229,4 @@ bootstrap-custom.min.css
/DiscordWebhook/env
/DiscordWebhook/config.dev.json
/GameLogServer/env
launchSettings.json

View File

@ -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);

View File

@ -39,7 +39,7 @@ namespace SharedLibraryCore.RCon
/// <summary>
/// timeout in seconds to wait for a socket send or receive before giving up
/// </summary>
public static readonly int SocketTimeout = 7500;
public static readonly int SocketTimeout = 10000;
/// <summary>
/// interval in milliseconds to wait before sending the next RCon request
/// </summary>

View File

@ -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[]
{