Page 1 of 1

IP Info for admins <mod>

PostPosted: 28 Mar 2012, 04:57
by ClassyRain
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

Re: IP Info for admins <mod>

PostPosted: 28 Mar 2012, 05:32
by Gingerbear
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.

Re: IP Info for admins <mod>

PostPosted: 28 Mar 2012, 06:04
by ClassyRain
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?)

Re: IP Info for admins <mod>

PostPosted: 28 Mar 2012, 17:56
by sireus
ClassyRain {l Wrote}:(How do I capture text from stuff that people says?)

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

Re: IP Info for admins <mod>

PostPosted: 28 Mar 2012, 21:39
by qreeves
I've been considering for the next release: Showing ip address information in all join/part messages like IRC.

Re: IP Info for admins <mod>

PostPosted: 28 Mar 2012, 21:45
by ClassyRain
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.

Re: IP Info for admins <mod>

PostPosted: 29 Mar 2012, 00:57
by qreeves
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

Re: IP Info for admins <mod>

PostPosted: 29 Mar 2012, 01:13
by Gingerbear
OOOO Registration system :) Still think it would be cool for admins/auths to get an IP using someones cn

Re: IP Info for admins <mod>

PostPosted: 31 Mar 2012, 01:12
by ClassyRain
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

Re: IP Info for admins <mod>

PostPosted: 31 Mar 2012, 09:52
by qreeves
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 :)

Re: IP Info for admins <mod>

PostPosted: 01 Apr 2012, 00:06
by ClassyRain
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.

Re: IP Info for admins <mod>

PostPosted: 01 Apr 2012, 06:26
by ClassyRain
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

Re: IP Info for admins <mod>

PostPosted: 01 Apr 2012, 10:03
by TheLastProject
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

Re: IP Info for admins <mod>

PostPosted: 01 Apr 2012, 16:35
by ClassyRain
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 :)