Fortress Forever

Go Back   Fortress Forever > Projects > Fortress Forever > Feature

SayText message suggestion Issue Tools
issueid=193 07-27-2009 03:16 AM
QUAD ROCKET
SayText message suggestion

I have a suggestion to make the SayText message more efficient.

Right now it's being sent as:
PHP Code:
UserMessageBeginfilter"SayText" );
    
WRITE_STRING"hlstriker: Hello ^6Colored ^2Text!" ); // Text being sent
    
WRITE_BYTE); // Use color or not? - 0/1/67 (and 67 indicates server-console chat?)
MessageEnd(); 
Why is this inefficient?
1) There is no reason the players name should be included in the message.
2) The color codes "^1-9" should be replaced with hexadecimals before sending to the client.
3) The current 2nd argument should not even exist if it's only telling the client to use color or not (or is it to indicate player/server console?).

-----------------------------------------

How can it be improved?
1) Instead of including the players name in the string, let's add another WRITE_BYTE() to send the clients index.

Note: If 0 is sent here, don't add any name when displaying the chat.

2) Before sending the message, the color code characters should be replaced with hexadecimals.

Example: ^1 = \x01, ^2 = \x02, etc..
This will also prevent the color codes from showing in the console.

3) Add another WRITE_BYTE() for the type of chat.

Example:
WRITE_BYTE( 0 ) - Team chat unassigned.
WRITE_BYTE( 1 ) - Team chat spec.
WRITE_BYTE( 2 ) - Team chat blue.
WRITE_BYTE( 3 ) - Team chat red.
WRITE_BYTE( 4 ) - Team chat yellow.
WRITE_BYTE( 5 ) - Team chat green.
WRITE_BYTE( 6 ) - Send chat to everyone.
WRITE_BYTE( 7 ) - Sent from server console.

4) Use hexadecimals for players name color if it isn't already.

-----------------------------------------

The final result:
PHP Code:
UserMessageBeginfilter"SayText" );
    
WRITE_BYTEindex ); // Players index sending chat
    
WRITE_BYTEtype ); // Type of chat (Team/All/From server console).
    
WRITE_STRINGchat ); // What player typed only! (also replaced color codes to hex)
MessageEnd(); 
Issue Details
Issue Type Feature
Project Fortress Forever
Category General Game
Status Suggested
Priority 3
Suggested Version 2.3
Implemented Version (none)
Votes for this feature 3
Votes against this feature 0
Assigned Users Elmo
Tags (none)

07-27-2009 03:22 AM
FF Whiner
 
I approve! Now next time don't wake me in the middle of the night to get it :(
Let me sleep!! :(
Reply
07-30-2009 10:21 PM
 
If you want to come code for us just let me know :)
Reply
07-31-2009 06:05 AM
Community Member
 
He still needs practice with c++

"whips clowneh in the ass"
Reply
Reply

Issue Tools
Subscribe to this issue

All times are GMT. The time now is 08:30 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.