Jump to content

Insane Limits Requests


ImportBot

Recommended Posts

Originally Posted by PapaCharlie9*:

 

upgrade to 0.9.4.0 *DONE*

 

I took your code from here:

www.phogue.net/forumvb/showth...nd-and-reasons* (1st post - R3)

 

and tryed to add the !w (warn) and !p (punish) function from post ...*.

 

 

but it seems that i make a mistake, but cant find it :sad:

Just use post #6 code without changing it. There is no need to combine them.
* Restored post. It could be that the author is no longer active.
Link to comment
  • Replies 3.2k
  • Created
  • Last Reply

Originally Posted by HexaCanon*:

 

Posted Image

 

getting the insane o meter done soon ^_^ , just need to set the headshot/kill average values. and testing (above picture has random values for colors I R NO CHEATZ :biggrin:)

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

Originally Posted by HexaCanon*:

 

i am still getting the punkbuster name issues

 

Code:

PunkBuster Server: 54  55ebe7a14aaf967******47c65e822c {10/30} "LowLifeVendetta" "91.67.*****:****" 3mmar3d 30 minutes ban for using M67(Temporary:30) | BC2!
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

i am still getting the punkbuster name issues

 

Code:

PunkBuster Server: 54  55ebe7a14aaf967******47c65e822c {10/30} "LowLifeVendetta" "91.67.*****:****" 3mmar3d 30 minutes ban for using M67(Temporary:30) | BC2!
Was LowLifeVendtta the correct player name and 3mmar3d the incorrect name? Or the other way around?

 

What's the corresponding console.log and plugin.log info? Need all three pieces of information simultaneously to nail down the source of the problem.

 

Based on the previous info you sent, it is looking like a BF3 game server and/or PunkBuster server issue, since we are doing all the right stuff on our side. There is a slight chance that it is a Procon bug, that even though by console.log we are doing the right command, Procon is transmitting the wrong info to the game server. I think that's less likely than just a PB/DICE bug on the server side though.

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

Originally Posted by HexaCanon*:

 

it was LowLifeVendetta who got the wrong ban, the ban should have been issued to 3mmar3d.

 

from plugin.log

 

Code:

[18:24:28] [Insane Limits] [BAN] Temporary: 3mmar3d (3mmar3d 30 minutes ban for using M67)
from events.log

 

Code:

Playerlist	01/07/2013 18:24:28		PlayerKilled	3mmar3d killed Sterling82 [M67 Grenade]
Plugins	01/07/2013 18:24:28	Insane Limits	PluginAction	Temporary: 3mmar3d (3mmar3d 30 minutes ban for using M67)
again there is a player leave after the ban and that player when he came back it gave him the wrong ban

 

Code:

Playerlist	01/07/2013 18:24:32		PlayerLeave	LowLifeVendetta left the server
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Absolutely must have the console.log line that contains the punkBuster.pb_sv_command pb_sv_kick command to confirm. If that line has LowLifeVendetta as the target, the bug is in Insane Limits or Procon. If it has 3mmar3d as the target, the bug is in the game server/punkbuster server.

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

Originally Posted by HexaCanon*:

 

Code:

[18:24:28] punkBuster.pb_sv_command pb_sv_kick 3mmar3d 30 3mmar3d 30 minutes ban for using M67(Temporary:30) | BC2!
i guess issue is not in procon. i am moving away from my gameserver provider anyway, their service is bad and a lot of players complain about lag.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Code:

[18:24:28] punkBuster.pb_sv_command pb_sv_kick 3mmar3d 30 3mmar3d 30 minutes ban for using M67(Temporary:30) | BC2!
i guess issue is not in procon. i am moving away from my gameserver provider anyway, their service is bad and a lot of players complain about lag.
Yes that confirms that Procon and IL are doing the right thing. Somehow, the name gets changed in the game server or punk buster, or at least, by the time the name is entered into the ban list in PunkBuster, it's the wrong name, as demonstrated by the pb_sv_banlist search with BC2!.

 

Whew, that's a relief! If switching host providers doesn't help, you'll have to change to using EA bans instead of PB bans. I use EA bans and never have this problem.

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

Originally Posted by HexaCanon*:

 

I'm looking for a way to stop player from using vehicles when turning on infantry mode or something......

just a kill is enough as a punishment:smile:

first check expression :

Code:

Regex.Match(kill.Weapon, @"(DEATH)", RegexOptions.IgnoreCase).Success
action : kill.

 

 

i believe DEATH includes EOD bot , mav and such equipment.

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

Originally Posted by PapaCharlie9*:

 

Notice that this will forget all of the remembered message counters when you disable the plugin or restart Procon.

 

Here ya go:

 

Create a new limit to evaluate OnSpawn, call it "Multi-Message Greeter" and set the Action to None

 

Set the first_check to this Expression:

 

Code:

( true )
Set the second_check to this Code:

 

Code:

/* Version: V0.9.4/R1 */
int spawns = 0;
String kSpawns = "MultiGreeter_Spawn_Counter";
if (player.Data.issetInt(kSpawns)) spawns = player.Data.getInt(kSpawns);
spawns = spawns + 1;
player.Data.setInt(kSpawns, spawns);
if (spawns > 1) return false;

List<String> greetings = new List<String>();
greetings.Add("Welcome %p_n%! This server has NO RULES!");
greetings.Add("We are RECRUITING! Join at www.TeaBaggersUnited.com");
greetings.Add("Don't leave! Idle to earn FREE ADMIN!");
// Add additional messages here with greetings.Add("...");

int level = 2;

try {
	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

int next = 0;
String key = "MultiGreeter_" + player.Name;
if (plugin.Data.issetInt(key)) next = plugin.Data.getInt(key);

next = next % greetings.Count; // Ensure rotation of messages

String msg = plugin.R(greetings[next]);

plugin.Data.setInt(key, next + 1);

plugin.SendPlayerMessage(player.Name, msg);
plugin.SendPlayerYell(player.Name, msg, 15);
plugin.PRoConChat("ADMIN to " + player.Name + " > " + msg);
if (level >= 2) plugin.ConsoleWrite("^b[Multi-Message Greeter]^n to " + player.Name + " sent: " + msg);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by droopie*:

 

Notice that this will forget all of the remembered message counters when you disable the plugin or restart Procon.

 

Here ya go:

 

Create a new limit to evaluate OnSpawn, call it "Multi-Message Greeter" and set the Action to None

 

Set the first_check to this Expression:

 

Code:

( true )
Set the second_check to this Code:

 

Code:

/* Version: V0.9.4/R1 */
int spawns = 0;
String kSpawns = "MultiGreeter_Spawn_Counter";
if (player.Data.issetInt(kSpawns)) spawns = player.Data.getInt(kSpawns);
spawns = spawns + 1;
player.Data.setInt(kSpawns, spawns);
if (spawns > 1) return false;

List<String> greetings = new List<String>();
greetings.Add("Welcome %p_n%! This server has NO RULES!");
greetings.Add("We are RECRUITING! Join at www.TeaBaggersUnited.com");
greetings.Add("Don't leave! Idle to earn FREE ADMIN!");
// Add additional messages here with greetings.Add("...");

int level = 2;

try {
	level = Convert.ToInt32(plugin.getPluginVarValue("debug_level"));
} catch (Exception e) {}

int next = 0;
String key = "MultiGreeter_" + player.Name;
if (plugin.Data.issetInt(key)) next = plugin.Data.getInt(key);

next = next % greetings.Count; // Ensure rotation of messages

String msg = plugin.R(greetings[next]);

plugin.Data.setInt(key, next + 1);

plugin.SendPlayerMessage(player.Name, msg);
plugin.SendPlayerYell(player.Name, msg, 15);
plugin.PRoConChat("ADMIN to " + player.Name + " > " + msg);
if (level >= 2) plugin.ConsoleWrite("^b[Multi-Message Greeter]^n to " + player.Name + " sent: " + msg);
return false;
i am getting errors...

[19:44:19 37] [insane Limits] ERROR: 2 errors compiling Expression

[19:44:19 37] [insane Limits] ERROR: (CS0117, line: 69, column: 20): 'PRoConEvents.PluginInterface' does not contain a definition for 'SendPlayerMessage'

[19:44:19 37] [insane Limits] ERROR: (CS0117, line: 70, column: 20): 'PRoConEvents.PluginInterface' does not contain a definition for 'SendPlayerYell'

 

 

also, since i havnt got it to work, does this send 3 greetings to each player that has joined? what i meant in my original request was either a list greetings to send. like each new player gets 1 greeting from a list of greetings. or for it to randomly send a 1 greeting to the player that has just joined the player and spawned.

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

Originally Posted by HexaCanon*:

 

i am getting errors...

[19:44:19 37] [insane Limits] ERROR: 2 errors compiling Expression

[19:44:19 37] [insane Limits] ERROR: (CS0117, line: 69, column: 20): 'PRoConEvents.PluginInterface' does not contain a definition for 'SendPlayerMessage'

[19:44:19 37] [insane Limits] ERROR: (CS0117, line: 70, column: 20): 'PRoConEvents.PluginInterface' does not contain a definition for 'SendPlayerYell'

 

 

also, since i havnt got it to work, does this send 3 greetings to each player that has joined? what i meant in my original request was either a list greetings to send. like each new player gets 1 greeting from a list of greetings. or for it to randomly send a 1 greeting to the player that has just joined the player and spawned.

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

Originally Posted by droopie*:

 

using IL 9.4 ?

i just updated and got this

[10:22:18 47] [insane Limits] Thread(settings): Compiling Limit #24 - Multi-Message Greeter - OnSpawn

[10:22:18 52] [insane Limits] Thread(settings): ERROR: 2 errors compiling Expression

[10:22:18 52] [insane Limits] Thread(settings): ERROR: (CS1502, line: 68, column: 13): The best overloaded method match for 'PRoConEvents.PluginInterface.SendPlayerMessage(st ring, string)' has some invalid arguments

[10:22:18 52] [insane Limits] Thread(settings): ERROR: (CS1503, line: 68, column: 51): Argument '2': cannot convert from 'System.Collections.Generic.List' to 'string'

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

Originally Posted by HexaCanon*:

 

i just updated and got this

[10:22:18 47] [insane Limits] Thread(settings): Compiling Limit #24 - Multi-Message Greeter - OnSpawn

[10:22:18 52] [insane Limits] Thread(settings): ERROR: 2 errors compiling Expression

[10:22:18 52] [insane Limits] Thread(settings): ERROR: (CS1502, line: 68, column: 13): The best overloaded method match for 'PRoConEvents.PluginInterface.SendPlayerMessage(st ring, string)' has some invalid arguments

[10:22:18 52] [insane Limits] Thread(settings): ERROR: (CS1503, line: 68, column: 51): Argument '2': cannot convert from 'System.Collections.Generic.List' to 'string'

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

Originally Posted by PapaCharlie9*:

 

i just updated and got this

[10:22:18 47] [insane Limits] Thread(settings): Compiling Limit #24 - Multi-Message Greeter - OnSpawn

[10:22:18 52] [insane Limits] Thread(settings): ERROR: 2 errors compiling Expression

[10:22:18 52] [insane Limits] Thread(settings): ERROR: (CS1502, line: 68, column: 13): The best overloaded method match for 'PRoConEvents.PluginInterface.SendPlayerMessage(st ring, string)' has some invalid arguments

[10:22:18 52] [insane Limits] Thread(settings): ERROR: (CS1503, line: 68, column: 51): Argument '2': cannot convert from 'System.Collections.Generic.List' to 'string'

Uh, whatever change you made to my code caused this problem. Go back to the original code in post #827. Just paste over whatever you've got now.

 

My original code works the way you specified: you define a list of messages. On the first spawn after a player first connects, they get one message from the list. Then they leave. The next time they join, on their first spawn they get the next message in the list. And so on. When they get all the messages, the list goes back to the first message in the list. It rotates through the messages one at a time, it is not random.

 

Each player has their own message counter. So player A who joined twice will see message #1 and message #2. Player B who only joined once will have seen message #1 only. He will see message #2 on the next join.

 

As I said, the counters are kept in Insane Limits memory, so if the limit is disabled or if Insane LImits is disabled or if the game server connection is disconnected or Procon is restarted, the counters will all reset to message #1.

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

Originally Posted by Hutchew*:

 

Hey guys, help me out with this one please......

 

I want a setup similar to !votekick that will let players get rid of high ping players lagging the game. (!Votekick never seems to work for us, for some reason......not enough participation)

 

Like maybe "!lag " where say 4 of those entered by players would kick a high ping player, but only if the country was not USA, And of course, protect admins/vips from being kicked.

 

 

Easy enough?

 

Thanks a million, guys.

 

Hutchew

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

Originally Posted by droopie*:

 

Uh, whatever change you made to my code caused this problem. Go back to the original code in post #827. Just paste over whatever you've got now.

 

My original code works the way you specified: you define a list of messages. On the first spawn after a player first connects, they get one message from the list. Then they leave. The next time they join, on their first spawn they get the next message in the list. And so on. When they get all the messages, the list goes back to the first message in the list. It rotates through the messages one at a time, it is not random.

 

Each player has their own message counter. So player A who joined twice will see message #1 and message #2. Player B who only joined once will have seen message #1 only. He will see message #2 on the next join.

 

As I said, the counters are kept in Insane Limits memory, so if the limit is disabled or if Insane LImits is disabled or if the game server connection is disconnected or Procon is restarted, the counters will all reset to message #1.

i usually dont change anything from the original code until i see it in action. then, ill add to it. ill delete the whole limit and readd it.

 

edit: maybe this goes in part with what the host said, saying my procon is sluggish and i should reset the whole procon...

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

Originally Posted by HexaCanon*:

 

Hey guys, help me out with this one please......

 

I want a setup similar to !votekick that will let players get rid of high ping players lagging the game. (!Votekick never seems to work for us, for some reason......not enough participation)

 

Like maybe "!lag " where say 4 of those entered by players would kick a high ping player, but only if the country was not USA, And of course, protect admins/vips from being kicked.

 

 

Easy enough?

 

Thanks a million, guys.

 

Hutchew

i have the code i just need to solve 2 issues

 

1- when i divide int 1/x i always get 0 instead of 0.25 for example if x was 4

2- still needs so some work (i have exam on Friday too lazy to figure it out)that only one vote is registered from the same player against the same target.

 

hopefully someone will give me some answers.

 

edit : basically my only issue is with counting the votes. i am trying stuff till it works for me.

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

Originally Posted by HexaCanon*:

 

for the !lag command i used easy way out and used the !votekick counting function, the vote is removed if the player left the server

 

please look at the options

 

Code:

if (player.LastChat.StartsWith("!lag")) {

    // options
    Double needed = 4; // amount of needed lag reports for a player to get kicked, MINIMUM is 4
    String WLName = "Admin_List"; // change to the name of the white list, if you want more than one list report to hexacanon
    String IgnoredCountries = "(US)"; // add more contries in this format "(US|RU|UK)" and so on..
    String KickMSG = " sorry, your ping is over 250 or is unstable."; // there is always player name at the start so this message comes as "playername sorry, your ping ... "
    // end of options
    
    Match Ban = Regex.Match(player.LastChat, @"^\s*!lag\s+([^\s]+)", RegexOptions.IgnoreCase);
    String violater = Ban.Groups[1].Value;
    List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
    all.AddRange(team1.players);
    all.AddRange(team2.players);
    if (team3.players.Count > 0) all.AddRange(team3.players);
    if (team4.players.Count > 0) all.AddRange(team4.players);
    if (needed < 4) needed = 4;
    
    /* This is the re-usable function that takes a substring and matches it against all the player names */

    Converter<String,List<String>> ExactNameMatches = delegate(String sub) {

        List<String> matches = new List<String>();

        if (String.IsNullOrEmpty(sub)) return matches;

        foreach (PlayerInfoInterface p in all) {
            if (Regex.Match(p.Name, sub, RegexOptions.IgnoreCase).Success) {
                matches.Add(p.Name);
            }
        }
        return matches;
    };

    /* end of function */
    
    // Use the function to find all matches
    List<String> violaters = ExactNameMatches(violater);
    String msg = null;

    if (violaters.Count == 0) {
        msg = "No match for: " + violater;
        plugin.ServerCommand("admin.say", msg, "player", player.Name);
        return false;
    }

    if (violaters.Count > 1) {
        msg = @"Try again, '" + violater + @"' matches multiple names: ";
        bool first = true;
        foreach (String b in violaters) {
            if (first) {
                msg = msg + b;
                first = false;
            } else {
                msg = msg + ", " + b;
            }
        }
        plugin.ServerCommand("admin.say", msg, "player", player.Name);
        return false;	
    }

    // Otherwise just one exact match

    /* Extract the player name */
    PlayerInfoInterface target = plugin.GetPlayer(violaters[0], true);

    if (target == null)
        return false;

    if (plugin.isInList(target.Name, WLName) || Regex.Match(target.CountryCode, IgnoredCountries, RegexOptions.IgnoreCase).Success) {
        plugin.SendGlobalMessage (player.Name + " the reported player is protected against lag reports");
        return false;
    }
    if (target.Name.Equals(player.Name)) {
        plugin.SendGlobalMessage (player.Name + " you can not report yourself");
        return false;
    }
    /* Account the vote in the voter's dictionary */
    /* Votes are kept with the voter, not the votee */
    /* If the voter leaves, his votes are not counted */

    if (!player.DataRound.issetObject("Lag"))
        player.DataRound.setObject("Lag", new Dictionary<String, bool>());

    Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("Lag");

    if (!vdict.ContainsKey(target.Name))
        vdict.Add(target.Name, true);


    /* Tally the votes against the target player */
    double votes = 0;

    foreach(PlayerInfoInterface p in all)
        if (p.DataRound.issetObject("Lag"))
        {
        Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("Lag");
        if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
            votes++;
        }

    if (all.Count == 0)
        return false;
    

    int remain = (int) ( needed - votes);

    if (remain > 0)
        plugin.SendGlobalMessage (player.Name + " you have registered your lag report, " + remain + " more votes are required");

    if (votes >= needed)
    {
        plugin.KickPlayerWithMessage (target.Name, target.Name + KickMSG);
    }

    return false;
}
return false;
Edit : fixed ignored country option.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

i usually dont change anything from the original code until i see it in action. then, ill add to it. ill delete the whole limit and readd it.

 

edit: maybe this goes in part with what the host said, saying my procon is sluggish and i should reset the whole procon...

Well, something went wrong with your original paste, because there is no argument in the call to SendPlayerMessage that is a List in my original code. If msg got replaced by greetings by accident, that would explain the compiler error.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by Hutchew*:

 

for the !lag command i used easy way out and used the !votekick counting function, the vote is removed if the player left the server

 

please look at the options

 

Code:

if (player.LastChat.StartsWith("!lag")) {

    // options
    Double needed = 4; // amount of needed lag reports for a player to get kicked, MINIMUM is 4
    String WLName = "Admin_List"; // change to the name of the white list, if you want more than one list report to hexacanon
    String IgnoredCountries = "(US)"; // add more contries in this format "(US|RU|UK)" and so on..
    String KickMSG = " sorry, your ping is over 250 or is unstable."; // there is always player name at the start so this message comes as "playername sorry, your ping ... "
    // end of options
    
    Match Ban = Regex.Match(player.LastChat, @"^\s*!lag\s+([^\s]+)", RegexOptions.IgnoreCase);
    String violater = Ban.Groups[1].Value;
    List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
    all.AddRange(team1.players);
    all.AddRange(team2.players);
    if (team3.players.Count > 0) all.AddRange(team3.players);
    if (team4.players.Count > 0) all.AddRange(team4.players);
    if (needed < 4) needed = 4;
    
    /* This is the re-usable function that takes a substring and matches it against all the player names */

    Converter<String,List<String>> ExactNameMatches = delegate(String sub) {

        List<String> matches = new List<String>();

        if (String.IsNullOrEmpty(sub)) return matches;

        foreach (PlayerInfoInterface p in all) {
            if (Regex.Match(p.Name, sub, RegexOptions.IgnoreCase).Success) {
                matches.Add(p.Name);
            }
        }
        return matches;
    };

    /* end of function */
    
    // Use the function to find all matches
    List<String> violaters = ExactNameMatches(violater);
    String msg = null;

    if (violaters.Count == 0) {
        msg = "No match for: " + violater;
        plugin.ServerCommand("admin.say", msg, "player", player.Name);
        return false;
    }

    if (violaters.Count > 1) {
        msg = @"Try again, '" + violater + @"' matches multiple names: ";
        bool first = true;
        foreach (String b in violaters) {
            if (first) {
                msg = msg + b;
                first = false;
            } else {
                msg = msg + ", " + b;
            }
        }
        plugin.ServerCommand("admin.say", msg, "player", player.Name);
        return false;	
    }

    // Otherwise just one exact match

    /* Extract the player name */
    PlayerInfoInterface target = plugin.GetPlayer(violaters[0], true);

    if (target == null)
        return false;

    if (plugin.isInList(target.Name, WLName) || Regex.Match(player.CountryCode, IgnoredCountries, RegexOptions.IgnoreCase).Success) {
        plugin.SendGlobalMessage (player.Name + " the reported player is protected against lag reports");
        return false;
    }
    if (target.Name.Equals(player.Name)) {
        plugin.SendGlobalMessage (player.Name + " you can not report yourself");
        return false;
    }
    /* Account the vote in the voter's dictionary */
    /* Votes are kept with the voter, not the votee */
    /* If the voter leaves, his votes are not counted */

    if (!player.DataRound.issetObject("Lag"))
        player.DataRound.setObject("Lag", new Dictionary<String, bool>());

    Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("Lag");

    if (!vdict.ContainsKey(target.Name))
        vdict.Add(target.Name, true);


    /* Tally the votes against the target player */
    double votes = 0;

    foreach(PlayerInfoInterface p in all)
        if (p.DataRound.issetObject("Lag"))
        {
        Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("Lag");
        if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
            votes++;
        }

    if (all.Count == 0)
        return false;
    

    int remain = (int) ( needed - votes);

    if (remain > 0)
        plugin.SendGlobalMessage (player.Name + " you have registered your lag report, " + remain + " more votes are required");

    if (votes >= needed)
    {
        plugin.KickPlayerWithMessage (target.Name, target.Name + KickMSG);
    }

    return false;
}
return false;
Thanks, Hexa..........

 

Country selector doesn't seem to work............will protect all players as being from US, regardless of the country they are from.......

 

Take that part out and it works perfectly, though.:cool:

 

Hutchew

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

Originally Posted by HexaCanon*:

 

Thanks, Hexa..........

 

Country selector doesn't seem to work............will protect all players as being from US, regardless of the country they are from.......

 

Take that part out and it works perfectly, though.:cool:

 

Hutchew

i fixed the country selector, i should have set it as target country instead of the player who issued the command country

 

Code:

if (player.LastChat.StartsWith("!lag")) {

    // options
    Double needed = 4; // amount of needed lag reports for a player to get kicked, MINIMUM is 4
    String WLName = "Admin_List"; // change to the name of the white list, if you want more than one list report to hexacanon
    String IgnoredCountries = "(US)"; // add more contries in this format "(US|RU|UK)" and so on..
    String KickMSG = " sorry, your ping is over 250 or is unstable."; // there is always player name at the start so this message comes as "playername sorry, your ping ... "
    // end of options
    
    Match Ban = Regex.Match(player.LastChat, @"^\s*!lag\s+([^\s]+)", RegexOptions.IgnoreCase);
    String violater = Ban.Groups[1].Value;
    List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
    all.AddRange(team1.players);
    all.AddRange(team2.players);
    if (team3.players.Count > 0) all.AddRange(team3.players);
    if (team4.players.Count > 0) all.AddRange(team4.players);
    if (needed < 4) needed = 4;
    
    /* This is the re-usable function that takes a substring and matches it against all the player names */

    Converter<String,List<String>> ExactNameMatches = delegate(String sub) {

        List<String> matches = new List<String>();

        if (String.IsNullOrEmpty(sub)) return matches;

        foreach (PlayerInfoInterface p in all) {
            if (Regex.Match(p.Name, sub, RegexOptions.IgnoreCase).Success) {
                matches.Add(p.Name);
            }
        }
        return matches;
    };

    /* end of function */
    
    // Use the function to find all matches
    List<String> violaters = ExactNameMatches(violater);
    String msg = null;

    if (violaters.Count == 0) {
        msg = "No match for: " + violater;
        plugin.ServerCommand("admin.say", msg, "player", player.Name);
        return false;
    }

    if (violaters.Count > 1) {
        msg = @"Try again, '" + violater + @"' matches multiple names: ";
        bool first = true;
        foreach (String b in violaters) {
            if (first) {
                msg = msg + b;
                first = false;
            } else {
                msg = msg + ", " + b;
            }
        }
        plugin.ServerCommand("admin.say", msg, "player", player.Name);
        return false;	
    }

    // Otherwise just one exact match

    /* Extract the player name */
    PlayerInfoInterface target = plugin.GetPlayer(violaters[0], true);

    if (target == null)
        return false;

    if (plugin.isInList(target.Name, WLName) || Regex.Match(target.CountryCode, IgnoredCountries, RegexOptions.IgnoreCase).Success) {
        plugin.SendGlobalMessage (player.Name + " the reported player is protected against lag reports");
        return false;
    }
    if (target.Name.Equals(player.Name)) {
        plugin.SendGlobalMessage (player.Name + " you can not report yourself");
        return false;
    }
    /* Account the vote in the voter's dictionary */
    /* Votes are kept with the voter, not the votee */
    /* If the voter leaves, his votes are not counted */

    if (!player.DataRound.issetObject("Lag"))
        player.DataRound.setObject("Lag", new Dictionary<String, bool>());

    Dictionary<String, bool> vdict =  (Dictionary<String, bool>) player.DataRound.getObject("Lag");

    if (!vdict.ContainsKey(target.Name))
        vdict.Add(target.Name, true);


    /* Tally the votes against the target player */
    double votes = 0;

    foreach(PlayerInfoInterface p in all)
        if (p.DataRound.issetObject("Lag"))
        {
        Dictionary<String, bool> pvotes = (Dictionary<String, bool>) p.DataRound.getObject("Lag");
        if (pvotes.ContainsKey(target.Name) && pvotes[target.Name])
            votes++;
        }

    if (all.Count == 0)
        return false;
    

    int remain = (int) ( needed - votes);

    if (remain > 0)
        plugin.SendGlobalMessage (player.Name + " you have registered your lag report, " + remain + " more votes are required");

    if (votes >= needed)
    {
        plugin.KickPlayerWithMessage (target.Name, target.Name + KickMSG);
    }

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

Archived

This topic is now archived and is closed to further replies.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • 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.