Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by CG_Wang

I have a finished html5 game and I used websocket in it. Now I am thinking about porting it to IPad using Ejecta, but found out that no websocket could be used here.

So, I would like to ask that, did anyone have experience about using websocket in Ejecta, or have any ideas about how to make websocket working with Ejecta?

I would be appreciate it if someone could give some ideas.
Thanks.

1 decade ago by dominic

This will require some work, but it should be entirely doable.

SocketRocket seems to be a robust WebSocket implementation for Objective-C. You could probably hook this up to JavaScript with an EJBinding* class (as described here ) and provide all the functions from the API.

Edit: WebSockets are supported in Ejecta now. See: http://impactjs.com/ejecta/supported-apis-methods#websocket

1 decade ago by Slightfx

What did you find out dominic ? :)

1 decade ago by Philip

When I developed Steamclash I used websockets to test the whole thing a lot easier. Then I wrote some little code and got the networking done with gamekit, which helped a lot. But of course thats just for local networking. But it worked great. If this is what you want, you can find the code here: https://github.com/Houly/Impact-Network. Keep in mind that the code is over a year old. That means it's written for iOSImpact and iOS 5.

10 years ago by McFussyPants

I'm just getting started with Ejecta and my websocket html5 game. I would love to help test whatever there is. Or flail around and try to add SocketRocket to the mix myself.

10 years ago by McFussyPants

Has anyone had experience extending Ejecta?

I attempted to follow the instructions on http://impactjs.com/ejecta/extending-ejecta. I'm working with the latest pull from git-hub from yesterday.

I'm getting an error from javascript when trying the sample:

ReferenceError: Can't find variable: simpleTest at line 2 in js/test.js

Here's the source in case I made some mistake:
https://gist.github.com/tawnkramer/3deffb301cf8415701c7


Just letting you know, I'm attempting to integrate SocketRocket into Ejecta:
https://gist.github.com/tawnkramer/8c3dc6ad037df94402ad

connection = new Ejecta.SocketRocket();

causes an error:
TypeError: 'undefined' is not a constructor (evaluating 'new Ejecta.SocketRocket()') at line 117 in js/util.js

I'm an objective c newbie. So be kind.. :-) But I don't see anything substantially different from the other classes in there. If anyone has time to consider, I would appreciate an opinion.

thanks!

10 years ago by McFussyPants

Simple problem, the class prefix was Ej instead the required all caps EJ.

I have a working SocketRocket websocket now integrated in Ejecta! I'm so happy I will be able to roll over my multi player work. I wish it was compatible with Socket.io backend that I'm using. But that adds another layer on top of websockets that SocketRocket doesn't handle now. Still, happy to get it working any way I can.

I have committed the changes to the forked repo here:
https://github.com/tawnkramer/Ejecta

I would be happy to post some minimal example client and server code to get people started.

Dominic, if you are happy with these changes, how do I submit a pull request?
Page 1 of 1
« first « previous next › last »