Results 1 to 9 of 9

Thread: getstatus source ip

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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
    Quote Originally Posted by v1rto View Post
    Hmm, so im a bit confused, can I use the cvar_t to define for example "sv_querywhitelist" and then use that in server config for example sv_querywhitelist "127.0.0.1 234.44.23.52 1.2.3.4"
    How would I then check that list against the source IP in libcod code, I also dont know if my current check is correct and performant, as I dont really know C++ well
    You can take a look at https://github.com/M-itch/libcod/blo...libcod.cpp#L52

    Mostly self-explaining, you get a reference to the cvar and can just compare the current IP with the list of cvar ips. I don't see a huge performance issue, but if needed, you could of course optimize it (mostly overcomplicating here).
    timescale 0.01

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

    v1rto (19th February 2023)

Posting Permissions

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