TribesNext

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


TribesNext >  TribesNext.com Forums >  Support >  Server Support >  Limiting access to the server « previous next »
Pages: [1] Print
Author Topic: Limiting access to the server
binderjeep
Nugget
Posts: 3

View Profile
January 22, 2015, 07:55:08 AM »
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. Roll Eyes
rJay
Scout

Posts: 395

View Profile
1: January 22, 2015, 11:12:44 AM »
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. Roll Eyes
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

Romans 1:16
binderjeep
Nugget
Posts: 3

View Profile
2: January 22, 2015, 12:37:35 PM »
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.
GeEkOfWiReS1097
Nugget²

Posts: 73

View Profile
3: January 22, 2015, 12:42:51 PM »
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.
« Last Edit: January 22, 2015, 01:15:14 PM by GeEkOfWiReS1097 »

If your problem can't be solved, you haven't dug deep enough.
Avoid re-posting a question that has been answered and we can prevent forum clutter:
Search with me.
Blakhart
Juggernaught
Posts: 1625

View Profile
4: January 22, 2015, 04:22:59 PM »
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.
Phantom139
Scout

Posts: 262

View Profile WWW
5: January 22, 2015, 05:57:03 PM »
Code:
$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.

Bio:
Founder/Creator Phantom Games Development.
Tribes 2 Modder, T3D Owner and Developer
Site:
www.phantomdev.net
Ragora
Seņor Nugget

Posts: 221

View Profile WWW
6: January 22, 2015, 06:01:28 PM »
Code:
$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.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Supposedly Einstein
Phantom139
Scout

Posts: 262

View Profile WWW
7: January 22, 2015, 06:02:56 PM »
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.

Bio:
Founder/Creator Phantom Games Development.
Tribes 2 Modder, T3D Owner and Developer
Site:
www.phantomdev.net
Thyth
Apotheosis Incarnate

Posts: 798

View Profile
8: January 22, 2015, 10:11:28 PM »
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.

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

View Profile
9: January 23, 2015, 05:24:58 AM »
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.
Pages: [1] Print 
« previous next »
Jump to:  

irc.quakenet.org / #TribesNext Powered by SMF  © Simple Machines
anything