-add ScriptBan event
-add new automated penalty to ban players for certain filtered words or phrases
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
using SharedLibraryCore;
|
||||
using Serilog.Debugging;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using SharedLibraryCore.Events.Game;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using EventGeneratorCallback = System.ValueTuple<string, string,
|
||||
System.Func<string, SharedLibraryCore.Interfaces.IEventParserConfiguration,
|
||||
SharedLibraryCore.GameEvent,
|
||||
@ -13,6 +16,7 @@ namespace IW4MAdmin.Plugins.ClanTagRankCommands.Events
|
||||
{
|
||||
|
||||
private const string EVENT_RC = "RC";
|
||||
private const string EVENT_ScriptBan = "ScriptBan";
|
||||
|
||||
/// <summary>
|
||||
/// this is a custom event printed out by _clientids.gsc (used for recording highest personal round records)
|
||||
@ -37,6 +41,28 @@ namespace IW4MAdmin.Plugins.ClanTagRankCommands.Events
|
||||
}
|
||||
);
|
||||
}
|
||||
private EventGeneratorCallback ScriptBan()
|
||||
{
|
||||
return (EVENT_ScriptBan, EVENT_ScriptBan, (eventLine, _, _) =>
|
||||
{
|
||||
string[] lineSplit = eventLine.Split(";");
|
||||
|
||||
|
||||
long originId = lineSplit[1].ConvertGuidToLong(NumberStyles.Integer);
|
||||
int clientnum = int.Parse(lineSplit[2]);
|
||||
var scriptBan = new ScriptBanEvent
|
||||
|
||||
{
|
||||
Type = GameEvent.EventType.Other,
|
||||
Subtype = EVENT_ScriptBan,
|
||||
Origin = Utilities.IW4MAdminClient(),
|
||||
Target = new EFClient { NetworkId = originId, Name = lineSplit[3], ClientNumber = clientnum },
|
||||
ScriptData = eventLine
|
||||
};
|
||||
return scriptBan;
|
||||
}
|
||||
);
|
||||
}
|
||||
//private const string EVENT_RoundNumber = "RoundNumber";
|
||||
|
||||
///// <summary>
|
||||
@ -60,8 +86,12 @@ namespace IW4MAdmin.Plugins.ClanTagRankCommands.Events
|
||||
public IEnumerable<EventGeneratorCallback> Events =>
|
||||
new[]
|
||||
{
|
||||
RC(),
|
||||
RC(),ScriptBan()
|
||||
|
||||
};
|
||||
|
||||
public class ScriptBanEvent : GameScriptEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user