06-14-2010, 11:25 PM
Is there any way to get the following details about the running server you're playing / scripting on:
- port
- ip
- maxplayers
For linux I have found a solution in python-eventscripts, search for these values in the startup string, which is available.
For windows this however is not a safe aquisition to make as it is not present. A fix for the windows is getting the port from the hostport cvar but this isn't always set.
On mac I have no idea but I suppose it'll be the same as linux.
Is there a consistent platform independant way to get these data?
If not, how do I get it on windows?
I have access to all server vars through python-eventscripts. I can also execute server commands and grasp the output, but prefer not to do the latter, as it is unsafe/buggy in py-es.
- port
- ip
- maxplayers
For linux I have found a solution in python-eventscripts, search for these values in the startup string, which is available.
For windows this however is not a safe aquisition to make as it is not present. A fix for the windows is getting the port from the hostport cvar but this isn't always set.
On mac I have no idea but I suppose it'll be the same as linux.
Is there a consistent platform independant way to get these data?
If not, how do I get it on windows?
I have access to all server vars through python-eventscripts. I can also execute server commands and grasp the output, but prefer not to do the latter, as it is unsafe/buggy in py-es.