IP Info for admins <mod>

IP Info for admins <mod>

Postby ClassyRain » 28 Mar 2012, 04:57

What this does is provide the admins with an IP of incoming people. It provides also anyone greater than master with the IP of connectors. It hasn't been thoroughly tested though, but I debugged it enough so it won't crash with a segfault.

Credits to ecube (ClassyRain) for coding, Zeroknight for idea, Gingerbear for another idea, and Rage for help with testing.
Special thanks to quin and graphitemaster for help :)
The info is shown at the top (IP, CN, name).
Put the server.cpp in the src/game directory, and compile it if you wish to use it.

Current functions:
/getip CN (only works for master and above, make sure you set sv_serveropen to 3)
Shows the IP and CN of incoming players to master and above.
Claiming admin or master on a server (if you're not authed) gives an extended message.

The diff: (all those "muted" things were fails, I'll work on those later, but for now, they're commented out)
The #getip thing was also a fail, and was commented out, please ignore that. Use /getip instead.
Diff:
http://pastebin.com/2n3udiEL
Attachments
server.cpp
(199.68 KiB) Downloaded 334 times
Last edited by ClassyRain on 01 Apr 2012, 17:16, edited 7 times in total.
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Re: IP Info for admins <mod>

Postby Gingerbear » 28 Mar 2012, 05:32

You should try making it to where admins/mods can get an IP using someones client number :3 since you would only need the IP's of someone causing trouble I don't see the reason for seeing everyone's IP that connects. And it would also be more convenient because it would be hard to remember the IP after they have already played for a bit, unless you just get it after you kick them or go through logs. I'm not trying to say your mod is bad I like it and it can be useful, just saying you could build off it and make it better.
Gingerbear
 
Posts: 50
Joined: 10 Aug 2011, 04:36

Re: IP Info for admins <mod>

Postby ClassyRain » 28 Mar 2012, 06:04

Gingerbear {l Wrote}:You should try making it to where admins/mods can get an IP using someones client number :3 since you would only need the IP's of someone causing trouble I don't see the reason for seeing everyone's IP that connects. And it would also be more convenient because it would be hard to remember the IP after they have already played for a bit, unless you just get it after you kick them or go through logs. I'm not trying to say your mod is bad I like it and it can be useful, just saying you could build off it and make it better.

Yeah, that's a good idea! (How do I capture text from stuff that people says?)
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Re: IP Info for admins <mod>

Postby sireus » 28 Mar 2012, 17:56

ClassyRain {l Wrote}:(How do I capture text from stuff that people says?)

Look for case N_TEXT: in the very same server.cpp.
sireus
 
Posts: 109
Joined: 24 May 2011, 20:10

Re: IP Info for admins <mod>

Postby qreeves » 28 Mar 2012, 21:39

I've been considering for the next release: Showing ip address information in all join/part messages like IRC.
Quinton "quin" Reeves | Lead Developer, Red Eclipse | http://redeclipse.net/ | http://www.facebook.com/redeclipse.net
User avatar
qreeves
 
Posts: 1294
Joined: 17 Mar 2011, 03:46
Location: Queensland, Australia

Re: IP Info for admins <mod>

Postby ClassyRain » 28 Mar 2012, 21:45

sireus {l Wrote}:
ClassyRain {l Wrote}:(How do I capture text from stuff that people says?)

Look for case N_TEXT: in the very same server.cpp.

Thanks sireus, i'll check that out. In the meantime, I'll get lazy and make an IRC bot that keeps a text file with the Cn's and IP's for players for operators on IRC to use.

qreeves {l Wrote}:I've been considering for the next release: Showing ip address information in all join/part messages like IRC.

Probably shouldn't do that; people can't get cloaks or anything like on IRC they can. Unless you'd be willing to make a cloaking system, this idea isn't that great.
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Re: IP Info for admins <mod>

Postby qreeves » 29 Mar 2012, 00:57

ClassyRain {l Wrote}:Probably shouldn't do that; people can't get cloaks or anything like on IRC they can. Unless you'd be willing to make a cloaking system, this idea isn't that great.

I probably would, for registered users. The idea is predicated on me making a registration system though :P
Quinton "quin" Reeves | Lead Developer, Red Eclipse | http://redeclipse.net/ | http://www.facebook.com/redeclipse.net
User avatar
qreeves
 
Posts: 1294
Joined: 17 Mar 2011, 03:46
Location: Queensland, Australia

Re: IP Info for admins <mod>

Postby Gingerbear » 29 Mar 2012, 01:13

OOOO Registration system :) Still think it would be cool for admins/auths to get an IP using someones cn
Gingerbear
 
Posts: 50
Joined: 10 Aug 2011, 04:36

Re: IP Info for admins <mod>

Postby ClassyRain » 31 Mar 2012, 01:12

Ok, I made it so that anybody with master or higher can now get someone's IP by inputting their CN (#getip CN)
However, It doesn't seem to work very well, as with 2 players it begins to only output one IP. AAANNNDDD... you can replace #getip with any combination of 6 characters and it will execute the function! XD
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Re: IP Info for admins <mod>

Postby qreeves » 31 Mar 2012, 09:52

You don't need to hijack player chat to add commands to your Red Eclipse server, you can actually add "GICOMMAND" definitions to the server side and the client will just send any unknown commands to the server for processing :)
Quinton "quin" Reeves | Lead Developer, Red Eclipse | http://redeclipse.net/ | http://www.facebook.com/redeclipse.net
User avatar
qreeves
 
Posts: 1294
Joined: 17 Mar 2011, 03:46
Location: Queensland, Australia

Re: IP Info for admins <mod>

Postby ClassyRain » 01 Apr 2012, 00:06

qreeves {l Wrote}:You don't need to hijack player chat to add commands to your Red Eclipse server, you can actually add "GICOMMAND" definitions to the server side and the client will just send any unknown commands to the server for processing :)

That is soo cool! :D This'll be easier this way :)

How do you make them take args? I have
{l Code}: {l Select All Code}
    void getip( int cn )  // argument
    {
      clientinfo *ci = (clientinfo *)getinfo( cn );
      const char * hostname;
      if ( ci != NULL ) {
        hostname = gethostname( ci->clientnum );
        result( hostname );
      }
      else
        result( "\fs\fzryEpic fail\fS, the args were not correct. :P" );
    }
    GICOMMAND( 0, getip, "i", ( int abc ), getip( abc ), );

But it just won't take the argument... Am I missing something?
EDIT: Yes I missed something, I had to make ABC a pointer (epic failure)

However, it has to make it public (ecube executed getip (returned some.ip) )
As long as they don't know who owns the IP, it should be OK.

(Download available at top of page)

EDIT: I made it so that the IP is PM'd to the user. However, the side effect is that all other GICOMMANDs will also have their return values PM'd to the user.
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Re: IP Info for admins <mod>

Postby ClassyRain » 01 Apr 2012, 06:26

My next idea of a mod will be a /giveadmin and /takeadmin commands and a master password for giving someone master instead of admin. I'll also try to work on a /mute command
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Re: IP Info for admins <mod>

Postby TheLastProject » 01 Apr 2012, 10:03

ClassyRain {l Wrote}:EDIT: I made it so that the IP is PM'd to the user. However, the side effect is that all other GICOMMANDs will also have their return values PM'd to the user.

Perhaps you could help quin with this then? :P
Hats, Afros, wings and raptor feet. This game is showing progress indeed.
TheLastProject
 
Posts: 432
Joined: 06 Nov 2011, 17:04

Re: IP Info for admins <mod>

Postby ClassyRain » 01 Apr 2012, 16:35

TheLastProject {l Wrote}:
ClassyRain {l Wrote}:EDIT: I made it so that the IP is PM'd to the user. However, the side effect is that all other GICOMMANDs will also have their return values PM'd to the user.

Perhaps you could help quin with this then? :P

Oh yeah, I forgot to update the download... and I should probably show the differences :)
ClassyRain
 
Posts: 26
Joined: 31 Jan 2012, 01:21

Who is online

Users browsing this forum: No registered users and 1 guest