Game Development Community

The NULL character and scripting

by Sky Frostenson · in Torque Game Engine · 05/16/2005 (4:53 pm) · 2 replies

I'm working with a network protocol that terminates commands through the use of the NULL character. I was wondering if it was possible for me to append such a character on to the end of a string in torque script. That is, I'm building a string that forms my command that I will be sending over the network. I need to add the NULL character (0x00) on to the end of the string so that the server can tell when it has received the whole command.

Thanks!

#1
05/16/2005 (11:40 pm)
How are you communicating with your network protocol? TCPObject? If so, you might consider adding a method that will send a string _WITH_ the NULL at the end, rather than dropping it (as is usual protocol).
#2
05/17/2005 (11:16 am)
I am using a TCPObject. So you are suggesting that I add a function to the engine which does not drop the NULL character from the end of a string? Or is this something that could be done entirely at the script level?