Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: IP address

  1. #1
    ... connecting
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IP address

    Hi!
    I would like to get the server's IP address in the scripts.
    Is it possible?
    Nyaa.

  2. #2
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Code:
    level.local["ip"] = getCvar("net_ip");
    level.local["port"] = getCvar("net_port");
    Should work i think.
    Last edited by Earliboy; 25th February 2013 at 15:41.
    No ... No ... this is not possible .......

  3. #3
    ... connecting
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much.

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    net_ip is default "localhost", so it only works when the ip is set at server start: +set net_ip 1.2.3.4

    The problem is: then it can also be written directly in the script.
    timescale 0.01

  5. #5
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Is there any way to get a player's IP address? I want to create a list of banned IPs and disconnect if player's IP matches it.
    I can't have PB on and can't use server admin programs 24/7 (sry to revive this old thread, I don't wanna start a whole new one).
    set logfile 2

  6. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Reviving threads is perfectly fine

    libcod and

    PHP Code:
    playet std\player::getIP();
    playet std\player::getPing(); 
    timescale 0.01

  7. The Following User Says Thank You to kung foo man For This Useful Post:

    guiismiti (28th December 2013)

  8. #7
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Yea, I thought there would be no way without libcod.
    set logfile 2

  9. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Hm, I know you have some stock hosting, but why don't you just switch to a Vserver? You have full root on such a machine and it's not that expensive (maybe even less).
    timescale 0.01

  10. #9
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I'm brazilian, there are currently 2 active hosts here. If I hire north-american / european hosts my ping will be over 200.
    I said I couldn't install libcod but the host company is little, server runs on Linux and the guy from xfire support asks me how the server is every day. The problem is I don't think I know enough to install it, and, probably, neither do them. But will still talk to them this weekend about it.

    @topic - if I manage to install libcod, will try to ban an IP range. Just read that it's possible to use substring(string, startpos, length) in QuakeC.
    set logfile 2

  11. The Following User Says Thank You to guiismiti For This Useful Post:

    kung foo man (28th December 2013)

  12. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Ive made a getcountry() function, which might also interest you

    That way you can only allow brazillian connections or w/e

  13. The Following User Says Thank You to IzNoGoD For This Useful Post:

    guiismiti (28th December 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •