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
Thyth
Apotheosis Incarnate

Posts: 689

View Profile
15: January 07, 2011, 12:31:01 PM »
You kicked the person after entering the ban command. The kick code sets its own ban of 10 seconds as you said, overriding whatever you had there before. This behavior should be obvious given that I said the easiest way to unban someone is to issue a new ban with very short duration.

Either use the ban function, or disconnect the user by deleting their client object after setting a ban via the command.

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

View Profile
16: January 07, 2011, 04:28:20 PM »
Sorry, none of this is obvious to me. I just remember reading somewhere that if you ban someone via the console, that does not kick them. I know next to nothing about scripting or how Tribes works internally. I took basic programming in like 1977, that's about it for me.

I also had tried banning that person, and having them leave without kicking them, and it still did not work. They were able to rejoin. So I doubt deleting their client object (something I don't know how to do) would work either.
Thyth
Apotheosis Incarnate

Posts: 689

View Profile
17: January 07, 2011, 04:46:09 PM »
Adding someone to the ban list does not automatically disconnect them. That is correct. The kick command code automatically adds a ban of duration $Host::KickBanTime seconds (set in the serverprefs.cs file). The ban command code is essentially identical to the kick command code, except the duration of the ban is specified by $Host::BanTime, again in seconds, in the same preferences file.

Both the kick and ban commands disconnect the target user. Ideally you should use those instead of adding users to the ban list manually.

You can also examine the banlist.cs file in the preferences directory after adding an entry to the ban list. There should be entries along the lines of: $BanList::IP1_1_1_1 = "#######"; and $BanList::GUID####### = "#######";

The 1_1_1_1 will be the IP address target, and the blob after GUID will be the unique numeric identifier of the account. The values of these variables are Unix epoch values indicating the expiration time of the ban (in seconds since 01/01/1970 00:00 GMT).

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

View Profile
18: January 07, 2011, 05:52:53 PM »
Adding someone to the ban list does not automatically disconnect them. That is correct. The kick command code automatically adds a ban of duration $Host::KickBanTime seconds (set in the serverprefs.cs file). The ban command code is essentially identical to the kick command code, except the duration of the ban is specified by $Host::BanTime, again in seconds, in the same preferences file.

Both the kick and ban commands disconnect the target user. Ideally you should use those instead of adding users to the ban list manually.



All that I understood already. But when I use the kick or ban option from the drop down box in the ESC screen, it does not ip ban someone, only by GUID. So someone can esaily have several GUID's and rejoin.

Quote
You can also examine the banlist.cs file in the preferences directory after adding an entry to the ban list. There should be entries along the lines of: $BanList::IP1_1_1_1 = "#######"; and $BanList::GUID####### = "#######";

Here is an example of what is in my banlist.cs file:
$BanList::GUID3273558 = "1294439942";

There is no ip specified.
I also have a evo_balist.cs file, there is nothing in it, and I think you have to edit that manually, and there are no instructions for ip banning in it.

I was looking through the evolution vl2 file, and the banning code in there looks very similar to yours, but there are no provisions for ip banning.

So I just tried it again tonight, doing the BanList::add function, then have the person drop from the server(instead of kicking them), and they were able to rejoin without a problem. That is with specifying "0" as the GUID, and using their ip.
Thyth
Apotheosis Incarnate

Posts: 689

View Profile
19: January 07, 2011, 08:09:06 PM »
In classic, the ban() function in server.cs that is called from the admin context menu in the lobby includes the line BanList::add(%client.guid, %client.getAddress(), $Host::BanTime); where %client is the client user object. This will create both a GUID ban and an IP ban.

If you're not seeing corresponding IP address entries in the banlist file, it's most likely that the EVO modification is replacing the ban function with one that does one or the other.

I also double checked manually adding a ban via BanList::add(). I originally intended for the function to be called with the contents of a %client.getAddress() call which includes the client remote connection port, so it's actually expecting something in the form of "IP:x.x.x.x:yyyy" where yyyy is the port. When giving it a raw IP address, it puts out an error about getSubStr. This is probably why the ban string you tried directly didn't work. Try something along the lines of BanList::add(0, "IP:1.1.1.1:", 60); instead.

I'll add a check in the RC3 update so it can handle raw IP addresses.

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

View Profile
20: January 08, 2011, 06:32:34 AM »
Progress!
riverrat
Nugget
Posts: 36

View Profile
21: January 08, 2011, 11:12:40 AM »
BanList::add(0, "IP:1.1.1.1:", 60);

Did not work either. Here is the code that I think controls the banning in EVO mod maybe you can examine it and see if there is a conflict? Or maybe we can change it to work with your coding?:
Code:
//
// Evo MOD .chat command parser
//

function EvoConsoleParseHelp( %sender )
{
  messageClient( %sender, "EvoCon",
                  "\c2Evo Console Commands:\n" @
                  ".help\n" @
        ".motd\n" @
        ".cp <text>\n" @
        ".bottomprint <on|off>\n" @
        "- - - - - - - - - - - - - -\n" );
   messageClient( %sender, "EvoCon",
        "\c2.login <passwd>\n" @
        ".logout\n" @
        ".claimLease\n" @
        ".joinpw <passwd>\n" @
        "- - - - - - - - - - - - - -\n" );
   messageClient( %sender, "EvoCon",
        "\c2.wonid <name|wonid|plyrid>\n" @
        ".whois <name|wonid|plyrid>\n" @
        ".warn <name|wonid|plyrid>\n" @
        ".kick <name|wonid|plyrid>\n" @
        ".ban <name|wonid|plyrid>\n" @
        "- - - - - - - - - - - - - -\n" );
   messageClient( %sender, "EvoCon",
        "\c2.teamname <nr> <name>\n" @
        ".teamname reset\n" @
        ".clanlock <nr> <name>\n" @
        ".clanlock remove\n" @
        "- - - - - - - - - - - - - -\n" @
        ".nbr <on|off|players>\n" );
}


function EvoConsoleMOTD( %sender )
{
  if ( $Host::EvoMOTD !$= "" )
    {
      centerprint(%sender, $Host::EvoMOTD, $Host::EvoMOTDtime, $Host::EvoMOTDlines);
    }
  else
    {
      messageClient(%sender, "EvoConErr", "\c2This server does not have a MOTD." );
    }
 
  return;
}


function EvoConsoleToggleBottomPrint( %sender, %value )
{
  switch$(%value)
    {
     
    case "on" :
      serverCMDToggleBottomPrint( %sender, 1 );
      messageClient( %sender, "EvoCon", "Bottomprint messages turned on." );
     
    case "off" :
      serverCMDToggleBottomPrint( %sender, 0 );
      messageClient( %sender, "EvoCon", "Bottomprint messages turned off." );
     
    default:
      messageClient( %sender, "EvoCon", "Usage: .bottomprint <on|off>" );
     
    }
 
  return;
}


function EvoConsoleCenterPrint ( %sender, %text )
{
  if ( !%sender.isAdmin && !%sender.isSuperAdmin )
    {
      messageClient( %sender, "EvoConErr", "\c2Only Admins and Super Admins can use this command." );
      return;
    }
 
  centerPrintAll( getTaggedString( %sender.name ) @ " - " @ %text, 5, 1 );
}


function EvoConsoleMyWonID( %sender )
{
  messageClient( %sender, "EvoCon", "Your WonID is " @ %sender.guid @"." );
  return;
}


function EvoConsoleSetJoinPass( %sender, %password )
{
  serverCmdSADSetPassword(%sender, %password);
  return;
}


function EvoConsoleLogin( %sender, %password )
{
  serverCmdSAD( %sender, %password );
  return;
}


function EvoConsoleClaimSA ( %sender )
{
  messageClient( %sender, 'EvoConErr', 'Note: This command is obsolete. Please use .claimLease instead.' );
}


function EvoConsoleClaimLease ( %sender )
{
  // Super Admins do not need to claim a lease. They cannot benefit from it
  // anyway.
  if ( %sender.isSuperAdmin )
    {
      messageClient( %sender, 'EvoConErr', 'You already are SuperAdmin.' );
      return;
    }

  // Get the lease information
  %LeaseLevel = EvoCurrentLease ( %sender.guid );


  // If lease is not found, return with error
  if ( %LeaseLevel == 0 )
    {
      messageClient( %sender, "EvoConErr", "You cannot claim Admin status. No lease has been registered for your WonID." );
      return;
    }

 
  if ( %LeaseLevel == 1 )
    {
      if ( %client.isAdmin )
{
  messageClient( %sender, 'EvoConErr', 'Your lease is for admin status which you already have.' );
  return;
}

      %sender.isAdmin = 1;
      %sender.isSuperAdmin = 0;
     
      messageAll('MsgAdminPlayer', '\c3%2 \c2has claimed his leased Admin status.', %sender, %sender.name );
     
      %adminmsg = " has claimed his leased Admin status.";
    }
  else // LeaseLevel > 1
    {
      %sender.isAdmin = 1;
      %sender.isSuperAdmin = 1;
     
      messageAll('MsgSuperAdminPlayer', '\c3%2 \c2has claimed his leased SuperAdmin status.', %sender, %sender.name );
     
      %adminmsg = " has claimed his leased SA status.";
    }

  if ( %sender.pizza )
    {
      pizzaSendHudUpdate( %game, %sender, "" );
    }

  adminLog(%sender, %adminmsg);
  logEcho(%sender.nameBase @ %adminmsg );

  return;
}


// EvoCommandWhois(%sender, %param)
// Info: do a whois on a player
function EvoConsoleWhois(%sender, %param)
{
if (! ( ( %sender.isAdmin && $Host::EvoAdminWhois ) ||
( %sender.isSuperAdmin && $Host::EvoSuperAdminWhois ) )
    )
{
messageClient(%sender, 'EvoConErr', '\c2This command is disabled for your admin level.');
return;
}

%target = EvoFindTarget(%param);

if(%target == -1)
messageClient(%sender, 'EvoCon', '\c2.whois usage: .whois <name|id|guid>');
else
{
if( %target.isSuperAdmin && $Host::EvoBlockSuperAdminWhois )
{
messageClient(%sender, 'EvoConErr', '\c2Whois disabled with Super Admins.');
return;
}

%authInfo = %target.getAuthInfo();
messageClient(%sender, 'EvoCon', '%1, REALNAME: %2, CLAN: %3, GUID: %4, CLIENT: %5, %6', %target.name, getField(%authInfo, 0), getField(%authInfo, 1), %target.guid, %target, %target.getAddress());
}
}

// EvoCommandWarnPlayer(%sender, %param)
// Info: warn a player
function EvoConsoleWarnPlayer(%sender, %param)
{
if(!%sender.isAdmin)
{
messageClient(%sender, 'EvoConErr', '\c2You must be an admin to use this command.');
return;
}

%target = EvoFindTarget(%param);

if(%target == %sender)
{
messageClient(%sender, 'EvoConErr', '\c2You can not warn yourself!');
return;
}

if(%target == -1)
messageClient(%sender, 'EvoCon', '\c2.warn usage: .warn <name|id|guid>');
else
serverCmdWarnPlayer(%sender, %target);
}

// EvoCommandKickPlayer(%sender, %param)
// Info: kick a player
function EvoConsoleKickPlayer(%sender, %param)
{
if(!%sender.isAdmin)
{
messageClient(%sender, 'EvoConErr', '\c2You must be an admin to use this command.');
return;
}

%target = EvoFindTarget(%param);

if(%target == %sender)
{
messageClient(%sender, 'EvoConErr', '\c2You can not kick yourself!');
return;
}

if(!%sender.isSuperAdmin && %target.isAdmin) // only super admins can kick admins
{
messageClient(%sender, 'EvoConErr', '\c2You can not kick %1, %2 is an Admin!', %target.name, %target.sex $= "Male" ? 'he' : 'she');
return;
}

if(%target == -1)
messageClient(%sender, 'EvoCon', '\c2.kick usage: .kick <name|id|guid>');
else
{
Game.kickClientName = %target.name;

kick(%target, %sender, %target.guid);

%authInfo = %target.getAuthInfo();
adminLog(%sender, " kicked " @ %target.nameBase @ "( " @ getField(%authInfo, 0) @ ", " @ getField(%authInfo, 1) @ ", " @ %target.guid @ ", " @ %target.getAddress() @ ")");
}
}


// EvoCommandBanPlayer(%sender, %param)
// Info: ban a player
function EvoConsoleBanPlayer(%sender, %param)
{
  if ( $Host::TournamentMode )
    {
      mesageClient ( %sender, 'EvoConErr', '\c2This command is disabled in Tournament Mode.~wfx/misc/error.misc.wav');
      return;
    }


if(!%sender.isAdmin)
{
messageClient(%sender, 'EvoCoNErr', '\c2You must be an admin to use this command.');
return;
}

if(!%sender.isSuperAdmin && !$Host::EvoAdminBan)
{
messageClient(%sender, 'EvoConErr', '\c2This command is disabled for your admin level.');
return;
}

%target = EvoFindTarget(%param);

if(%target == %sender)
{
messageClient(%sender, 'EvoConErr', '\c2You can not ban yourself!');
return;
}

if(!%sender.isSuperAdmin && %target.isAdmin) // only super admins can ban admins
{
messageClient(%sender, 'EvoConErr', '\c2You can not ban %1, %2 is an Admin!', %target.name, %target.sex $= "Male" ? 'he' : 'she');
return;
}

if(%target == -1)
messageClient(%sender, 'EvoConErr', '\c2.ban usage: .ban <name|id|guid>');
else
{
ban(%target, %sender);

%authInfo = %target.getAuthInfo();
adminLog(%sender, " banned " @ %target.nameBase @ "( " @ getField(%authInfo, 0) @ ", " @ getField(%authInfo, 1) @ ", " @ %target.guid @ ", " @ %target.getAddress() @ ")");
}
}


function EvoConsoleClanLock ( %sender, %param )
{
  if( ! ( ( %sender.isAdmin && $Host::EvoAdminClanLock ) ||
  ( %sender.isSuperAdmin && $Host::EvoSuperAdminClanLock ) )
      )
    {
      messageClient(%sender, 'EvoConErr', '\c2You do not have the required privileges to use this command.~wfx/misc/error.misc.wav');
      return;
    }
 
  %Team = firstWord( %param );
  %Clan = restWords( %param );
 
  if ( %Team $= "remove" )
    {
      $Evo::ThisMission::ClanLockActive = 0;

      if ( $Evo::ThisMission::ClanLockTeam )
{
  EvoRemoveTempTeamName( $Evo::ThisMission::ClanLockTeam );
}

      messageAll ( 'EvoCon', '\c2Clanlock has been removed.~wfx/misc/diagnostic_on.wav' );
      return;
    }
 
  if ( %Team != 1 && %Team != 2 )
    {
      messageClient( %sender, 'EvoConErr', 'Team must be either 1 or 2.' );
      return;
    }


  if ( $Evo::ThisMission::ClanLockTeam )
    {
      EvoRemoveTempTeamName( $Evo::ThisMission::ClanLockTeam );
    }
 
  $Evo::ThisMission::ClanLockClan = %Clan;
  $Evo::ThisMission::ClanLockTeam = %Team;

  $Evo::ThisMission::ClanLockActive = 1;

  messageAll( 'EvoCon', '\c2Team \c3%1\c2 has been locked. Only members of \c3%2\c2 are now allowed there.~wfx/misc/diagnostic_on.wav', Game.getTeamName(%Team), %Clan );

  %NumPlayers = ClientGroup.getCount();

  %OtherTeam = ( %Team == 1 ) ? 2 : 1;

  for ( %Counter = 0; %Counter < %NumPlayers; %Counter ++ )
    {
      %Client = ClientGroup.getObject( %Counter );

      if ( // ( !%Client.isAdmin ) &&
   ( %Client.team == %Team ) &&
   ( !EvoIsClientInClan( %Client, %Clan ) )
   )
{
  messageClient( %Client, 'EvoClanLock', '\c2Switching you to other team.' );
  Game.clientChangeTeam( %Client, %OtherTeam, 0 );
}
    }

  // Set team name /after/ announcing the team lock only!
  EvoSetTempTeamName(%Team, %Clan );

  echo("Set Teamname. Now, getTeamName returns "@ Game.getTeamName(%Team) );

  return;
}


function EvoConsoleNoBaseRape( %sender, %string )
{
  if ( !%sender.isSuperAdmin )
    {
      messageClient( %sender, 'EvoConErr', '\c2Only SuperAdmins can use this command.' );
      return;
    }


  if ( $Host::TournamentMode )
    {
      messageClient( %sender, 'EvoConErr', '\c2You cannot access the No Base Rape settings in Tournament Mode.' );
      return;
    }

  if ( %string $= "off" )
    {
      serverCmdNBRSetup( %sender, "NoBaseRape", 0 );
      return;
    }

  if ( %string $= "on" )
    {
      serverCmdNBRSetup( %sender, "NoBaseRape", 1 );
      return;
    }


  if ( !isNumber( %string ))
    {
      messageClient( %sender, 'EvoConErr', '\c2Syntax: .nbr <on|off|number of players>' );
      return;
    }


  serverCmdNBRSetup( %sender, "NoBaseRapeBase", %string );


  return;
}


function EvoConsoleTeamName ( %sender, %string )
{
  if ( !%sender.isSuperAdmin )
    {
      messageClient( %sender, 'EvoConErr', '\c2Only SuperAdmins can use this command.' );
      return;
    }

  %Team = firstWord( %string );
  %NewName = restWords( %string );

  echo("Team : "@%Team@"  Name : "@%NewName );

  if ( %Team $= "reset" )
    {
      for ( %teamCount = 1; %teamcount <= Game.numteams; %teamcount++ )
{
  EvoRemoveTempTeamName( %teamCount );
}

      messageAll( '', '\c2The admin has reset all teamnames to their default values.' );
      return;
    }

  if ( (!isNumber( %Team )) || ( %NewName $= "" ) )
    {
      messageClient(%sender, 'EvoConErr', '\c2Syntax: .teamname <team number> <new team name>' );
      return;
    }

  messageAll( '', '\c2The admin has changed the name of team \c3%1\c2 from \c3%2\c2 to \c3%3\c2.', %Team, Game.getTeamName( %Team ), %NewName );

  EvoSetTempTeamName( %Team, %NewName );

  return;
}


function EvoParseCommands( %sender, %string )
{
  // Remove leading and trailing spaces
  %string = trim ( %string );

  if ( strstr( %string, "%" ) == 0 )
    // Allow abbreviated login command, Tricon2 Style
    {
      EvoConsoleLogin ( %sender, getSubStr( %string, 1, 255 ) );
      return;
    }

  %Command    = firstWord ( %string );
  %Parameters = trim ( restWords ( %string ) );

  switch$(%Command)
    {
    case ".help"  : EvoConsoleParseHelp ( %sender );
   
    case ".motd"  : EvoConsoleMOTD ( %sender );

    case ".wonid" : EvoConsoleMyWonID ( %sender );

    case ".cp"    : EvoConsoleCenterPrint ( %sender, %Parameters );

    case ".joinpw" : EvoConsoleSetJoinPass ( %sender, %Parameters );

    case ".login" : EvoConsoleLogin ( %sender, %Parameters );

    case ".logout" : EvoConsoleLogin ( %sender, "logout" );

    case ".bottomprint" : EvoConsoleToggleBottomPrint ( %sender, %Parameters );

    case ".claimSA" : EvoConsoleClaimSA ( %sender );
                      EvoConsoleObsolete   ( %sender, '.claimAdmin' );

    case ".claimLease" : EvoConsoleClaimLease ( %sender );

    case ".whois" : EvoConsoleWhois ( %sender, %Parameters );
     
    case ".warn" : EvoConsoleWarnPlayer ( %sender, %Parameters );

    case ".kick" : EvoConsoleKickPlayer ( %sender, %Parameters );

    case ".ban" : EvoConsoleBanPlayer ( %sender, %Parameters );

    case ".clanlock" : EvoConsoleClanLock ( %sender, %Parameters );

    case ".nbr" : EvoConsoleNoBaseRape ( %sender, %Parameters );

    case ".teamname" : EvoConsoleTeamName ( %sender, %Parameters );

    default:           messageClient( %sender, 'EvoCon',
                                      'Error. Command unknown. Use \'.help\'' @
                                      ' to get a list of valid commands.' );

    }

 
  return;
}



Thyth
Apotheosis Incarnate

Posts: 689

View Profile
22: January 08, 2011, 11:38:58 AM »
That just calls the built in kick() and ban() functions in the server.cs file. You should try running plain classic and see if the ban code works there.

The BanList::add(0, "IP:1.1.1.1:", 60); command in the console adds the following line to my banlist.cs: $BanList::IP1_1_1_1 = "1294515348"; so it's clear that the code itself works in a standard classic environment.

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

View Profile
23: January 08, 2011, 06:34:32 PM »
haha, I'm not even sure how to start my server in classic mode. I'll have to figure it out, and then see if the same thing happens, maybe there is another problem. either way, I won't be running a classic server, since all arena players like base arena for the most part.
Thyth
Apotheosis Incarnate

Posts: 689

View Profile
24: January 08, 2011, 10:00:07 PM »
Kick and ban functions appear to be the same between classic and base. I meant try running the server without your admin mod and see if it's working properly.

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

View Profile
25: January 09, 2011, 07:06:27 PM »
I read somewhere that you should never try and run arena 1.1 without evolution mod, I don't know why though. I guess I could just take out the vl2 file and try it. Or I was thinking I might have to go to arena 1.0, but then I lose all the options I currently have. Some will be happy, most won't.
Kryand
Assault
Posts: 702

View Profile
26: January 09, 2011, 08:05:09 PM »
Depends on which version of 1.1 you have. If there's a EvoSupport.cs or something like that in the VL2, you don't need Evo.

Blakhart
Juggernaught
Posts: 1415

View Profile
27: January 10, 2011, 06:08:43 AM »
Evo has compatibility issues with the community release scripts.vl2, so evo has more issues than just with tn.
riverrat
Nugget
Posts: 36

View Profile
28: January 12, 2011, 05:25:08 PM »
No Kyrand, there is no EvoSupport.cs in the arena.vl2 file.
I wasn't the one who set up this server, so I am not sure just exactly what it's got. I would love to start over, and get this ip banning working.
riverrat
Nugget
Posts: 36

View Profile
29: January 12, 2011, 05:30:41 PM »
You know what, I think this server is really messed up. Can someone help me start over and set it up correctly?
Pages: 1 [2] 3 Print 
« previous next »
Jump to:  

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