Game Development Community

HTTPObject and TCPObject in ios

by Daniel Delp · in Torque 2D Beginner · 07/08/2013 (6:33 am) · 1 replies

TCPSockets are turned off by default in ios. For my game idea I plan to communicate with my server via HTTP quite frequently. The reason for turning off TCPSockets by default is not real clear in the code:

//-Mat this is a bit of a hack, but if we don't want the network, we shut it off now. 
     // We can't do it until we've run the entry script, otherwise the script variable will not have ben loaded
bool usesNet = false; //dAtob( Con::getVariable( "$pref::iOS::UseNetwork" ) );

After playing around for a bit I have come to the conclusion it is turned off because binding would require TCP hole punching when using IOS (or any situation where you can't port-forward for that matter). Is there more to it than that? Does anyone know if I will have any specific situational problems using HTTPObjects that I should test? I would be more than willing to share my changes, but as of now, the only reason I can see for having it disabled by default is so people don't assume they can listen while on iOS.

Any ideas/suggestions would be much appreciated.

#1
07/08/2013 (7:32 am)
Torque 2D/iTorque had disabled networking because it was not fully ported (or some such) and is not actually "supported". It works, but it's not set up for "real-time" networking (the game objects aren't set up to automatically send updates). You can use an event-based paradigm pretty easily but servers or master servers are up to you.