Game Development Community

Enable networking for iOS devices

by Kent Vasko · in iTorque 2D · 03/30/2012 (7:06 am) · 6 replies

Thought I would move this question to the proper section.

I am using the TCPObject to create an SMTP client so a message can be sent from an app.

It works great in TGB, but in iTGE 1.5 it does not work because networking is disabled.

I have tried "manually" enabling networking by setting the device to use networking in defaultPrefs.cs. The following line is what I attempted:
$pref::iDevice::UseNetwork = true;

That did not work.

So, is it possible to enable networking in iTGE 1.5? If so, what am I missing?

Any help would be much appreciated.

Thanks.

#1
03/31/2012 (1:15 am)
No its not possible as networking was removed in 1.5. Its not that its 'disabled', it was removed completely because it was never written for iOS, it was just there from TGB (win / osx) and happened to work somewhat, but without support for basic things like GameKit (for adhoc matchmaking) and similar and without a master server infrastructure available for iT2D it never made any sense to exist
#2
03/31/2012 (7:46 am)
If you are comfortable with C++ you could always integrate a library like POCO to do your networking. It has an easy interface and you would just need to expose it to script.

Here are some instructions on building POCO for iOS - pocoproject.org/forum/viewtopic.php?f=12&t=4844
#3
04/02/2012 (9:38 am)
Thanks for the replies.

Will definitely give POCO a shot.
#4
04/18/2012 (9:20 am)
@Kent - Sorry I could not reply sooner. I'm the iTorque 2D guy, but I was away for two weeks on paternity leave. There are three potential networking situations:

1. Turn-based game between friends/local players
2. Real-time networking game between friends/local players
3. Net commands for sending/receiving data, such as gathering info from a website

We already have a solution readily available for #1. It uses the iOS GameKit's turn-based networking API. It is a free resource, which can be found here: Turn-based Networking in iT2D

#2 is a lot more problematic. This requires more than just hacking GameKit. T2D/iT2D are equipped to handle turn-based, but only our 3D engines (TGE, TGEA, T3D) have real-time ready out of the box. We have an R&D branch with prototype real-time code, but it was only for Windows. This was literally a port of the T3D networking. If we can get that retrofitted for iT2D, it would be trivial to hook up GameKit's real-time networking API. It's neither trivial nor impossible.

#3 was essentially what was removed. It was removed because it was not being QA'd or documented, which makes me very nervous. I'd rather remove broken/unusable code, rather than leave it in and mislead developers. It would only take a couple of days to get it running with real iOS API calls. It would actually be very simple to reimplement, but with proper iOS calls.

All of the above are geared toward a custom implementation embedded in the engine. POCO is a 3rd party networking library I keep hearing about. I'm very interested in researching it to see if it can speed up the process of networking iT2D.

Again, sorry for the delayed response. Being a new dad consumed all of my attention, so I'm still catching up on all the iT2D posts. I'm happy to answer any further questions you might have.
#5
04/18/2012 (9:24 am)
Hey, no worries. Taking care of family is far more important. Besides, I figured it out on my own eventually.

I got POCO setup a few days ago (took me longer than it should have to incorporate the libraries properly) and successfully implemented an SMTPClient into my project.

So, my app is sending emails happily now.

Thanks for all this information, though.
#6
04/18/2012 (9:34 am)
@Kent - Gah, I should have read your post more thoroughly and zeroed in on SMTP. Simple messaging didn't require a lengthy reply about game networking. I'm glad POCO solved the issue for you. Still, the offer stands if you have any further questions. My e-mail is also in my profile if you require direct communication.