.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   new CS update screws up intercepting chat messages!? (http://forums.bots-united.com/showthread.php?t=1978)

stefanhendriks 16-06-2004 21:19

Re: new CS update screws up intercepting chat messages!?
 
no probs ;) will send the bill later :D

Whistler 17-06-2004 13:25

Re: new CS update screws up intercepting chat messages!?
 
[ double post is deleted ]

Whistler 17-06-2004 13:26

Re: new CS update screws up intercepting chat messages!?
 
...and it isn't just "#Cstrike_Chat_All", here's what I've found in the new cstrike_english.txt file, go figure them out yourself ;)
Code:

// Radio and chat strings can have control characters embedded to set colors.  For the control characters to be used, one must be at the start of the string.
// The control characters can be copied and pasted in notepad.
//  = 0x02 (STX) - Use team color up to the end of the player name.  This only works at the start of the string, and precludes using the other control characters.
//  = 0x03 (ETX) - Use team color from this point forward
//  = 0x04 (EOT) - Use location color from this point forward
//  = 0x01 (SOH) - Use normal color from this point forward

"Game_radio"                                        "%s1 (RADIO): %s2"
"Cstrike_Chat_CT"                                "(Counter-Terrorist) %s1 :  %s2"
"Cstrike_Chat_T"                                "(Terrorist) %s1 :  %s2"
"Cstrike_Chat_CT_Dead"                                "*DEAD*(Counter-Terrorist) %s1 :  %s2"
"Cstrike_Chat_T_Dead"                                "*DEAD*(Terrorist) %s1 :  %s2"
"Cstrike_Chat_Spec"                                "(Spectator) %s1 :  %s2"
"Cstrike_Chat_All"                                "%s1 :  %s2"
"Cstrike_Chat_AllDead"                                "*DEAD* %s1 :  %s2"
"Cstrike_Chat_AllSpec"                                "*SPEC* %s1 :  %s2"
"Cstrike_Name_Change"                                "* %s1 changed name to %s2"


Whistler 18-06-2004 00:39

Re: new CS update screws up intercepting chat messages!?
 
well, I think catching the chat messages in ClientCommand() DLL function may be a good idea, and that should work in any versions of HL/CS/OP4 and whatever MOD. Just catch the "say" and "say_team" command and use pfnCmd_Args() to get the text.

Pierre-Marie Baty 18-06-2004 02:11

Re: new CS update screws up intercepting chat messages!?
 
Probably yes, but you would have to take care of who receives what yourself, then.

stefanhendriks 18-06-2004 08:35

Re: new CS update screws up intercepting chat messages!?
 
i got word of turtlerock about the exact format:

Quote:

The SayText message changed to allow for localization, and place names. Before, it looked like this, where the first character of 'text' was 0x02, and it included the player name and chat text:

Code:

MESSAGE_BEGIN( MSG_ONE, gmsgSayText, NULL, client->pev );
 WRITE_BYTE( ENTINDEX( pEntity ));
 WRITE_STRING( text );
MESSAGE_END();

Now, the message is constructed like this:

Code:

MESSAGE_BEGIN( MSG_ONE, gmsgSayText, NULL, client->pev );
 WRITE_BYTE( ENTINDEX( pEntity ));
 WRITE_STRING( pszFormat );
 WRITE_STRING( "" ); // will be filled in with player name
 WRITE_STRING( text );
 if ( placeName )
 {
  WRITE_STRING( placeName );
 }
MESSAGE_END();

The format string (pszFormat above) is something like "#Cstrike_Chat_CT", so if you are doing a strstr() for the player name in that string and not NULL checking, you would now crash. I don't have the RealBot source, so I can't tell if that's the problem or not.

Please let me know if this helps or if you need more info.

Matt Campbell



@$3.1415rin 18-06-2004 10:45

Re: new CS update screws up intercepting chat messages!?
 
thx to stefan for that info :D

minorgod 18-06-2004 17:34

Re: new CS update screws up intercepting chat messages!?
 
Stefan, I copied your bug fix and recompiled, but there's still some problem with the bot on Linux. It seems to work fine until you get about 6 bots on the server. Then suddenly, the human players start pinging over 300. Each additional bot increases the ping and it quickly becomes unplayable. I actually tried commenting out the entire contents of the BotClient_CS_SayText function, but that had no effect, so I think the problem lies elsewhere.

stefanhendriks 18-06-2004 23:25

Re: new CS update screws up intercepting chat messages!?
 
perhaps its in the debugging info. Did you try my new CVS updated source? (btw, post about this on the RealBot Source forum)

cruft 20-06-2004 23:41

Re: new CS update screws up intercepting chat messages!?
 
Does anyone know if the UTIL_SayText utility function must also be revised to the new message format?


All times are GMT +2. The time now is 13:47.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.