Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » 3.4.4 Send_Message_Player Disconnect
3.4.4 Send_Message_Player Disconnect [message #419306] Sat, 06 February 2010 12:17 Go to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
In scripts 3.4.4, if you send a string of more than 238 chars it will cause the receiving client to lose their connection (Or possibly all clients, this has only been tested during 2v2).
239 = disconnect, 238 = works

Just though you guys would want to know.


Re: 3.4.4 Send_Message_Player Disconnect [message #419316 is a reply to message #419306] Sat, 06 February 2010 16:12 Go to previous messageGo to next message
dr3w2 is currently offline  dr3w2
Messages: 485
Registered: September 2006
Location: Ottawa,Canada
Karma: 0
Commander
Just to add to this, to my recollection this does actually crash the server. If you do a !msg with this length of characters the actual FDS restarts

n00bstories Server Administrator
Re: 3.4.4 Send_Message_Player Disconnect [message #419321 is a reply to message #419306] Sat, 06 February 2010 18:31 Go to previous messageGo to next message
GEORGE ZIMMER is currently offline  GEORGE ZIMMER
Messages: 2605
Registered: March 2006
Karma: 0
General (2 Stars)
Yeah, would be nice to see certain things like this being un-capped, or atleast set to a really high number.

Toggle Spoiler
Re: 3.4.4 Send_Message_Player Disconnect [message #419326 is a reply to message #419316] Sat, 06 February 2010 21:06 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
andr3w282 wrote on Sat, 06 February 2010 16:12

Just to add to this, to my recollection this does actually crash the server. If you do a !msg with this length of characters the actual FDS restarts

Well it kicks everyone, so does it crash or just start a new map?


Re: 3.4.4 Send_Message_Player Disconnect [message #419347 is a reply to message #419306] Sun, 07 February 2010 10:50 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

There are several issues with long messages. First the message length can't exceed 0x100 = 256 characters. (you probably found 238 because there are additional headers prepended or w/e). Additionally the total packet (packet type, message type, sender, message, etc.) can not exceed 548 bytes. I think messages are sent as wide char strings, meaning the total message length can still not exceed 274-(1/2 bytes needed for additional headers) characters even if we enlarge the 0x100 limit. This means the extra space gained by doing so would be marginal. Lifting the 548 is atm not possible afaik, because we do not own all places that touch packets. Cloning all these is probably a lot of work.

Best we can do atm is probably to avoid clients crashing when these messages are sent, or avoid sending messages of this length at all.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: 3.4.4 Send_Message_Player Disconnect [message #419349 is a reply to message #419347] Sun, 07 February 2010 12:48 Go to previous messageGo to next message
dr3w2 is currently offline  dr3w2
Messages: 485
Registered: September 2006
Location: Ottawa,Canada
Karma: 0
Commander
StealthEye wrote on Sun, 07 February 2010 17:50

There are several issues with long messages. First the message length can't exceed 0x100 = 256 characters. (you probably found 238 because there are additional headers prepended or w/e). Additionally the total packet (packet type, message type, sender, message, etc.) can not exceed 548 bytes. I think messages are sent as wide char strings, meaning the total message length can still not exceed 274-(1/2 bytes needed for additional headers) characters even if we enlarge the 0x100 limit. This means the extra space gained by doing so would be marginal. Lifting the 548 is atm not possible afaik, because we do not own all places that touch packets. Cloning all these is probably a lot of work.

Best we can do atm is probably to avoid clients crashing when these messages are sent, or avoid sending messages of this length at all.

Makes sense to me and yeah I doubt that would be worth the trouble at all. Go with the check the length before executing Big Ups


n00bstories Server Administrator
Re: 3.4.4 Send_Message_Player Disconnect [message #419354 is a reply to message #419347] Sun, 07 February 2010 14:24 Go to previous messageGo to next message
GEORGE ZIMMER is currently offline  GEORGE ZIMMER
Messages: 2605
Registered: March 2006
Karma: 0
General (2 Stars)
StealthEye wrote on Sun, 07 February 2010 11:50

There are several issues with long messages. First the message length can't exceed 0x100 = 256 characters. (you probably found 238 because there are additional headers prepended or w/e). Additionally the total packet (packet type, message type, sender, message, etc.) can not exceed 548 bytes. I think messages are sent as wide char strings, meaning the total message length can still not exceed 274-(1/2 bytes needed for additional headers) characters even if we enlarge the 0x100 limit. This means the extra space gained by doing so would be marginal. Lifting the 548 is atm not possible afaik, because we do not own all places that touch packets. Cloning all these is probably a lot of work.

Best we can do atm is probably to avoid clients crashing when these messages are sent, or avoid sending messages of this length at all.

Would it be possible to check the length, and if it's too big, cut it into several messages?


Toggle Spoiler
Re: 3.4.4 Send_Message_Player Disconnect [message #419358 is a reply to message #419354] Sun, 07 February 2010 15:15 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
GEORGE ZIMMER wrote on Sun, 07 February 2010 15:24

StealthEye wrote on Sun, 07 February 2010 11:50

There are several issues with long messages. First the message length can't exceed 0x100 = 256 characters. (you probably found 238 because there are additional headers prepended or w/e). Additionally the total packet (packet type, message type, sender, message, etc.) can not exceed 548 bytes. I think messages are sent as wide char strings, meaning the total message length can still not exceed 274-(1/2 bytes needed for additional headers) characters even if we enlarge the 0x100 limit. This means the extra space gained by doing so would be marginal. Lifting the 548 is atm not possible afaik, because we do not own all places that touch packets. Cloning all these is probably a lot of work.

Best we can do atm is probably to avoid clients crashing when these messages are sent, or avoid sending messages of this length at all.

Would it be possible to check the length, and if it's too big, cut it into several messages?


what do you mean several msgs.


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: 3.4.4 Send_Message_Player Disconnect [message #419372 is a reply to message #419358] Sun, 07 February 2010 17:56 Go to previous messageGo to next message
TruYuri is currently offline  TruYuri
Messages: 97
Registered: June 2008
Karma: 0
Recruit
Gen_Blacky wrote on Sun, 07 February 2010 17:15


what do you mean several msgs.


User types:
"this message is too long"

Game displays:
"this message is too "
"long"
Re: 3.4.4 Send_Message_Player Disconnect [message #419390 is a reply to message #419372] Sun, 07 February 2010 21:32 Go to previous messageGo to next message
GEORGE ZIMMER is currently offline  GEORGE ZIMMER
Messages: 2605
Registered: March 2006
Karma: 0
General (2 Stars)
TruYuri wrote on Sun, 07 February 2010 18:56

Gen_Blacky wrote on Sun, 07 February 2010 17:15


what do you mean several msgs.


User types:
"this message is too long"

Game displays:
"this message is too "
"long"

Exactly.


Toggle Spoiler
Re: 3.4.4 Send_Message_Player Disconnect [message #419402 is a reply to message #419306] Mon, 08 February 2010 02:00 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

yes it can be done quite easily.

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: 3.4.4 Send_Message_Player Disconnect [message #419404 is a reply to message #419306] Mon, 08 February 2010 03:27 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

That's up to the (user/)bot. There are multiple ways to split messages up, such as

Host: (StealthEye@IRC) This message is ...
Host: ... too long.

or

Host: (StealthEye@IRC) This message is too
Host: (StealthEye@IRC) long.

or some combination or whatever. It may even be necessary to avoid misinterpretation such as

"This message is too !kick blah"
Host: (StealthEye@IRC) This message is too
Host: !kick blah

We'll leave it up to the bot to determine the preferred split style. We will most likely only fix the crashes.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: 3.4.4 Send_Message_Player Disconnect [message #419588 is a reply to message #419404] Wed, 10 February 2010 09:22 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
I just say you guys make the function go though something like this.
void Send_Message_Player(GameObject *o,float red,float green,float blue,const char *msg);
{
    Text[238]; 
    sprintf(Text,"%s",msg);
    *DisplayToPlayerCode*(Text);
}

I'd assume you guys would fix the problem with something simple like that, but really have no clue as bhs.dll isn't open source.


[Updated on: Wed, 10 February 2010 09:22]

Report message to a moderator

Re: 3.4.4 Send_Message_Player Disconnect [message #419591 is a reply to message #419306] Wed, 10 February 2010 10:37 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

We would probably fix it on a lower level, at the netcode level where this bug is actually caused. It's likely that we will simply cut it off at the maximum amount of characters rather than splitting it or blocking it entirely since this is much easier at this level. We should do it low level because Send_Message_Player is definitely not the only function suffering from the same bug.

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: 3.4.4 Send_Message_Player Disconnect [message #419621 is a reply to message #419306] Wed, 10 February 2010 16:23 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

hmm i might be getting this, could this be caused by too many messages being sent to server at same time?

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: 3.4.4 Send_Message_Player Disconnect [message #419681 is a reply to message #419621] Thu, 11 February 2010 08:44 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Sladewill wrote on Wed, 10 February 2010 16:23

hmm i might be getting this, could this be caused by too many messages being sent to server at same time?

Right now its going to be a message size issue more then a number, beings I first noticed the issue in 1vs1 lan, it would have only been sending the message to 1 other player. If it was a number of messages issue, every server would crash when a message was sent with any number of players. If it was a number of players issue combined with message size, then as you got more players in game you would have to make the message shorter and shorter in order to not disconnect the clients. To my knowledge this is not the case 238 is the length needed to disconnect the clients regardless how many players are in game.


Re: 3.4.4 Send_Message_Player Disconnect [message #419684 is a reply to message #419306] Thu, 11 February 2010 09:38 Go to previous message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

Pretty close, but again, 238 is not the limit. Depending on the color it may be larger than that. The real limit is 256, but consider the following overhead:

256 -
10 bytes default overhead
1-3 bytes for red
1-3 bytes for green
1-3 bytes for blue

The color components are sent as string, therefore 0-9 take 1 byte, 10-99 take 2 and 100-255 take 3. If you write a message in black, you will therefore have a higher "message limit". Wink

It would be safest not to send messages longer than 256-10-3-3-3 = 237 bytes. Although apparently 238 worked for you, it is not guaranteed to work in every situation, therefore you best avoid sending messages longer than 237 bytes.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Previous Topic: Direct Connection
Next Topic: Server Side Mods
Goto Forum:
  


Current Time: Mon Nov 04 03:10:23 MST 2024

Total time taken to generate the page: 0.00985 seconds