1. it is possible get a real public ip address of game server?
     
  2. Wulf

    Wulf Community Admin

    Yes, you'd need to call out to a site using a web request to return the IP, or query Steam.
     
  3. oxide ensure the request is making with the same network interface that the server is running?
     
  4. Wulf

    Wulf Community Admin

    The request is made from the server, so whatever interface the server is using.
     
  5. Would using this not work? Or am I relating to something else. As this is what I use in a plugin of mine.
    Code:
    using ConVar;
    ConVar.Server.ip 
     
  6. Wulf

    Wulf Community Admin

    No, that will never have the public IP for any server where +server.ip isn't set. So basically all self-hosted or any that use 0.0.0.0.
     
  7. this method only allows access to a local address of network interface
     
  8. Wulf

    Wulf Community Admin

    If you'd like some web request examples, take a look at CountryBlock, SteamProfiler, etc. You can use sites such as https://api.ipify.org.
     
  9. thx, my plugin makes requests to my own api service, so I just take ip from request ;)
     
  10. Fastest solution as short example:
    Code:
    using Rust;        void OnServerInitialized()
            {
                var publicIP = Global.SteamServer.PublicIp.ToString();
                Puts($"Public IP is '{publicIP}'");
            }
     
  11. Wulf

    Wulf Community Admin

    Just keep in mind that the IP isn't always available at that point, but should be. If the server is unable to register with Steam, it also won't be available.