Page 2 of 2

Re: Help with Quake Bot

Posted: Sat Mar 15, 2014 9:34 pm
by Tremor
Ok so I managed to get it working. Turns out, my bot can connect to darkplaces, fte, and manquake and stay connected indefinitely as long as I spam some unreliables. However, and this is where I was messing up, proquake will still disconnect the bot. Unfortunately I don't have the proquake source code to examine, but I did manage to find in my packet captures that proquake sends an impulse 39 reliable message every 5 seconds. I spoke with r00k and he said that this was proquake's way of determining pings and such. He ended up giving me some insight on how Qrack handles this.. Essentially, the bot just needs to send an unreliable with the correct 'action time' in the form of a client movement order with an additional '39' as the impulse number. Upon doing this, my bot has remained connected to all proquake servers without issue.

Now, I just need to build upon this and add some code to handle map changes and afk timelimit disconnects. Thanks for all your help, guys!

Re: Help with Quake Bot

Posted: Tue Mar 18, 2014 2:03 pm
by r00k
proquake sends an impulse 39
You are using the word "proquake" in place of the mod 'CRMOD'... ;)

crmod sends a stuffcmd to the client

Code: Select all

							msg_entity = player;
							WriteByte (MSG_ONE, SVC_STUFFCMD);
							WriteString (MSG_ONE, "impulse 39\n");
which sends impulse 39 back to the server to update a timer that is used to determine AFK, or lagged out clients.

Re: Help with Quake Bot

Posted: Tue Mar 18, 2014 2:49 pm
by Spike
What's wrong with stuffcmd? :/

Re: Help with Quake Bot

Posted: Tue Mar 18, 2014 5:24 pm
by Tremor
r00k wrote:
proquake sends an impulse 39
You are using the word "proquake" in place of the mod 'CRMOD'... ;)

crmod sends a stuffcmd to the client

Code: Select all

							msg_entity = player;
							WriteByte (MSG_ONE, SVC_STUFFCMD);
							WriteString (MSG_ONE, "impulse 39\n");
which sends impulse 39 back to the server to update a timer that is used to determine AFK, or lagged out clients.
Ok so it's stuffcmd sent by the mod itself, not proquake. I guess I simply associated the problem with proquake because I was getting that stuffcmd when I connected to proquake servers running both crmod and cax. Also, prior to our conversation, I had not realized that some of these server messages required information back. As an example, I can get away with not recognizing the 'bright flash' command that the server sends.

Re: Help with Quake Bot

Posted: Wed Mar 19, 2014 7:08 am
by r00k
Spike wrote:What's wrong with stuffcmd? :/
Difference between reliable and unreliable msg?

Re: Help with Quake Bot

Posted: Wed Mar 19, 2014 12:41 pm
by Spike
both the builtin and MSG_ONE are reliable, and sent to one. qc has no unreliable unicast method.
thus the only practical reason to use writebytes for stuffcmds is if you want to write a single char at a time in order to work around the lack of support for strcat.

Re: Help with Quake Bot

Posted: Wed Mar 19, 2014 9:50 pm
by Tremor
Interesting. Seems like a decent enough solution and quite self-explanatory.. Pack a byte, append/concat it to the string. I suppose with strcat, you could do it directly.