Ashley I'm sorry to bring this back buuut...
So have been experimenting with Nodejs and the WS module like you suggested.
However, I have a few more questions, which I wouldn't mind any answers to.
So Construct 2's WebSocket plugin sends text strings to the connected server, correct?
From there, I ran one successfully and connected my game client without issue.
Messages were also working fine, passing from Client to Server and vice-versa.
What I would like to know, is what these "custom event" emitters are I see in such modules as Socket.IO:
<font color="red">socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });</font>
And if this is possible since, as with the client above, there is more than just a message, it seems.
Right now, I can only send text strings, which is nice, but they only go to the server under "message," which means I can't send, say, an event emission "move" from the C2 client instead having to parse for the first part of a message.
Am I right in that C2 can only emit data to the server in the form of a "message"? Or am I just crazy? What I would like to be able to do is something like:
<font color="red">socket.on('moveChar', function (data) {
console.log(data);
});</font>
Instead of using something like:
<font color="red">socket.on('message', function (data) {
console.log(data);
[parse data for string 'moveChar'>
});
I'm fully prepared to work either way, I just would like to know if what I'm talking about is possible or if I'm just crazy and should go back to doing research.