TribesNext

Welcome, Guest. Please login or register.
Did you miss your activation email?


TribesNext >  TribesNext.com Forums >  Support >  Server Support >  ip banning « previous next »
Pages: [1] 2 3 Print
Author Topic: ip banning
riverrat
Nugget
Posts: 36

View Profile
January 05, 2011, 05:22:44 AM »
How can I set up ip banning on the sewer(base arena server)? I've tried adding lines to evo_banlist.cs, and banlist.cs with no success.
Example:
$BanList::addAbsolute(192.168.1.1);
Blakhart
Juggernaught
Posts: 1444

View Profile
1: January 05, 2011, 08:19:31 AM »
Hi
Here is a direct copy of a guid ban from banlist.cs:
"BanList::addAbsolute(19438, "0", 2147483647);"

Of course one must have the guid of any player so you need admin powas or a neat script by quing.
Code:
//  QGuid
//  by {NQP!}Qing
//  Qing@netquickposse.com
//  http://netquickposse.com



package QGuid
{
function handleClientJoin(%msgType, %msgString, %clientName, %clientId, %targetId, %isAI, %isAdmin, %isSuperAdmin, %isSmurf, %guid)
{
parent::handleClientJoin(%msgType, %msgString, %clientName, %clientId, %targetId, %isAI, %isAdmin, %isSuperAdmin, %isSmurf, %guid);

if($CurrentTime12 !$= "")
$ClientConnectLog = $CurrentDate SPC $CurrentTime12 @ " ET" SPC stripchars(detag(%clientname), "\cp\co\c6\c7\c8\c9") SPC %guid;
else
$ClientConnectLog = stripchars(detag(%clientname), "\cp\co\c6\c7\c8\c9") SPC %guid;
if(%guid)
while (strlen(%guid) < 8)
%guid = "0" @ %guid;
export("$ClientconnectLog", "logs/guid/" @ %guid @ ".cs", true);
export("$ClientConnectLog", "logs/ClientConnectLog.cs", true);
echo($clientConnectLog);
}
};
activatePackage(QGuid);

You should be able to get ip bans going too, as guid bans will not prevent smurfing.
So here's an example of the ip ban that takes out an entire neighborhood:
"BanList::addAbsolute("IP:75.8.*.*.*", 0);"
« Last Edit: January 05, 2011, 08:22:34 AM by Blakhart »
Phantom139
Seņor Nugget

Posts: 219

View Profile WWW
2: January 05, 2011, 10:42:21 AM »
Hello,

I would agree with Blakhart, you don't want to use a GUID ban due to the smurfing reason. Tribes provides a function to get a client's IP: %client.getAddress(); which will return in the format of: "IP:Address". You could write something along the lines of that, or just go with Blakhart's suggested code.

Bio:
Founder/Creator Phantom Games Development.
Tribes 2 Modder, T3D Owner and Developer
Site:
www.phantomdev.net
riverrat
Nugget
Posts: 36

View Profile
3: January 05, 2011, 06:10:18 PM »
Ok thanks. I am not a scripter, so I am not totally sure what to do with that script there. I do own the server, so getting any info I need on banning someone is easy enough. I already was doing GUID banning, but as you stated, people can smurf to infinity and keep coming back.

Does that script go into the banlist.cs file?
Does it matter if I am running evo mod? Because evo has it's own banlist.cs.
riverrat
Nugget
Posts: 36

View Profile
4: January 05, 2011, 06:24:18 PM »
I tried adding this exact line:
"BanList::addAbsolute("IP:75.8.*.*.*", 0);"

To both banlist.cs, and evobanlist.cs using my own ip, and it did not work. Without the quotes of course, and with a $ sign in front of the Banlist.
Thyth
Apotheosis Incarnate

Posts: 702

View Profile
5: January 05, 2011, 07:14:36 PM »
Ban system was reworked for the TribesNext patch. You'll have to use BanList::add(%guid, %ip, %seconds) to add entries to the new ban list. The addAbsolute method is not implemented.

To do only an IP ban, you need to specify 0 for the GUID argument. To do only a GUID ban, the IP argument needs to be something other than an IP. IP ranges are not supported directly (though you could add the 256 or 65536 addresses by iterating if you want to).

Sarcastic, narcissistic, genius, resurrecting the game with brilliant strokes of wizardry.
Blakhart
Juggernaught
Posts: 1444

View Profile
6: January 05, 2011, 08:06:13 PM »
I am wondering why the overhaul of the ban code, news to me. But anyway, the script I posted runs in a client, and it grabs every guid from every player that is in or enters any server while that client is connected. So the script gets dropped into your gamedata/base/scripts/autoexec folder. Then you have to look at the logs it makes to gather the guids of the players you want. With this script you can ensure banning of people (at least specific guids) you never want to see in your server without them even entering your server. A simpler way to get guids is from the server console or admin apps like tricon or evo or whatever. You can have the server set to log all joins and then you can just cull the data from there to create your ban string that you will enter into banlist.cs by hand unless the ban function gets fixed.

so an example would be:
BanList::add(%19438, %75.8.*.*.*, %0)
« Last Edit: January 05, 2011, 08:11:13 PM by Blakhart »
Thyth
Apotheosis Incarnate

Posts: 702

View Profile
7: January 05, 2011, 08:39:42 PM »
Ban code was reworked because the original ban code doesn't work anymore. TribesNext game connections are closer to LAN mode connections than online mode connections, since none of the WON code is active. The original ban code ran in-engine based on the WON authentication image the client sent to the server as part of the connection handshake.

In TribesNext, a client completes the connection process similar to the LAN mode, but is put into a new special "phase 0" mode where the script based authentication process occurs. The original ban check code thus doesn't have any real data to work with. As a result, I reimplemented most of the ban code as a hybrid Torque/Ruby script (the Ruby is only there to handle proper timekeeping). The standard in-game scripts that issue bans (i.e. super-admin bans via the right-click context menu in the lobby) all work correctly. IP is checked before the cryptographic challenge process is performed, and GUID is checked once the user's ownership of the certificate with a particular GUID is verified.

You can see the code that I added in t2csri.vl2 under t2csri/bans.cs; if you desire, you can modify the behavior of this code. Adding wildcard support for IP addresses wouldn't really be that challenging (but it would need to be different from the code I have there already).

Sarcastic, narcissistic, genius, resurrecting the game with brilliant strokes of wizardry.
Blakhart
Juggernaught
Posts: 1444

View Profile
8: January 05, 2011, 08:59:23 PM »
Thanks for the explaination Thyth.
riverrat
Nugget
Posts: 36

View Profile
9: January 05, 2011, 09:29:51 PM »
BanList::add(%guid, %ip, %seconds)

Is not working for me. Couple questions, so I put a "$" in front of that line? Does this go in my banlist.cs, or my evobanlist.cs file? do I include the "%" signs. I tired it a bunch of ways and can't seem to get it to work.

Example, I put-- $BanList::add(%0, %IP:1.1.1.1, %1000000);
Just like that, or am I getting the annotation wrong?
Thank you for your help.
Thyth
Apotheosis Incarnate

Posts: 702

View Profile
10: January 06, 2011, 06:43:38 AM »
You don't add anything to the banlist.cs manually. You don't add random $'s in front of things, nor do you add random %'s in front of things.

To issue the correct ban for your example, issue the following into the game console: BanList::add(0, "IP:1.1.1.1", 1000000);

Sarcastic, narcissistic, genius, resurrecting the game with brilliant strokes of wizardry.
riverrat
Nugget
Posts: 36

View Profile
11: January 06, 2011, 08:03:42 AM »
Ah, ok. Sorry for being such a noob. And to unban that person?

If you were here, beers would be on me. Smiley
Thyth
Apotheosis Incarnate

Posts: 702

View Profile
12: January 06, 2011, 12:09:40 PM »
The easiest way would be to ban the person for one second.

Sarcastic, narcissistic, genius, resurrecting the game with brilliant strokes of wizardry.
riverrat
Nugget
Posts: 36

View Profile
13: January 06, 2011, 11:51:44 PM »
Ok did some tests tonight, and I put exactly this:
BanList::add(0, "IP:1.1.1.1", 60);
In the console, with the ip address being correct, and it did not work. I kicked the person right after putting that in the console, I have my kick set temporary to 10 seconds, and in 10 seconds he could come back. Does running EVO have anything to do with it?
Blakhart
Juggernaught
Posts: 1444

View Profile
14: January 07, 2011, 06:56:16 AM »
the plot thickens!
Pages: [1] 2 3 Print 
« previous next »
Jump to:  

irc.tribalwar.com / #TribesNext Powered by SMF 1.1.19 | SMF © 2005, Simple Machines