EDIT2: I became a father month ago, so I haven't got time to sort this plugin and post to some decent level of tidyness. I believe I'll manage to find some time in the next week, so i'll re-upload the plugin with some modifications and hopefully new possibilities!
EDIT: You can download more stable version of this plugin(without new ACE's except send custom event(aka emit), but with minify problem sorted out): Link to stable plugin
And you can check for yourself: Juantars multiplayer demo example minified!
- Triggered when Construct receives a custom socket event.
- Triggered when the socket receives any event. (All of them!)
one new action:
- Emit a custom event through socket. (You must specify which event, and what data to send with that event)
and two expressions:
-Get the last event that was triggered in Construct.
-Get the last event that was emitted by Construct.
1) Socket.send ---> socket.emit('message' , data)
2) On data received
-Triggered when socket receives a chunk of data, regardless of event
3) Included recent modifications by juantar & bhavanvaishnav
4) Changed dependency from "socket.io.js" to "socket.io.min.js"
5) Overridden socket.io's emit; hackish solution; not satisfied but works for now, waiting for more decent implementation: link
Problematic code starts at line 110 in runtime.js
5) You can minify the plugin!
Tested on C2 r95, SRWare Iron, 15.0.900.1.
Please test on more browsers and in more situations; haven't had time to test it properly.
I don't recommend to use it in production code, big chance of unexpected behavior!
Greatest improvement is possibility of minify, if somebody wishes, i can edit older versions of plugin to be minifiable, but i believe this is a good progress!
Have a nice day!