Jump to content

Advanced In-Game Admin and Ban Enforcer - AdKats


Message added by Prophet731,

If you've been banned from a server then you will need to appeal the ban with the owners/community of that server. We do not control any bans done on servers that utilize AdKats as all bans are local to that server.

Recommended Posts

Originally Posted by XaosBr*:

 

XaosBr,

 

This is a small little script that you can add to your ProconRulz that might help with what you're looking for. It doesn't display what you need for each individual player, but it will show them what the current stats are on the server when someone types - !desfig, !knife or !kills - You can change that to what you need under the "On Say" at the bottom.

 

 

 

Hope this helps~!

Thanks, I'll add this after post the result, just to give your time I send the code already helped bastate
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XaosBr*:

 

I have a problem related to DPS, a player asked to unblock, He has this statistic [4-L85A2-68-95-14-138]. I do not know how to explain this so that he understands, and I do not know whether this is correct, Can someone audition with this?

 

Battlelog: http://battlelog.battlefield.com/bf4...1839722074/pc/

* Restored post. It could be that the author is no longer active.
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

I have a problem related to DPS, a player asked to unblock, He has this statistic [4-L85A2-68-95-14-138]. I do not know how to explain this so that he understands, and I do not know whether this is correct, Can someone audition with this?

 

Battlelog: http://battlelog.battlefield.com/bf4...1839722074/pc/

According to battlelog data he killed 95 people using the L85A2 with only 138 bullet hits and only 15 headshots, meaning he averaged 68 damage per shot with a 24 damage gun. That is why the script banned him.
Link to comment

Originally Posted by XaosBr*:

 

According to battlelog data he killed 95 people using the L85A2 with only 138 bullet hits and only 15 headshots, meaning he averaged 68 damage per shot with a 24 damage gun. That is why the script banned him.

Thank you for clarifying for me.

Just one more question:

This information is taken from a battle report?

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XaosBr*:

 

This is taken from their overall battlelog data. AdKats does not fetch specific round reports.

Wow, it looks like it's correct for this plugin, I checked your ip and the player has an account linked with ban punkbuster, Congratulations on the great work in bringing this tool to us.
* Restored post. It could be that the author is no longer active.
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Wow, it looks like it's correct for this plugin, I checked your ip and the player has an account linked with ban punkbuster, Congratulations on the great work in bringing this tool to us.

There is a reason I made that section of the anti-cheat script automatically enabled in AdKats without a way to turn it off or modify the settings. It's been tested for 3 years now without any false positives caused by the plugin. Very rarely there is an issue with battlelog data where kills post to battlelog without accompanying hit counts, and that can skew the calculations. But that is the only case I've seen where this script has issued a false Code 4 (damage modifier) ban.
Link to comment

Originally Posted by Checka_Wiemi*:

 

Everyone running AdKats should run this on their database.

 

It's an update to the blank data fix for stat logger, and stops player's clan tags from being deleted by stat logger. You should also update to the latest test version of AdKats after running this query.

 

Code:

DELIMITER $$
DROP TRIGGER IF EXISTS `Player_Update_BlankDataFix`$$
DROP TRIGGER IF EXISTS `Player_Update_BlankDataFix2`$$
CREATE TRIGGER `Player_Update_BlankDataFix2` BEFORE UPDATE ON `tbl_playerdata`
 FOR EACH ROW BEGIN
    IF (NEW.SoldierName IS NULL OR CHAR_LENGTH(NEW.SoldierName) = 0) 
       AND OLD.SoldierName IS NOT NULL
       AND CHAR_LENGTH(OLD.SoldierName) > 0
        THEN SET NEW.SoldierName = OLD.SoldierName;
    END IF;
    IF (NEW.EAGUID IS NULL OR CHAR_LENGTH(NEW.EAGUID) = 0)
        AND OLD.EAGUID IS NOT NULL 
        AND CHAR_LENGTH(OLD.EAGUID) > 0
        THEN SET NEW.EAGUID = OLD.EAGUID;
    END IF;
    IF (NEW.PBGUID IS NULL OR CHAR_LENGTH(NEW.PBGUID) = 0)
        AND OLD.PBGUID IS NOT NULL 
        AND CHAR_LENGTH(OLD.PBGUID) > 0
        THEN SET NEW.PBGUID = OLD.PBGUID;
    END IF;
    IF (NEW.IP_Address IS NULL OR CHAR_LENGTH(NEW.IP_Address) = 0)
        AND OLD.IP_Address IS NOT NULL 
        AND CHAR_LENGTH(OLD.IP_Address) > 0
        AND OLD.IP_Address <> '127.0.0.1'
        THEN SET NEW.IP_Address = OLD.IP_Address;
    END IF;
    IF NEW.ClanTag IS NULL
        THEN SET NEW.ClanTag = OLD.ClanTag;
    END IF;
END$$
DELIMITER ;
Got an error while running your code in my mySQL database:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 27

 

line 27 is

 

IF NEW.ClanTag IS NULL

 

 

Can't find the problem in it :-/

 

 

UPDATE #1:

 

It seems as it isn't working in phpmyadmin itself. I used an external program and it seems as it was working now.

 

UPDATE #2:

 

After checking pluginconsole it seems as if it wasn't working.

So the problem still exists :-/

* Restored post. It could be that the author is no longer active.
Link to comment
  • Administrators

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Got an error while running your code in my mySQL database:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 27

 

line 27 is

 

IF NEW.ClanTag IS NULL

 

 

Can't find the problem in it :-/

 

 

UPDATE #1:

 

It seems as it isn't working in phpmyadmin itself. I used an external program and it seems as it was working now.

 

UPDATE #2:

 

After checking pluginconsole it seems as if it wasn't working.

So the problem still exists :-/

What do you mean after checking the plugin console?
Link to comment
  • Plugin Developer
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

The query doesn't seem to want to run on my database. sorry if I'm being an idiot.

Code:

SQL query:

DELIMITER ;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1
Ah, i don't use PHPMyAdmin so i didn't remember this. You need to change the default delimiter underneath the query you paste in.

 

http://4.bp.blogspot.com/-u8TUx_srGr...ITER+MYSQL.jpg

 

Change it to $$

 

Then remove the DELIMITER statements from the query.

Link to comment
  • Administrators

Originally Posted by Prophet731*:

 

Sounds good, i'll have the plugin updated soon.

The old links will die in about 2 weeks or less. Once I take that server offline. If you still want the usage stats let me know and I'll add the code again.

 

Sent from my ONEPLUS A3000 using Tapatalk

The developer of the Battlefield Admin Control Panel (BFACP)

For BFACP support please post in the BFACP topic linked above.

Do not contact me via PM on the forums for help with procon. Please make a topic for it. Only PM's I will accept will revolve around any website issues.

spacer.png

Link to comment

Originally Posted by Sp0rAdiC*:

 

Ah, i don't use PHPMyAdmin so i didn't remember this. You need to change the default delimiter underneath the query you paste in.

 

http://4.bp.blogspot.com/-u8TUx_srGr...ITER+MYSQL.jpg

 

Change it to $$

 

Then remove the DELIMITER statements from the query.

Thank you. that was my problem as well. Didn't know PHPMyAdmin was different. :woot:
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Chilace*:

 

If it's the same as using pushbullet that's nice since I already communicate with pushbullet for reports in AdKats. Please send me that limit code.

Redesigned limit myrcon.net/.../insane-limits-report-script-via-pushbullet

(Not tested because I do not have a server):

 

First create a webhook endpoint in your Discord server (you need "Manage Webhooks" permission):

2017-05-18 05-56-35 #playground - Discord.png

 

Then insert webhook url in this code

 

CODE#2:

Code:

// Insane Limits - Discord Report Script v1.0
// Command: !report <part of playername> <reason>

// First create a webhook endpoint in your Discord server
// https://support.discordapp.com/hc/en-us/articles/228383668
// then set webhook url here
String webhookUrl = "https://discordapp.com/api/webhooks/webhookId/webhookToken";

// Set Servername (server identification)
// You need to escape special characters: "*", "_", "~" and "`"
String serverName = "Locker only! :: \*High Tickets\*";

// Automatic PBScreenshot from reportet player
// 1 = activated
// 0 = deactivated
int pbScreen = 1;


// Don't edit
String playerName = null;
String playerMessage = null;
String reportName = null;
String reportReason = null;
String webhookString = null;
int foundPlayer = 0;
Match regexResult = null;

Match regexMatch = Regex.Match(player.LastChat, @"!report\s+([^\s]+)\s+([^.*]+)", RegexOptions.IgnoreCase);

if (regexMatch.Success) {
  regexResult = regexMatch;
} else {
  playerMessage = "Error! Correct command: !report <part of playername> <reason>";
  plugin.SendPlayerMessage(player.Name, playerMessage);
  plugin.SendPlayerYell(player.Name, playerMessage, 10);
  return false;
}

List<PlayerInfoInterface> allPlayer = new List<PlayerInfoInterface>();
allPlayer.AddRange(team1.players);
allPlayer.AddRange(team2.players);
if (team3.players.Count > 0) allPlayer.AddRange(team3.players);
if (team4.players.Count > 0) allPlayer.AddRange(team4.players);

reportName = regexResult.Groups[1].Value;
foreach (PlayerInfoInterface p in allPlayer) {
  if (Regex.Match(p.Name, reportName, RegexOptions.IgnoreCase).Success) {
    ++foundPlayer;
    playerName = p.Name;
  }
}
if (foundPlayer == 0) {
  playerMessage = "No such player name matches (" + reportName + ")";
  plugin.SendPlayerMessage(player.Name, playerMessage);
  plugin.SendPlayerYell(player.Name, playerMessage, 10);
  return false;
} else if (foundPlayer > 1) {
  playerMessage = "Multiple players match the target name (" + reportName +"), try again!";
  plugin.SendPlayerMessage(player.Name, playerMessage);
  plugin.SendPlayerYell(player.Name, playerMessage, 10);
  return false;
} else if (foundPlayer == 1) {
  if (pbScreen == 1) plugin.ServerCommand("punkBuster.pb_sv_command", "PB_SV_GetSs \"" + reportName + "\"");
  reportReason = regexResult.Groups[2].Value;
  try {
    WebRequest request = WebRequest.Create(webhookUrl);
    request.Method = "POST";
    request.ContentType = "application/json";
    webhookString = "{\"username\": \"PRoCon\", \"avatar_url\": \"https:\\/\\/avatars1.githubusercontent.com\\/u\\/1633311\", \"content\": \"**```diff\\n- New report -```**\\n**Report for server:** " + serverName + "\\n**Reported from:** " + player.Name + "\\n**Reported player:** " + playerName + "\\n**Reason:** " + reportReason + "\"}";
    byte[] byteArray = Encoding.UTF8.GetBytes(webhookString);
    request.ContentLength = byteArray.Length;
    Stream dataStream = request.GetRequestStream();
    dataStream.Write(byteArray, 0, byteArray.Length);
    dataStream.Close();
    plugin.ConsoleWrite("Received a report from " + player.Name);
    playerMessage = "Thanks, we have received your report!";
    plugin.SendPlayerMessage(player.Name, playerMessage);
    plugin.SendPlayerYell(player.Name, playerMessage, 10);
  } catch (Exception e) {
    plugin.ConsoleWrite("Error: " + e);
    playerMessage = "Plugin error! Please try again later.";
    plugin.SendPlayerMessage(player.Name, playerMessage);
    plugin.SendPlayerYell(player.Name, playerMessage, 10);
  }
}

return false;
Since I don't know C#, it would probably be better:

Code:

[b]using[/b] (Stream dataStream = request.GetRequestStream()) {
  dataStream.Write(byteArray, 0, byteArray.Length);
  dataStream.Close();
}
Or use the webclient - something like:

Code:

var webhookUrl = "https://discordapp.com/api/webhooks/webhookId/webhookToken";
var webhookObj = new { username = "PRoCon", avatar_url = "https://avatars1.githubusercontent.com/u/1633311", content = "**```diff\n- New report -```**" };
using (var client = new WebClient()) {
  var jsonString = JSON.JsonEncode(webhookObj);
  client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
  client.UploadString(webhookUrl, jsonString);
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Checka_Wiemi*:

 

What do you mean after checking the plugin console?

Sorry, that was maybe a bit missunderstanding.

With plugin console I ment the plugin console in procon that shows the plugin statements e.g. "[AdKats] User List Fetched from Database. [64 users, 0 Special Players, 51 Fetched Players]" and so on.

After running your query it was showing again messages like: "playerxy changed his clantag from NOTHING to XYZ".

 

But after reading your post above I've changed the delimiter in phpmyadmin and now it is working running your query:

adkats_db-querykhs8j.jpg

* Restored post. It could be that the author is no longer active.
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Sorry, that was maybe a bit missunderstanding.

With plugin console I ment the plugin console in procon that shows the plugin statements e.g. "[AdKats] User List Fetched from Database. [64 users, 0 Special Players, 51 Fetched Players]" and so on.

After running your query it was showing again messages like: "playerxy changed his clantag from NOTHING to XYZ".

 

But after reading your post above I've changed the delimiter in phpmyadmin and now it is working running your query:

adkats_db-querykhs8j.jpg

Those messages just note in the logs when the plugin sees a clan tag change. Those are debug level 2 logs. The problem is stat logger would delete the tags out of the database after they were already set by AdKats so people's tags would never be saved when they first joined the server.
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Redesigned limit myrcon.net/.../insane-limits-report-script-via-pushbullet

(Not tested because I do not have a server):

 

First create a webhook endpoint in your Discord server (you need "Manage Webhooks" permission):

2017-05-18 05-56-35 #playground - Discord.png

 

Then insert webhook url in this code

 

CODE#2:

Code:

// Insane Limits - Discord Report Script v1.0
// Command: !report <part of playername> <reason>

// First create a webhook endpoint in your Discord server
// https://support.discordapp.com/hc/en-us/articles/228383668
// then set webhook url here
String webhookUrl = "https://discordapp.com/api/webhooks/webhookId/webhookToken";

// Set Servername (server identification)
// You need to escape special characters: "*", "_", "~" and "`"
String serverName = "Locker only! :: \*High Tickets\*";

// Automatic PBScreenshot from reportet player
// 1 = activated
// 0 = deactivated
int pbScreen = 1;


// Don't edit
String playerName = null;
String playerMessage = null;
String reportName = null;
String reportReason = null;
String webhookString = null;
int foundPlayer = 0;
Match regexResult = null;

Match regexMatch = Regex.Match(player.LastChat, @"!report\s+([^\s]+)\s+([^.*]+)", RegexOptions.IgnoreCase);

if (regexMatch.Success) {
  regexResult = regexMatch;
} else {
  playerMessage = "Error! Correct command: !report <part of playername> <reason>";
  plugin.SendPlayerMessage(player.Name, playerMessage);
  plugin.SendPlayerYell(player.Name, playerMessage, 10);
  return false;
}

List<PlayerInfoInterface> allPlayer = new List<PlayerInfoInterface>();
allPlayer.AddRange(team1.players);
allPlayer.AddRange(team2.players);
if (team3.players.Count > 0) allPlayer.AddRange(team3.players);
if (team4.players.Count > 0) allPlayer.AddRange(team4.players);

reportName = regexResult.Groups[1].Value;
foreach (PlayerInfoInterface p in allPlayer) {
  if (Regex.Match(p.Name, reportName, RegexOptions.IgnoreCase).Success) {
    ++foundPlayer;
    playerName = p.Name;
  }
}
if (foundPlayer == 0) {
  playerMessage = "No such player name matches (" + reportName + ")";
  plugin.SendPlayerMessage(player.Name, playerMessage);
  plugin.SendPlayerYell(player.Name, playerMessage, 10);
  return false;
} else if (foundPlayer > 1) {
  playerMessage = "Multiple players match the target name (" + reportName +"), try again!";
  plugin.SendPlayerMessage(player.Name, playerMessage);
  plugin.SendPlayerYell(player.Name, playerMessage, 10);
  return false;
} else if (foundPlayer == 1) {
  if (pbScreen == 1) plugin.ServerCommand("punkBuster.pb_sv_command", "PB_SV_GetSs \"" + reportName + "\"");
  reportReason = regexResult.Groups[2].Value;
  try {
    WebRequest request = WebRequest.Create(webhookUrl);
    request.Method = "POST";
    request.ContentType = "application/json";
    webhookString = "{\"username\": \"PRoCon\", \"avatar_url\": \"https:\\/\\/avatars1.githubusercontent.com\\/u\\/1633311\", \"content\": \"**```diff\\n- New report -```**\\n**Report for server:** " + serverName + "\\n**Reported from:** " + player.Name + "\\n**Reported player:** " + playerName + "\\n**Reason:** " + reportReason + "\"}";
    byte[] byteArray = Encoding.UTF8.GetBytes(webhookString);
    request.ContentLength = byteArray.Length;
    Stream dataStream = request.GetRequestStream();
    dataStream.Write(byteArray, 0, byteArray.Length);
    dataStream.Close();
    plugin.ConsoleWrite("Received a report from " + player.Name);
    playerMessage = "Thanks, we have received your report!";
    plugin.SendPlayerMessage(player.Name, playerMessage);
    plugin.SendPlayerYell(player.Name, playerMessage, 10);
  } catch (Exception e) {
    plugin.ConsoleWrite("Error: " + e);
    playerMessage = "Plugin error! Please try again later.";
    plugin.SendPlayerMessage(player.Name, playerMessage);
    plugin.SendPlayerYell(player.Name, playerMessage, 10);
  }
}

return false;
Since I don't know C#, it would probably be better:

Code:

[b]using[/b] (Stream dataStream = request.GetRequestStream()) {
  dataStream.Write(byteArray, 0, byteArray.Length);
  dataStream.Close();
}
Or use the webclient - something like:

Code:

var webhookUrl = "https://discordapp.com/api/webhooks/webhookId/webhookToken";
var webhookObj = new { username = "PRoCon", avatar_url = "https://avatars1.githubusercontent.com/u/1633311", content = "**```diff\n- New report -```**" };
using (var client = new WebClient()) {
  var jsonString = JSON.JsonEncode(webhookObj);
  client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
  client.UploadString(webhookUrl, jsonString);
}
I'll take a look at this soon and see if I can work it into the plugin.
Link to comment

Originally Posted by Checka_Wiemi*:

 

Those messages just note in the logs when the plugin sees a clan tag change. Those are debug level 2 logs. The problem is stat logger would delete the tags out of the database after they were already set by AdKats so people's tags would never be saved when they first joined the server.

Ah okay. Thanks a lot :-)

 

But another short question: is there a short explanation about the section "B30. Team Power Monitor" in AdKats how it works or how you have to set it up?

* Restored post. It could be that the author is no longer active.
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Ah okay. Thanks a lot :-)

 

But another short question: is there a short explanation about the section "B30. Team Power Monitor" in AdKats how it works or how you have to set it up?

My endeavor to update all of the plugin documentation is being hampered by needing to also update some of the codebase.

 

Some of the setting sections have been moved around and some have been deleted. The baserape monitor and the top player monitor have been stripped from the plugin as they were left in a bad state when I stopped working on a plugin a while back. The team power monitor is working off of player performance data from your server. It's used to calculate the power level of a team into a number that can eventually be used for auto-balance.

 

Each players performance in the server is logged and those metrics are displayed in the team power section for each player. There is no balance currently being done with this section, but that is planned to be done in the future.

 

Even if you have this setting section turned off AdKats is still logging the data it would need if you enabled it. Simply turn it on and you'll be able to see what it believes to be the power of each team in that section.

 

Some of the numbers, especially the displays with multiple numbers next to each other may not make much sense at this time but I would rather keep it that way as this section is still being developed. The most important thing at this time is knowing whether the power number for each team consistently reflects what's actually happening in the server.

 

Remember, you are on a test version of AdKats. Everything is not ready for full publishing yet.

Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Wow.. who knew... well apparently not me so.. hehe thx

Almost all commands are shown in the plugin documentation. Some new ones aren't there yet so please reference the command list and the !help command in game. Issuing the help command with another command name will give a brief description of what that command does.
Link to comment

Originally Posted by WolfBlade*:

 

Good information to have. I updated and everything that was in place, is still in place and I haven't touched any of the new additions since, like you said, are still being worked on, but I do like the new features. If there's anything I can do to help, don't hesitate to ask.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XaosBr*:

 

EXCEPTION-6900-FetchPlayerBattlelogInformation-BattlelogComm34

 

I was having this error, maybe this can help with other users that comes to have it in the future:

 

Correction:

1) Disable adkats plugin

2) Restart procon layer

3) Expect procon layer to get online and activate plagin adkats again

 

Maybe it works for similar errors too, for me it worked.

* Restored post. It could be that the author is no longer active.
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

EXCEPTION-6900-FetchPlayerBattlelogInformation-BattlelogComm34

 

I was having this error, maybe this can help with other users that comes to have it in the future:

 

Correction:

1) Disable adkats plugin

2) Restart procon layer

3) Expect procon layer to get online and activate plagin adkats again

 

Maybe it works for similar errors too, for me it worked.

Please post the error message that comes after that header. All that header shows is what version you're on and what function failed, but not why it failed. Thank you.

 

EDIT: Also please /pupdate to the latest version and let me know if the error still exists.

Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

wow, i didnt know adkatz was able to import remote bans from rconnet, it only misses the name, but it works.

Strange, i didn't know it was able to do that either, and i built the plugin. How are you doing this? Do you have a script that imports them to the database?
Link to comment
  • Plugin Developer

Originally Posted by ColColonCleaner*:

 

Has anyone on the test versions noticed the procon process hanging or freezing? Trying to isolate a current issue and see if it's being caused by AdKats. It appears to have started after adding the discord integration, but i'm not sure if that's really the cause.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.