[PLUGIN] Zack0Wack0's Socket.io mod

Post your completed addons to share with the community

Post » Sun Dec 02, 2012 5:53 pm

Plugin uses string.split(separator,limit) method. Separator and limit are optional attributes and you can ommit them. If you do, method will return an array with a single element;

var URL="WWW.Google.com", var result=URL.split(); result will be an array with a single element (WWW.Google.com).

If you use var Ucan="do it", Ucan.split("") will return an array with elements (d,o, ,i,t). (Mind the white space!).

If you do something like var query="split.string method JavaScript" and then query.split("i",2),returned array will be: (spl, t.str). This is an example use of a limit attribute in a string.split method.

If you need an datasplit action in the c2 plugin with a different character than ",", just edit the right line of code in the runtime.js; if you use this method on your server side, I hope this post will be of use!

Cheers!
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Mon Dec 03, 2012 8:04 pm

Just found out that Socket.io 1.0 is probably going to be pre-released some time this week. The newest feature is that it will include the engine.io 0.3 for the communication layer. As it seems it will introduce a better user experience and a lot of improvements.

Sounds nice.

I will really really try to release improved plugin for the pre-release of socket/io 1.0, and hopefully make socket communications with this nice plugin a little bit easier!


it, i really dig Guillermos work


Cheers!
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Mon Dec 03, 2012 9:18 pm

Nice work Johnny, I'm definitely going to set some time over xmas to look at this!
B
34
S
8
G
3
Posts: 328
Reputation: 7,692

Post » Tue Dec 04, 2012 8:50 am

Nice plugin!! Thank you, Johnny.

I want to use this plugin in 'CocoonJs'.

Now I got this error.



https://www.dropbox.com/s/tvgvs5cljrgv59l/socket.io_error.PNG

Please help!nararacds2012-12-04 08:51:53
B
7
Posts: 6
Reputation: 929

Post » Tue Dec 04, 2012 10:24 am

Not sure what's happening there, I haven't used cocoon.js so probably I won't be as much of help with this issue.

I looked at cocoon.js documentation, and they don't mention support for socket.io, just websockets so I,m not sure can we edit this plugin to work with cocoon.js.

Maybe try to use the websocket version here (scroll to the websocket version)
But i cannot guarantee will it work with new version of construct or cocoonjs because out to s an old plugin.
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Wed Dec 05, 2012 1:48 am

Yep. Thanks~!
B
7
Posts: 6
Reputation: 929

Post » Sun Dec 09, 2012 11:08 pm

You might find an error with

http://your-domin.com/socket.io.min.js

-One way to fix it is-

1. Move socket.io.min.js from the plugin folder into something like Dropbox.

2. Change the dependency line in edittime.js

Note: If you have multiple socket.io plugins one may override the other. Replacing the dependency of both may work but I just deleted the other plugin.

3. Change the link in runtime.js inside document.write() [line 2] to hte same link you pasted previously.


Edit: During a compile you may get an error regarding a missing dependency since the project is essentially compiling without it. Just click retry and it shouldn't pop up again until the next time you open the project.Index2012-12-11 02:24:30
B
72
S
10
G
6
Posts: 104
Reputation: 7,550

Post » Mon Dec 10, 2012 8:13 am

If you're using node.js server should automatically serve client socket.io.js file, form the official wiki:

The client is served automatically by the Node.JS server. In your <head> tag of your HTML, include:

<script src="http://<uri:port>/socket.io/socket.io.js"></script>
If your web app and socket.io are on the same server and port, you can simply include:

<script src="/socket.io/socket.io.js"></script>
Socket.io client can also include optional version numbers, in order to maximize caching performance. You can simply include the version number within javascript filename;

<script src="/socket.io/socket.io.v0.0.1.js"></script>
If you choose to serve the client through other means, you can clone the socket.io-client repository and look at the dist/ subdirectory.

I'll look into that and change it asap!

@Index

What server are you using (i mean code-wise, python, node.js etc..)?

Also, how did you manage to have multiple instances of the plugin? it should be pf_singleglobal?

Can you specify in more detail what was the actual error?JohnnySheffield2012-12-10 08:18:51
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Tue Dec 11, 2012 12:45 am

I had chat from Rex and this one. Rex adds the same dependency which overrides any change to this one- for some reason.

Also, I'm still working on getting things with SSL done. So my setup is a bit annoying lol. I need to try and get multiple instances though. Haven't tried but i will soon.Index2012-12-11 01:06:18
B
72
S
10
G
6
Posts: 104
Reputation: 7,550

Post » Tue Dec 11, 2012 2:49 am

I would like to know, how to try with Juantar's demo?
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests