Hi Guys..,
Hope someone can help..
I am writing an "rcon" - "remote control" for COD4 (call of duty 4) game.
I have it working and receive data no problem when sending one command at a time.
so, the user clicks "connect" and the "sv_hostname" command is sent, the responce is...
------------
"sv_hostname" is: "Alien Containment Squad^7" default: "CoD4Host^7"
Domain is any text
-----------
I parse the text and get the hostname and place it on screen.
I also have setup timers where every x seconds (15 in my case) the rcon sends the "status" command to the game server and gets back a list of players with their score, so I parse the text file and add the player to a table and displayed on screen.
I can also send a message to player, kick players change to next map etc....
all works fine.
Now i want to get the rcon on connecting to issue multiple requests for informaiton...
e.g.
get sv_hostname - what is the server called
get g_gametype - gets the current game type
plus others....
but, the first command does not work... I have put this down to the command being sent too quickly and being ignored by the server, or similar.
I have tried to put a for..next loop in to add a delay before the next command is sent, even put a wait timeout 1 but still doesn't work.
I've also added a "commandInProcess" type property to .T. and a do..while loop... the property gets cleared to .F. from the getdata of the winsock object...
then the loop exits and the next command is sent.
I hope this makes sense....
It seems as if the commands are sent too quickly for winsock to action them, so it does the last one...
any ideas of how i can slow the commands down, but still let the winsock do what it needs to do.
Hope soemone can help.
Regards
Steve
only way i can think of is a command cue with a timer...hmmmm...
any help would be appreciated
Regards
Steve
Watch ya back, because some times the devil drives a minibus.
Hope someone can help..
I am writing an "rcon" - "remote control" for COD4 (call of duty 4) game.
I have it working and receive data no problem when sending one command at a time.
so, the user clicks "connect" and the "sv_hostname" command is sent, the responce is...
------------
"sv_hostname" is: "Alien Containment Squad^7" default: "CoD4Host^7"
Domain is any text
-----------
I parse the text and get the hostname and place it on screen.
I also have setup timers where every x seconds (15 in my case) the rcon sends the "status" command to the game server and gets back a list of players with their score, so I parse the text file and add the player to a table and displayed on screen.
I can also send a message to player, kick players change to next map etc....
all works fine.
Now i want to get the rcon on connecting to issue multiple requests for informaiton...
e.g.
get sv_hostname - what is the server called
get g_gametype - gets the current game type
plus others....
but, the first command does not work... I have put this down to the command being sent too quickly and being ignored by the server, or similar.
I have tried to put a for..next loop in to add a delay before the next command is sent, even put a wait timeout 1 but still doesn't work.
I've also added a "commandInProcess" type property to .T. and a do..while loop... the property gets cleared to .F. from the getdata of the winsock object...
then the loop exits and the next command is sent.
I hope this makes sense....
It seems as if the commands are sent too quickly for winsock to action them, so it does the last one...
any ideas of how i can slow the commands down, but still let the winsock do what it needs to do.
Hope soemone can help.
Regards
Steve
only way i can think of is a command cue with a timer...hmmmm...
any help would be appreciated
Regards
Steve
Watch ya back, because some times the devil drives a minibus.