Game Development Community

Reading in XML string from a tcp socket

by Tony A · in Torque Game Builder · 07/27/2008 (10:46 pm) · 1 replies

Hi all,

I am hoping someone can help with this and point me in the right direction. I am using TorqueScript in order to read in an XML string message (about 16K is size) sent from a JAVA server via a socket. My TGB game crashes when it receives the string. I am wondering if there is a limit on how long a string can be in TorqueScript. I had no problem receiving short strings (tested with 45 characters).

Your suggestions/comments are always appreciated!!

#1
07/28/2008 (5:24 pm)
After further looking into the engine source code, I found that StringUnit limits the returnBuffer size to 1024 bytes. When I run my game in debug mode (using Visual Studio), I get an assertion fail because the string I am setting has a length greater than returnBuffer, however when I run the game in Torsion, it simply crashes. Can't explain why the game behaves differently in different environments.

I wonder if the size of returnBuffer can be increased without side effects.

Hopefully, someone will notice this thread ;) and comment ..

Thanks.