Skip to content

Commit c242aa2

Browse files
authored
Merge pull request #23 from Hedius/test
Version 8.1.9.0
2 parents ecad3e9 + d063138 commit c242aa2

File tree

4 files changed

+219
-7
lines changed

4 files changed

+219
-7
lines changed

AdKats.cs

Lines changed: 152 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
* Work on fork by Hedius (Version >= 8.0.0.0)
2222
*
2323
* AdKats.cs
24-
* Version 8.1.8.0
25-
* 13-JAN-2023
24+
* Version 8.1.9.0
25+
* 18-FEB-2023
2626
*
2727
* Automatic Update Information
28-
* <version_code>8.1.8.0</version_code>
28+
* <version_code>8.1.9.0</version_code>
2929
*/
3030

3131
using System;
@@ -68,7 +68,7 @@ public class AdKats : PRoConPluginAPI, IPRoConPluginInterface
6868
{
6969

7070
//Current Plugin Version
71-
private const String PluginVersion = "8.1.8.0";
71+
private const String PluginVersion = "8.1.9.0";
7272

7373
public enum GameVersionEnum
7474
{
@@ -1117,7 +1117,7 @@ public AdKats()
11171117

11181118
public String GetPluginName()
11191119
{
1120-
return "AdKats - Advanced In-Game Admin";
1120+
return "E4GLAdKats - Advanced In-Game Admin";
11211121
}
11221122

11231123
public String GetPluginVersion()
@@ -21023,7 +21023,7 @@ private void QueueRecordForProcessing(ARecord record)
2102321023
NowDuration(aRecord.record_time).TotalMinutes < 5 &&
2102421024
aRecord.command_action.command_key != "player_report_confirm") >= 1)
2102521025
{
21026-
SendMessageToSource(record, "Do not have report wars. If this is urgent please contact an admin in teamspeak; " + GetChatCommandByKey("self_voip") + " for the address.");
21026+
SendMessageToSource(record, "Do not have report wars. If this is urgent please contact an admin in Discord; " + GetChatCommandByKey("self_voip") + " for the address.");
2102721027
QueueRecordForProcessing(new ARecord
2102821028
{
2102921029
record_source = ARecord.Sources.Automated,
@@ -29511,6 +29511,77 @@ public void CompleteRecordInformation(ARecord record, AChatMessage message)
2951129511
}
2951229512
}
2951329513
break;
29514+
// Hedius: REDUDANCY part 10k. :) This plugin is a mess.
29515+
case "player_language_punish":
29516+
case "player_language_reset":
29517+
{
29518+
//Remove previous commands awaiting confirmation
29519+
CancelSourcePendingAction(record);
29520+
29521+
if (_serverInfo.ServerType == "OFFICIAL")
29522+
{
29523+
SendMessageToSource(record, record.command_type.command_name + " cannot be performed on official servers.");
29524+
FinalizeRecord(record);
29525+
return;
29526+
}
29527+
29528+
//Parse parameters using max param count
29529+
String[] parameters = Util.ParseParameters(remainingMessage, 2);
29530+
switch (parameters.Length)
29531+
{
29532+
case 0:
29533+
if (record.record_source != ARecord.Sources.InGame)
29534+
{
29535+
SendMessageToSource(record, "You can't use a self-targeted command from outside the game.");
29536+
FinalizeRecord(record);
29537+
return;
29538+
}
29539+
record.record_message = "Issuing command on yourself";
29540+
record.target_name = record.source_name;
29541+
CompleteTargetInformation(record, false, false, false);
29542+
break;
29543+
case 1:
29544+
record.target_name = parameters[0];
29545+
//Handle based on report ID as only option
29546+
if (!HandlePlayerReport(record))
29547+
{
29548+
SendMessageToSource(record, "No reason given, unable to submit.");
29549+
}
29550+
FinalizeRecord(record);
29551+
return;
29552+
case 2:
29553+
record.target_name = parameters[0];
29554+
29555+
//attempt to handle via pre-message ID
29556+
record.record_message = GetPreMessage(parameters[1], _RequirePreMessageUse);
29557+
if (record.record_message == null)
29558+
{
29559+
SendMessageToSource(record, "Invalid PreMessage ID, valid PreMessage IDs are 1-" + _PreMessageList.Count);
29560+
FinalizeRecord(record);
29561+
return;
29562+
}
29563+
29564+
//Handle based on report ID if possible
29565+
if (!HandlePlayerReport(record))
29566+
{
29567+
if (record.record_message.Length >= _RequiredReasonLength)
29568+
{
29569+
CompleteTargetInformation(record, false, false, true);
29570+
}
29571+
else
29572+
{
29573+
SendMessageToSource(record, "Reason too short, unable to submit.");
29574+
FinalizeRecord(record);
29575+
}
29576+
}
29577+
break;
29578+
default:
29579+
SendMessageToSource(record, "Invalid parameters, unable to submit.");
29580+
FinalizeRecord(record);
29581+
return;
29582+
}
29583+
}
29584+
break;
2951429585
default:
2951529586
Log.Error("Unable to complete record for " + record.command_type.command_key + ", handler not found.");
2951629587
FinalizeRecord(record);
@@ -31169,6 +31240,12 @@ private void RunAction(ARecord record)
3116931240
case "self_challenge":
3117031241
SendChallengeInfo(record);
3117131242
break;
31243+
case "player_language_punish":
31244+
LanguagePunishTarget(record);
31245+
break;
31246+
case "player_language_reset":
31247+
LanguageResetTarget(record);
31248+
break;
3117231249
case "player_changename":
3117331250
case "player_changetag":
3117431251
case "player_changeip":
@@ -36000,6 +36077,63 @@ public void ChallengeAutoKillRemoveTarget(ARecord record)
3600036077
Log.Debug(() => "Exiting ChallengeAutoKillRemoveTarget", 6);
3600136078
}
3600236079

36080+
public void LanguagePunishTarget(ARecord record) {
36081+
Log.Debug(() => "Entering LanguagePunishTarget", 6);
36082+
try {
36083+
record.record_action_executed = true;
36084+
//Perform actions
36085+
if (String.IsNullOrEmpty(record.target_player.player_name)) {
36086+
Log.Error("Tried to issue an language punish on a null target.");
36087+
}
36088+
else {
36089+
if (record.record_source != ARecord.Sources.InGame && record.record_source != ARecord.Sources.Automated && record.record_source != ARecord.Sources.ServerCommand) {
36090+
SendMessageToSource(record, "You issued a LANGUAGE PUNISH on " + record.GetTargetNames() + " for " + record.record_message);
36091+
}
36092+
36093+
AdminSayMessage(Log.FBold(Log.CRed(record.GetTargetNames() + " LANGUAGE PUNISHED" + (_ShowAdminNameInAnnouncement ? (" by " + record.GetSourceName()) : ("")) + " for " + record.record_message)));
36094+
ExecuteCommand("procon.protected.plugins.call", "LanguageEnforcer", "RemoteManuallyPunishPlayer", GetType().Name, record.target_player.player_name, record.target_player.player_guid);
36095+
}
36096+
}
36097+
catch (Exception e) {
36098+
record.record_exception = new AException("Error while taking action for language punish record.", e);
36099+
Log.HandleException(record.record_exception);
36100+
FinalizeRecord(record);
36101+
}
36102+
36103+
Log.Debug(() => "Exiting LanguagePunishTarget", 6);
36104+
}
36105+
36106+
public void LanguageResetTarget(ARecord record)
36107+
{
36108+
Log.Debug(() => "Entering LanguageResetTarget", 6);
36109+
try
36110+
{
36111+
record.record_action_executed = true;
36112+
//Perform actions
36113+
if (String.IsNullOrEmpty(record.target_player.player_name))
36114+
{
36115+
Log.Error("Tried to issue an language reset on a null target.");
36116+
}
36117+
else
36118+
{
36119+
if (record.record_source != ARecord.Sources.InGame &&
36120+
record.record_source != ARecord.Sources.Automated &&
36121+
record.record_source != ARecord.Sources.ServerCommand)
36122+
{
36123+
SendMessageToSource(record, "You issued a LANGUAGE RESET on " + record.GetTargetNames() + " for " + record.record_message);
36124+
}
36125+
ExecuteCommand("procon.protected.plugins.call", "LanguageEnforcer", "RemoteManuallyResetPlayer", GetType().Name, record.target_player.player_name, record.target_player.player_guid);
36126+
}
36127+
}
36128+
catch (Exception e)
36129+
{
36130+
record.record_exception = new AException("Error while taking action for language reset record.", e);
36131+
Log.HandleException(record.record_exception);
36132+
FinalizeRecord(record);
36133+
}
36134+
Log.Debug(() => "Exiting LanguageResetTarget", 6);
36135+
}
36136+
3600336137
public void PurgeExtendedRoundStats()
3600436138
{
3600536139
Log.Debug(() => "Entering PurgeExtendedRoundStats", 6);
@@ -47712,6 +47846,16 @@ private void FetchCommands()
4771247846
SendNonQuery("Adding command player_whitelistmoveprotection_remove", "INSERT INTO `adkats_commands` VALUES(155, 'Active', 'player_whitelistmoveprotection_remove', 'Log', 'Remove Move Protection Whitelist', 'unmovewhitelist', TRUE, 'Any')", true);
4771347847
newCommands = true;
4771447848
}
47849+
if (!_CommandIDDictionary.ContainsKey(156))
47850+
{
47851+
SendNonQuery("Adding command player_language_punish", "INSERT INTO `adkats_commands` VALUES(156, 'Active', 'player_language_punish', 'Log', 'Issue Language Punish', 'lpunish', TRUE, 'Any')", true);
47852+
newCommands = true;
47853+
}
47854+
if (!_CommandIDDictionary.ContainsKey(157))
47855+
{
47856+
SendNonQuery("Adding command player_language_reset", "INSERT INTO `adkats_commands` VALUES(157, 'Active', 'player_language_reset', 'Log', 'Issue Language Counter Reset', 'lreset', TRUE, 'Any')", true);
47857+
newCommands = true;
47858+
}
4771547859
if (newCommands)
4771647860
{
4771747861
FetchCommands();
@@ -47886,6 +48030,8 @@ private void FillCommandDescDictionary()
4788648030
_CommandDescriptionDictionary["player_watchlist_remove"] = "Removes the target player from the watchlist.";
4788748031
_CommandDescriptionDictionary["player_whitelistmoveprotection"] = "Adds the target player to the move protection whitelist. Preventing admins from moving them.";
4788848032
_CommandDescriptionDictionary["player_whitelistmoveprotection_remove"] = "Removes the target player from the move protection whitelist.";
48033+
_CommandDescriptionDictionary["player_language_punish"] = "Issue a LanguageEnforcer punishment. Requires LanguageEnforcer to be installed and active.";
48034+
_CommandDescriptionDictionary["player_language_reset"] = "Issue a LanguageEnforcer counter reset. Resetting the punishment counter to 0 on the server.";
4788948035
}
4789048036

4789148037
private void FillReadableMapModeDictionaries()

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,23 @@ Added small improvements to fuzzy player match response text.</li>
16131613
</ul>
16141614
<b>Changes</b><br/>
16151615
<ul>
1616-
<liNone</li>
1616+
<li>None</li>
1617+
</ul>
1618+
<b>Bugs Fixed</b><br/>
1619+
<ul>
1620+
<li>None</li>
1621+
</ul>
1622+
1623+
<h4>8.1.9.0 (18-FEB-2023)</h4>
1624+
<b>Enhancements</b><br/>
1625+
<ul>
1626+
<li>New commands: !lpunish and !lreset</li>
1627+
<li>These commands integrate together with E4GL's LanguageEnforcer fork to allow admins to issue language punishments and resets of the counter over the Language plugin.</li>
1628+
<li>This has been implemented to allow auditing of language punishments.</li>
1629+
</ul>
1630+
<b>Changes</b><br/>
1631+
<ul>
1632+
<li>Report war responses tell people to join the discord now. (Instead of teamspeak).</li>
16171633
</ul>
16181634
<b>Bugs Fixed</b><br/>
16191635
<ul>

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@
549549
Direct temp-ban and ban are of course still available for hacking/glitching situations, but that is the ONLY time
550550
they should be used.
551551
</p>
552+
<h3>LanguageEnforcer Integration</h3>
553+
<p>
554+
This plugin integrates with E4GLs LanguageEnforcer for issuing commands
555+
from AdKats. Admins can use the commands !lpunish and !lreset to manually issue LanguageEnforcer punishments on players.
556+
Furthermore, this custom version of the plugin comes with temp and perma mute support.
557+
</p>
552558
<h3>Player Reputation System</h3>
553559
<p>
554560
Reputation is a numeric for how helpful a player is to the server.
@@ -2746,6 +2752,48 @@ plugin.CallOtherPlugin("AdKats", "IssueCommand", command);
27462752
</td>
27472753
</tr>
27482754
</table>
2755+
<h3>LanguageEnforcer Integration Commands</h3>
2756+
<table>
2757+
<tr>
2758+
<td><b>Command</b></td>
2759+
<td><b>Default Text</b></td>
2760+
<td><b>Params</b></td>
2761+
<td><b>Description</b></td>
2762+
</tr>
2763+
<tr>
2764+
<td><b>Issue Language Punish</b></td>
2765+
<td>lpunish</td>
2766+
<td>
2767+
None<br/>
2768+
OR<br/>
2769+
[player][reason]<br/>
2770+
OR<br/>
2771+
[reportID]<br/>
2772+
OR<br/>
2773+
[reportID][reason]
2774+
</td>
2775+
<td>
2776+
The in-game command for issuing a language punishment over LanguageEnforcer. Requires LanguageEnforcer to be installed and enabled.
2777+
</td>
2778+
</tr>
2779+
<tr>
2780+
<td><b>Issue Language Reset</b></td>
2781+
<td>lreset</td>
2782+
<td>
2783+
None<br/>
2784+
OR<br/>
2785+
[player][reason]<br/>
2786+
OR<br/>
2787+
[reportID]<br/>
2788+
OR<br/>
2789+
[reportID][reason]
2790+
</td>
2791+
<td>
2792+
The in-game command for issuing a counter reset over LanguageEnforcer. Resets all points and sets the the player to a clean state.
2793+
</td>
2794+
</tr>
2795+
</table>
2796+
27492797
<h3>Maintenance Commands</h3>
27502798
<table>
27512799
<tr>

adkats.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ REPLACE INTO `adkats_commands` VALUES(152, 'Active', 'player_watchlist_remove',
327327
REPLACE INTO `adkats_commands` VALUES(153, 'Active', 'player_persistentmute_force', 'Log', 'Persistent Force Mute Player', 'fmute', TRUE, 'AnyHidden');
328328
REPLACE INTO `adkats_commands` VALUES(154, 'Active', 'player_whitelistmoveprotection', 'Log', 'Move Protection Whitelist Player', 'movewhitelist', TRUE, 'Any');
329329
REPLACE INTO `adkats_commands` VALUES(155, 'Active', 'player_whitelistmoveprotection_remove', 'Log', 'Remove Move Protection Whitelist', 'unmovewhitelist', TRUE, 'Any');
330+
REPLACE INTO `adkats_commands` VALUES(156, 'Active', 'player_language_punish', 'Log', 'Issue Language Punish', 'lpunish', TRUE, 'Any');
331+
REPLACE INTO `adkats_commands` VALUES(157, 'Active', 'player_language_reset', 'Log', 'Issue Language Counter Reset', 'lreset', TRUE, 'Any');
330332

331333

332334

0 commit comments

Comments
 (0)