String over 255 characters
by Daniel Portugal de Lourenço · in Torque Game Builder · 09/01/2008 (4:45 pm) · 2 replies
Hello,
Does anybody know how to send strings from server to client and vice-versa with more than 255 characters?
I need to send a long string from my server to the clients, but the clients only receive the first 255 characters.
Oh, and I should send the string in one variable, not divided in many. It seems each variable holds a maximum of 255 characters when it is being sent over. I will probably need to edit some C++ files, right?
Can anyone give me directions?
Thanx!
Does anybody know how to send strings from server to client and vice-versa with more than 255 characters?
I need to send a long string from my server to the clients, but the clients only receive the first 255 characters.
Oh, and I should send the string in one variable, not divided in many. It seems each variable holds a maximum of 255 characters when it is being sent over. I will probably need to edit some C++ files, right?
Can anyone give me directions?
Thanx!
#2
I realized the chunks can also be sent in only one commandToClient, using parameters like %send1, %send2, etc (than it is possible not to use the verification, since all variables are being sent in one command). *Of course, if the string gets TOO big, it wouldn't work because too many parameters would be needed.
This IS dividing the string in many variables, but it might be better than raising the 255 capacity: 255 is FF in hex and to raise this number we need much more memory, I think (FFFF would be around 65000). In bin, FF demands 8 digits (11111111), but FFFF demands 16 (1111111111111111)! I'm definitely not sure, but I think it works this way.
So, thanks again!
09/02/2008 (10:25 am)
Thank you, Michael. It works!I realized the chunks can also be sent in only one commandToClient, using parameters like %send1, %send2, etc (than it is possible not to use the verification, since all variables are being sent in one command). *Of course, if the string gets TOO big, it wouldn't work because too many parameters would be needed.
This IS dividing the string in many variables, but it might be better than raising the 255 capacity: 255 is FF in hex and to raise this number we need much more memory, I think (FFFF would be around 65000). In bin, FF demands 8 digits (11111111), but FFFF demands 16 (1111111111111111)! I'm definitely not sure, but I think it works this way.
So, thanks again!
Torque 3D Owner Michael Chew
Not the most graceful way but it works for me. Hope this helps.