Auto Rank Kicker & Auto Score Kicker Plugins

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Auto Rank Kicker & Auto Score Kicker Plugins

Post by Ant » 24 Sep 2010 23:16

Edit: Auto Rank Kicker plugin is halfway down my 2nd post, Auto Score Kicker plugin is in my 4th post
Or download Auto Rank Kicker Auto Score Kicker (Only allowed on 0-50k servers !)


Hi all, I use the biggeordie chatbot plugin and it has a rank kick function built into it that kicks players that are higher than a certain rank. The thing is, it was designed for the old tmn and I'm having trouble making it compatible for tmf (using XAseco v1.11) here's the code for that function :

Code: Select all

// Check player rank and kick too high
Aseco::registerEvent("onPlayerConnect", "check_rank");

function check_rank ($aseco, $command) {

    // Enable/Disable rank kicker
    $rankkick = true;

    if ( $rankkick ) {

        // Set rank limit
        $ranklimit = 75000;
        $playerlogin = $command->login;
        $playernick = $command->nickname;
        $playerrank = $command->ladderrank;

        if ( $playerrank > $ranklimit ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your rank number is higher than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}
If anyone can help me get this function compatible I'd be very grateful :1

With the code like this, I can enter my server (my world rank is 260744 at time of writing) but then still be kicked - even though its set at 75000 - which should only kick people of rank 75000 and better.

Edit: Its ok I fixed it now, it was my mistake (and a stupid mistake at that) I just needed to change the > to a <

The new code is now

Code: Select all

// Check player rank and kick too high
Aseco::registerEvent("onPlayerConnect", "check_rank");

function check_rank ($aseco, $command) {

    // Enable/Disable rank kicker
    $rankkick = true;

    if ( $rankkick ) {

        // Set rank limit
        $ranklimit = 5000;
        $playerlogin = $command->login;
        $playernick = $command->nickname;
        $playerrank = $command->ladderrank;

        if ( $playerrank < $ranklimit ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your rank number is higher than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}
I don't even use this feature in the plugin though, I just needed to make sure it works properly !

Edit2: I can also see that it was meant to kick the worst players and not the best players, so as it is now (with the second code post) It will kick all players that have a world ladder rank better than 5000. (e.g 4999 or even 3000 etc)

Edit3: Actually though, does anyone have any ideas on building something similar to this but to kick on ladder points instead of ladder rank ? As I run a 0-60k ladder server, that would be a better way of doing it I reckon.
Last edited by Ant on 27 Sep 2010 19:11, edited 4 times in total.

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland
Contact:

Re: Auto Rank Kicker

Post by jouko100 » 25 Sep 2010 02:24

I think s ladder server 0-60k must be free for all.Read nadeos instructions.Not sure

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Auto Rank Kicker

Post by Ant » 25 Sep 2010 04:20

Well thats fair enough and I'm not using this function anyway, but I think doing it by points is a better way of doing it thats all. It'd also be better for that plugin instead of the way I have changed it, using the function twice like this.

Code: Select all

// Check player rank and kick great players
Aseco::registerEvent("onPlayerConnect", "check_rank");

function check_rank ($aseco, $command) {

    // Enable/Disable rank kicker
    $rankkick = false;

    if ( $rankkick ) {

        // Set rank limit
        $ranklimit = 5000;
        $playerlogin = $command-> login;
        $playernick = $command-> nickname;
        $playerrank = $command-> ladderrank;

        if ( $playerrank < $ranklimit ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your rank number is higher than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}

// Check player rank and kick rubbish players
Aseco::registerEvent("onPlayerConnect", "check_rank1");

function check_rank1 ($aseco, $command) {

    // Enable/Disable rank kicker
    $rankkick1 = false;

    if ( $rankkick1 ) {

        // Set rank limit
        $ranklimit1 = 75000;
        $playerlogin = $command-> login;
        $playernick = $command-> nickname;
        $playerrank = $command-> ladderrank;

        if ( $playerrank > $ranklimit1 ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your rank number is higher than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}
I used original code from El Fuegos biggeordie.php and changed it a little for the second function.

Anyway, for anyone who wants it, I've put this together into a plugin - probably should really only be used on non ladder servers though because of what jouko said, but here it is anyway.

plugin.auto_rank_kicker.php

Code: Select all

<?php
//Auto rank kicker plugin for XAseco by Ant (25th September 2010)
//All code snipped from El Fuegos Biggeordie.php chatbot
//Find it at http://www.tm-forum.com/viewtopic.php?f=28&t=5197
//Default plugin state only allows players with a world ladder rank of 5000 - 75000
//Enable/Disable the functions and change the ranklimits below to your preference
//Support: http://www.tm-forum.com/viewtopic.php?f=127&t=26635


// Check player rank and kick great players
Aseco::registerEvent("onPlayerConnect", "check_rank");

function check_rank ($aseco, $command) {

    // Enable/Disable rank kicker
    $rankkick = true;

    if ( $rankkick ) {

        // Set rank limit
        $ranklimit = 5000;
        $playerlogin = $command-> login;
        $playernick = $command-> nickname;
        $playerrank = $command-> ladderrank;

        if ( $playerrank < $ranklimit ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your rank number is higher than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}

// Check player rank and kick rubbish players
Aseco::registerEvent("onPlayerConnect", "check_rank1");

function check_rank1 ($aseco, $command) {

    // Enable/Disable rank kicker
    $rankkick1 = true;

    if ( $rankkick1 ) {

        // Set rank limit
        $ranklimit1 = 275000;
        $playerlogin = $command-> login;
        $playernick = $command-> nickname;
        $playerrank = $command-> ladderrank;

        if ( $playerrank > $ranklimit1 ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your rank number is lower than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}
?>
or download here

Remember to add

Code: Select all

<plugin>plugin.auto_rank_kicker.php</plugin>
to your plugins.xml
Last edited by Ant on 09 Jun 2011 16:31, edited 2 times in total.

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Auto Rank Kicker

Post by Xymph » 25 Sep 2010 07:38

The full Jfreu plugin has a complete rank kicking system built in, you'd just need to reverse some test for 'rank > limit' into '<'.
Well, maybe it's a little more work than that, I don't know off the top of my head.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Auto Rank Kicker

Post by Ant » 25 Sep 2010 14:00

My plugin kicks the specified ranked player as soon as they enter the server though so it stops people of a certain rank that you don't want playing on your server from even entering.

I had a look at the jfreu plugin and I can't find anything in there to check ladder points - only ladder rank. Is there any way to do this by ladder points ??

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Auto Rank Kicker

Post by Xymph » 25 Sep 2010 19:29

Ant wrote:My plugin kicks the specified ranked player as soon as they enter the server though so it stops people of a certain rank that you don't want playing on your server from even entering.
Same for Jfreu's system.
Ant wrote:I had a look at the jfreu plugin and I can't find anything in there to check ladder points - only ladder rank. Is there any way to do this by ladder points ??
Changing "->ladderrank" into "->ladderscore" in a few appropriate places might accomplish that. I'm not going to spend time on it though. :)
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by Ant » 25 Sep 2010 19:37

No thats no problem, thats all I needed to know. Thanks man i'll try it now :thumbsup:

Edit: Thanks again Xymph it works, and here it is :)

plugin.auto_score_kicker.php

Code: Select all

<?php
//Auto score kicker plugin for XAseco by Ant (25th September 2010)
//All code snipped and changed slightly from El Fuegos Biggeordie.php chatbot
//Find it at http://www.tm-forum.com/viewtopic.php?f=28&t=5197
//Default plugin state only allows players with Ladder Points of 40k - 80k
//Enable/Disable the functions and change the scorelimits below to your preference
//Support: http://www.tm-forum.com/viewtopic.php?f=127&t=26635


// Check player score and kick great players
Aseco::registerEvent("onPlayerConnect", "check_score");

function check_score ($aseco, $command) {

    // Enable/Disable score kicker
    $scorekick = true;

    if ( $scorekick ) {

        // Set score limit
        $scorelimit = 80000;
        $playerlogin = $command-> login;
        $playernick = $command-> nickname;
        $playerscore = $command-> ladderscore;

        if ( $playerscore > $scorelimit ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your ladder points is higher than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}

// Check player score and kick rubbish players
Aseco::registerEvent("onPlayerConnect", "check_score1");

function check_score1 ($aseco, $command) {

    // Enable/Disable score kicker
    $scorekick1 = true;

    if ( $scorekick1 ) {

        // Set rank limit
        $scorelimit1 = 40000;
        $playerlogin = $command-> login;
        $playernick = $command-> nickname;
        $playerscore = $command-> ladderscore;

        if ( $playerscore < $scorelimit1 ) {

            $msg = "$z$w$i$f30Sorry $z$playernick, $z$w$i$f30but I have to kick you as your ladder points is lower than this server allows!";
            $aseco->addCall("ChatSendToLogin",array($msg, $playerlogin));
            $aseco->addCall("Kick", array($playerlogin));

        }

    }

}
?>
or download here

Remember to add

Code: Select all

<plugin>plugin.auto_score_kicker.php</plugin>
to your plugins.xml
Last edited by Ant on 09 Jun 2011 16:30, edited 1 time in total.

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Auto Rank Kicker

Post by Ant » 25 Sep 2010 21:32

Xymph wrote:
Ant wrote:My plugin kicks the specified ranked player as soon as they enter the server though so it stops people of a certain rank that you don't want playing on your server from even entering.
Same for Jfreu's system.
Oh ok, does the jfreu plugin also have lower and upper limits too? For example the default state in my rank kicker plugin only allows players with a world ladder rank of 5000 - 75000, and the default state in my score kicker only allows players with Ladder Points of 40k - 80k. Both can obviously be changed though to the users preference.

User avatar
Knutselmaaster
swift roadking
swift roadking
Posts: 692
Joined: 16 Feb 2007 01:40
Owned TM-games: TMO/TMN/TMNF/TMU
Manialink(s): intr
Location: Between DisneyLand and Paris
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by Knutselmaaster » 25 Sep 2010 23:24

Why don't you just enter that values in the dedi config?

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by nocturne » 26 Sep 2010 11:56

Isn't this feature already available in Fufi's autoqueue..? As for other ranking limitations, keep in mind that any server beyond a typical 0-50k must be public for all players, meaning that spec slots must be made available to all players regardless of ranking.

As it stands, you could only run this plugin on a 0-50k server without a bit of modification.
Chief Janitorial Supervisor of the Let'sRock! TM community : www.LetsRock-TM.com

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by Ant » 27 Sep 2010 00:26

Knutselmaaster wrote:Why don't you just enter that values in the dedi config?
I tried and that results in nobody at all being able to enter the server.
nocturne wrote:Isn't this feature already available in Fufi's autoqueue..?
In the autoqueue, doesn't that just kick the worst ranked players after a race ? I don't think it stops them from entering.
nocturne wrote:As for other ranking limitations, keep in mind that any server beyond a typical 0-50k must be public for all players, meaning that spec slots must be made available to all players regardless of ranking.

As it stands, you could only run this plugin on a 0-50k server without a bit of modification.
Yeah man thats true, I said above that it should only probably be used on non ladder servers. And yep, no modification needed (unless you wanna change rank and score limits)

nocturne
solid chaser
solid chaser
Posts: 1390
Joined: 08 Jun 2007 18:48
Owned TM-games: all
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by nocturne » 27 Sep 2010 01:29

Setting the values in the config sets the point limitations in the server (the minimum limit sets what is required to join, whereas the upper limit is only the maximum points that can be awarded), but specs slots are open to any rank. If you have a 40k-80k server, a player with 90k can still join and play (as per ladder rules), they just can't get points. Of course, you also need the appropriate level of authenticated server account for your set point limits, ie. you can't do a 25k-75k server as a 20-70k account isn't ranked high enough, and the next step up has a minimum point limit of 40k.

As for the autoqueue, it manages the player queue as well as keep specs of unnecessary ranking from racing (though think that bug in the dedi has been fixed for awhile). So, guess it's not really necessary.

So I guess, if you have a non ladder server, can set upper and lower limits from 0-50k... but anything else, no point in a plugin. The minimum point limit has to be set in the config, and you can't boot better ranked players, as ladders servers have to be public.
Chief Janitorial Supervisor of the Let'sRock! TM community : www.LetsRock-TM.com

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by Ant » 27 Sep 2010 18:59

So, in other words these are only useful for any 0-50k server - any other server isn't allowed to do what these plugins do. Thanks for all the input by the way :)

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Auto Rank Kicker

Post by Xymph » 27 Sep 2010 19:36

Ant wrote:Oh ok, does the jfreu plugin also have lower and upper limits too?
It was designed only for one limit, so two would require a second entry in the config, and additional coding.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland
Contact:

Re: Auto Rank Kicker & Auto Score Kicker Plugins

Post by jouko100 » 27 Sep 2010 19:41

I will put porno to my 0-60 k server.It is not denied

Join my server jou maps somewhere

Post Reply