Raised This Month: $51 Target: $400
 12% 

"SayText" User message does not always work inside Fortress Forever


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
taansari
Member
Join Date: Nov 2011
Old 03-05-2012 , 02:28   "SayText" User message does not always work inside Fortress Forever
Reply With Quote #1

Hi!

I'm working on my plug-in, which is capable of sending messages from server to all the players connected with it (chat area type messages). I've made it work for HL2DM, TF, and also for Fortress Forever (locally).

I have faced a strange problem though, if I deploy my plug-in on a remove server, it works perfectly, but other client(s) connected with this remote server are unable to see server dispatched message (and this happens only with Fortress Forever). For details kindly review my message sending code:

Code:
void TestPlugin::setmsg(const char *str)
{
    char *message;
    bf_write *msg;
    MRecipientFilter mrf(engine, playerinfomanager, helpers);
    int numSay = g_SMAPI->FindUserMessage("SayText");
    int flen = strlen(str)+6;
    message = (char*) malloc(flen);
    memset(message,0,flen);
    sprintf(message, " %s\n", str);
    mrf.AddAllPlayers(MaxClients);
    msg = engine->UserMessageBegin((IRecipientFilter *)&mrf, numSay);
    msg->WriteString(message);
    msg->WriteByte(3);
    msg->WriteByte(0);
    engine->MessageEnd();
    free(message);
}
What is further funny is that this message displays sometimes (some very rare exceptions are there). In all my local tests, this problem was never produced.

Can someone kindly guide what could be going wrong?

Thanks for your time...
taansari is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-05-2012 , 11:25   Re: "SayText" User message does not always work inside Fortress Forever
Reply With Quote #2

The SayText format for Fortress Forever is different. I ran into that a couple of years ago.

http://code.google.com/p/hlstatsxcom...statsx.sp#2077

BYTE - Index of client sending the message.
STRING - The message.
BYTE - 0 / 1 - Disable/enable FF (^) color parsing.
psychonic is offline
taansari
Member
Join Date: Nov 2011
Old 03-06-2012 , 01:52   Re: "SayText" User message does not always work inside Fortress Forever
Reply With Quote #3

Quote:
Originally Posted by psychonic View Post
The SayText format for Fortress Forever is different. I ran into that a couple of years ago.

http://code.google.com/p/hlstatsxcom...statsx.sp#2077

BYTE - Index of client sending the message.
STRING - The message.
BYTE - 0 / 1 - Disable/enable FF (^) color parsing.
Many thanks for your prompt reply - your suggestion has nailed this problem down for good!

Kind regards!
taansari is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode