Plugin Question: Socket.io (FIXED)

Get help using Construct 2

Post » Wed Oct 24, 2012 9:59 am

Do I have to work with strings?
I need to send a Variable, and sending X as a message, sends X as a message not as the Variable X data.


So I tried to change it a bit:




And Serverside:

var entities = [], count = 0;
var io = require("socket.io").listen(80);

var x = 50;

function sendPos()
{
    io.sockets.emit("message", x);
     
}

setInterval(sendPos, 1000);


But then I get this Error:

Schoening2012-10-24 10:09:51
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Wed Oct 24, 2012 10:09 am

Fixed.

io.sockets.emit("message", 'Pos,' + x);
B
40
S
11
G
4
Posts: 665
Reputation: 8,403


Return to How do I....?

Who is online

Users browsing this forum: h1k3 and 16 guests