hi just want to get those information from my server.
i tried with server_spawn event but port and address return 0 or None for me!
any suggestions
Thanks.
-qwexvf
anyway that i can get IpAddress and Port etc in cs:go?
Re: anyway that i can get IpAddress and Port etc in cs:go?
I won't comment on the git issue, since it's about not using hostip, but using that's been the most robust way for me.
Syntax: Select all
ip = ipaddress.IPv4Address(ConVar("hostip").get_int() & 0xffffffff).exploded
host = ConVar("hostport").get_int()
Re: anyway that i can get IpAddress and Port etc in cs:go?
I honestly don't like the idea of using ConVars, in this instance, because their values are easily changed. But, that does certainly work if you aren't worried about that issue.
Re: anyway that i can get IpAddress and Port etc in cs:go?
satoon101 wrote:I honestly don't like the idea of using ConVars, in this instance, because their values are easily changed. But, that does certainly work if you aren't worried about that issue.
I feel the same way about querying a remote host for it, it could go down, possibly locking up your plugin, imo even worse. But to each their own I suppose. :3
Re: anyway that i can get IpAddress and Port etc in cs:go?
Doldol wrote:I won't comment on the git issue, since it's about not using hostip, but using that's been the most robust way for me.Syntax: Select all
ip = ipaddress.IPv4Address(ConVar("hostip").get_int() & 0xffffffff).exploded
host = ConVar("hostport").get_int()
thanks both of you for helping me out <3
this one works pretty well! i just was wondering if it there will be any problems running multiple instances.
by running multiple instance will this work?
Re: anyway that i can get IpAddress and Port etc in cs:go?
The ConVar solution doesn't seem to work reliably for the port:
You better use this:
However, if you are starting your instances with different +hostport options, Predz code will work fine.
Code: Select all
Socket bound to non-default port 27016 because original port was already in use.
WARNING: Port 27015 was unavailable - bound to port 27016 instead
Socket bound to non-default port 27006 because original port was already in use.
WARNING: Port 27005 was unavailable - bound to port 27006 instead
Socket bound to non-default port 27021 because original port was already in use.
WARNING: Port 27020 was unavailable - bound to port 27021 instead
Network: IP 192.168.178.60, mode MP, dedicated Yes, ports 27016 SV / 27006 CL
hostport
"hostport" = "27015"
- Host game server port
sp plugin reload test3
[SP] Unloading plugin 'test3'...
[SP] Unable to unload plugin 'test3' as it is not currently loaded.
[SP] Loading plugin 'test3'...
27016
[SP] Successfully loaded plugin 'test3'.
Syntax: Select all
from engines.server import server
print(server.udp_port)
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 126 guests