Code works in preview, but not on server?

Get help using Construct 2

Post » Sat May 25, 2013 12:48 am

I have a prototype I'm working on for real-time chat using Sockets.. I have the node server up and running

When I run the preview mode, eveyething works great, but when I upload it to the server, I get JS errors... what's wrong?

The exported version


[IMG]http://renegew.com/c2/chat/preview.png[/IMG
B
6
Posts: 35
Reputation: 370

Post » Sat May 25, 2013 12:48 am

B
6
Posts: 35
Reputation: 370

Post » Tue May 28, 2013 2:20 pm

It looks like you're using the SocketIO plugin. Perhaps it's broken by the minification on export. Try unticking 'minify script' when exporting.

You could just use the built-in WebSocket object, which is tested and works with the minifier.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,498

Post » Tue May 28, 2013 5:00 pm

@JoshWegener, My socket.io project works fine, but only on chrome right now.
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Wed May 29, 2013 3:59 am

@Ashley That did not fix it :-( The errors are gone, now the events are not working (when on the server)

I like the socket.io due to it's fallback options and cross browser performance. And also the emit function...

@breackzin I'm going to release my plugin soon, and it should work fine across all browsers that socket.io supports.
B
6
Posts: 35
Reputation: 370

Post » Wed May 29, 2013 4:56 am

Here is a video if that helps...

Odd...
B
6
Posts: 35
Reputation: 370

Post » Wed May 29, 2013 8:08 pm

@JoshWegener i am sorry but i could not say i know what is happening.

If i were you i would probably try to use less functions and test in other browser.breackzin2013-05-29 20:08:51
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Wed May 29, 2013 8:32 pm

I talked with Ashley a little bit... I think it's my plugin... not an construct 2 error / bug... I might just switch over to built in WebSocket object and try it that way.

Then instead of using Node.js I will use PHP Socket lib for server side... (I like that much better then JS any ways)... I just hope it's as fast.

I need the game to be quick! I'm trying to do all server side validation to stop the user(s) from cheating in the game... including collision detection...
B
6
Posts: 35
Reputation: 370


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests