Hello Brian,
Tuesday, October 7, 2003, 5:52:39 AM, you wrote:
>> >
>> > So I'm adding my own query api to the server via a engine->hook->mod
>> > deal... I want to grab info like map, hostname, ip, port etc like the
>> > SERVER PROTOCOL from the SDK allows. So I used pfnCVarGetString("ip") to
>> > grab some of this stuff like the server hostname and port and mp_timeleft
>> > but when I put ip in I get "localhost" back. I know there is a +ip deal
>> > for command line start but I've never used it on my server and my server
>> > knows it is a 216.blah address when doing a status from console. How do I
>> > access the IP address that is listed in the status command? setting ip via
>> > console will allow me to get correct IP via the pfnCVarGetString but it
>> > seems there has to be another way that the engine gets the IP... Anyone
>> > know?
>>
>>
>> Ok this is REALLY weird... My command line to start up includes -port
>> 27016 but pfnCVarGetString("port") returns 27015 for that server unless I
>> add
>>
>> port 27016
>>
>> to my server.cfg. Problem is I that cvar is not set until AFTER my socket
>> is created... I'm trying to use pfcCVarGetString to set a socket port
>>
>> ie port + 3000
>>
>> this is being done because I have two mods running from SAME directory so
>> I need a dynamic way to allocate the port. So I figured hlport + 3000
>> would be a good way to do this...
>>
>> Alred Reynolds told me that I could get IP and Port of the server by using
>> this method but its not working, ie localhost and 27015 no matter what???
>>
>> It is -port and not +port right?
BAS> I love answering myself...
BAS> Alfred you were WRONG shame on you ;)
BAS> Its hostport not port...
BAS> Does this guy work at valve or what hehe :D
I am newbie here and dont know how to HL work, but maybe this can
help:
Is pfnCVarGetString("port") the client or the server port?
Every client that connect (0,1,2...) will receive is own port. Client
0 will receive port n, Client 1 will recive port n+1, etc...
Maybe you ask for client port, not server port. To debug this can be
better to do the testing with a dedicated server, not a loopback :D
Anyway remenber that status, cl_messages, dedicated and condebug where
your friends.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders