Limiting access to the server

Hello Tribes next attracted me because of the open source nature of the code, i am not a programmer by trade but i am wondering if the source code available for the tribesNext server could be modified so that only a list of preapproved IP addresses, or ingame names would be able to login to the server. Sort of like a guest list in which only users on the list would be able to join the server. This would be more complex than just putting a password on the server, it would require a successful join to be based on the users IP or ingame name to be included on a list.

Secondly, could the code be modified to export the player stats and game stats at the end of each game?

I tried to message the develoer directly but i am a new member and require at least 3 posts first.

thanks all. ::)

Comments

  • Hello Tribes next attracted me because of the open source nature of the code, i am not a programmer by trade but i am wondering if the source code available for the tribesNext server could be modified so that only a list of preapproved IP addresses, or ingame names would be able to login to the server. Sort of like a guest list in which only users on the list would be able to join the server. This would be more complex than just putting a password on the server, it would require a successful join to be based on the users IP or ingame name to be included on a list.

    Secondly, could the code be modified to export the player stats and game stats at the end of each game?

    I tried to message the develoer directly but i am a new member and require at least 3 posts first.

    thanks all. ::)
    Firstly, yes, it's possible to do what you are thinking of, although a password seems the easier way to go as the other reason would actually take work. Also, yes, stats can be exported. See Tribes2Stats.com and TribalOutpost.com/t2stats.

    rJay
  • Interesting, anyone here have the capability of coding what i am looking for? If so please post here or PM me, and we can talk about the costs.

    thanks guys.
  • edited January 2015
    As far as your idea for the approved IP addresses to connect, I heard on SCP a while back about something in
    server.cs... I dug through the script and found the GameConnection::onConnect function, which may or may not aid you in your endeavors.

    I'm not too knowledgeable in TS or TGE and its capabilities, nor Tribes 2's best places to handle these instances. Just going of of something remotely close to what I've been told.

    You could probably handle this using a client's guid through %client.guid.

    You're better off receiving a response from Blakhart, Phantom, Liukcairo, Thyth, teratos, etc.
  • So much easier to just tell them the pw and be done with it. Then they can connect with any ip and user name. If you go by ip addys what happens when your friends isp issues him another ip or if your friend forgets his user name's pw? If you want to get technical look in evo and tricon and/or other admin mods to get some ideas on how bans are handled.
  • $IPSafeList[0] = "IP:blah.blah.blah.blah";
    $IPSafeList[1] = "IP:...";
    //So on, so on
    
    package IPFilter {
    
       function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ) {
          parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch);
          %isOk = false;
          for(%i = 0; $IPSafeList[%i] !$= ""; %i++) {
             if(strcmp(%client.getAddress(), $IPSafeList[%i]) == 0) {
                %isOk = true;
                break;
             }
          }
          if(!%isOk) {
             %client.setDisconnectMessage("You are not on the approved IP list.");
             %client.schedule(500, delete);
          }
       }
    
    };
    activatePackage(IPFilter);
    

    Threw this together in about 2 minutes, so it may not work as intended, but this is how you'd do something of that nature.
  • $IPSafeList[0] = "IP:blah.blah.blah.blah";
    $IPSafeList[1] = "IP:...";
    //So on, so on
    
    package IPFilter {
    
       function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ) {
          parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch);
          %isOk = false;
          for(%i = 0; $IPSafeList[%i] !$= ""; %i++) {
             if(strcmp(%client.getAddress(), $IPSafeList[%i]) == 0) {
                %isOk = true;
                break;
             }
          }
          if(!%isOk) {
             %client.setDisconnectMessage("You are not on the approved IP list.");
             %client.schedule(500, delete);
          }
       }
    
    };
    activatePackage(IPFilter);
    

    Threw this together in about 2 minutes, so it may not work as intended, but this is how you'd do something of that nature.

    You'll probably want to parent::onConnect after all the code to check approved IP addresses, there's not really a reason to let that run first if you're just checking IP addresses.
  • Again, threw it together in 2 minutes, so I really wasn't going through a big thinking process.

    Speaking of that, the correct message function is setDisconnectReason, not setDisconnectMessage.
  • You're probably better off doing this by GUID than IP. GUIDs are unique numeric identifiers part of each account, thus you could whitelist players, rather than IP addresses.

    I had to re-implement bans when building the TribesNext version of the game server connection process, so the code for processing GUID/IP bans is in script source (within t2csri.vl2, which is just a .zip file, containing the TribesNext script code). The quick and dirty way would be to invert the ban list check, and use the ban list facilities as your whitelist.

    If you want to be more clever about it, you could use the web-based clan/profile API and restrict access to your server to those who have membership in your whitelist clan. If you want to be really clever about it, you could allow players to join, but not let them out of observer mode (possibly hide their chat messages from non-server-admin players), and give them instructions for whitelisting.

    But, if you're not capable of programming, the easiest way really would just be setting a periodically rotating server password.

    Regarding game stats, there are a bunch of different script packages that do different kinds of statistics collection and reporting. Teratos has some pretty nice scripts that he'd connected up to a web based player statistics viewer when the Goon Haven server was up -- you can probably find a copy by searching on the forum here.
  • Firstly, let me say that everyone on here thus far is incredible, Phantom 139 for the code effort, thyth for the suggestions, and everyone else, this was a really great response.
Sign In or Register to comment.