Yet-another Multiplayer Demo (with capx)

Show us your completed creations made in Construct 2

Post » Wed Apr 04, 2012 4:06 pm

[QUOTE=juantar] @istanto did you get this error with the new version? I saw that problem and I though I fixed it in the latest release. It was a problem with the code in the example_server.js file (I was not using the broadcast method in the socket).[/QUOTE]

Yes this error on your new version package, I download socket-io-mod.zip today from http://sites.google.com/site/jptarqu/downloads to learn the code inside it. I believe nothing wrong inside your code, it's not out from my logic.. if I'm not wrong socket.broadcast.emit mean packet sent to global except the sender, but it's strange.. why only old player can see new player.. any enlightenment will really help me, I need to fix this bug to start something very soon.

Regards
B
3
Posts: 5
Reputation: 310

Post » Thu Apr 05, 2012 12:13 am

@istanto : It was a silly mistake, I was calling the my splice function with the wrong index in the plugin code *facepalm*. I tested it in my machine and it works. I put a new version out there, please download this latest version and let me know if it works for you.
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Thu Apr 05, 2012 3:33 am

[QUOTE=juantar] @istanto : It was a silly mistake, I was calling the my splice function with the wrong index in the plugin code *facepalm*. I tested it in my machine and it works. I put a new version out there, please download this latest version and let me know if it works for you. [/QUOTE]

still not works... new player can't see old player, old player can see new player. I try on chrome, firefox and opera

regards   

istanto2012-04-05 03:45:02
B
3
Posts: 5
Reputation: 310

Post » Thu Apr 05, 2012 3:54 pm

@istanto can you please open in notepad the following file in your construct2 folder:

exporters\html5\plugins\socket-io\runtime.js

At the end of the file there should be function called get_last_data at around line 179, can you please copy and paste those lines or take a screenshot of them?

Thanks!
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Fri Apr 06, 2012 1:12 pm

[QUOTE=juantar] @istanto can you please open in notepad the following file in your construct2 folder:

exporters\html5\plugins\socket-io\runtime.js

At the end of the file there should be function called get_last_data at around line 179, can you please copy and paste those lines or take a screenshot of them?

Thanks![/QUOTE]

     function get_last_data(dataStack)
     {
          var dataLength = dataStack.length;
          
          var data = "";
          if (dataLength > 0) {
              data = dataStack[0];
              jpt_splice(dataStack, 1);
          }
          return data;
     }

regards
B
3
Posts: 5
Reputation: 310

Post » Fri Apr 06, 2012 2:57 pm

@istanto i think you still have the old version because the line that says

jpt_splice(dataStack, 1);

Uses a zero instead of a one in the new version, so it looks like this:

jpt_splice(dataStack, 0);

thanks
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Fri Apr 06, 2012 6:52 pm

Great job! I had been trying to do this through Construct for a while but got busy with work and gave up. This is a perfect tutorial and jumping off point to see how to work with node.js and socket.io within construct!

Thanks for releasing this!
B
9
S
2
G
5
Posts: 54
Reputation: 3,546

Post » Sat Apr 07, 2012 4:03 am

[QUOTE=juantar] @istanto i think you still have the old version because the line that says

jpt_splice(dataStack, 1);

Uses a zero instead of a one in the new version, so it looks like this:

jpt_splice(dataStack, 0);

thanks[/QUOTE]

I got it work juantar the problem is i'm not install socket.io on "c:\node_modules" and my browser is not updated. Thank you for your help GBU.

regards
B
3
Posts: 5
Reputation: 310

Post » Fri Apr 20, 2012 3:15 am

I wrote a new post in my blog on how the multiplayer demo works in Construct2:

http://jptarqu.blogspot.com/2012/04/how-to-create-online-multiplayer-html5.html

I also uploaded a new video showing an iPad connecting to the game:

http://www.youtube.com/watch?v=vIdpc5N0pZw
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Fri Apr 20, 2012 10:46 am

[QUOTE=juantar] I wrote a new post in my blog on how the multiplayer demo works in Construct2:

http://jptarqu.blogspot.com/2012/04/how-to-create-online-multiplayer-html5.html

I also uploaded a new video showing an iPad connecting to the game:

http://www.youtube.com/watch?v=vIdpc5N0pZw[/QUOTE]

Awesome, thanks for sharing!

I wonder about Node.js, i doubt how to install node.js on shared web hosting
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 4 guests