[PLUGIN] Chat (with SocketIO)

  • Update:

    Room moderator is the client who enter the chat room earliest in the chat room.

    Room moderator can set the maximum member count of the chat room. 0 is infinity.

    "Condition:Am I room moderator?" can let current client know if it is the room moderator.

    Is there an updated .capx example for these new features?

  • mars1985

    You need to set a user name in "action:Connect", See the snapshot, in the first red square. The user name is "Guest".

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/screen1-14.png" border="0" />

  • Thanks for the info and the screenshot!

  • mars1985

    For "Condition:Am I room moderator?", you can use it to send a "start" message (or other control message), since there is only one "room moderator" in the clients.

    "Action: Set max member count" can be put in any client, but only the "room moderator" can really change the max member count. You can add "set max member count to 1" then try to create 2nd client, you can see some messages both in server and client.

  • I am going to do some testing and set this up on a VM Friday - I may be asking you some question then. haha

    I know how to modify and run Node.js / Socket.io application normally but I've never used anything like Construct before as the content creator.

    I would like to try to reproduce something like this using Construct 2 to generate the HTML5 and structure.

    github.com/Atinux/liveBalls[/url]

  • mars1985

    I'm lacked for using C2 editor to create content, sorry. I'm just interested in making plugin for my team members.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Update:

    Finally, I can minify chat pluigin.

    I put "socket.io.min.js" file into "dependency" property in edittime.js to avoid C2 to minify the code in "socket.io.min.js" file.

    The "dependency" property is powerful for bring files into preview/export folder.

  • Update:

    • Update tornado to ver2.2
    • Pack ServerEngine to single file (actually 2 files)
  • Update:

    Add version to 0.1

  • Hi rexrainbow! This plugin works great, and the server was so easy to set up! I think I might just have to learn some python and modify it for my needs (I was going to learn python eventually anyway). Cheers mate, everything just worked so easily and well, unlike everything else I've been trying to install! Btw, what file should I edit if I want to change the behaviour of the server? Thanks for your help!

    Edit: One last thing: when I open the example file, it says that your Chat plugin is out of date. Is there a new version somewhere we should be downloading from (different from the one in the OP?) Thanks!

  • valkyriegames

    Older plugin had no version number, so it had been treated as the newest. The new one had version number as 0.1.

    The entrance is at main.py -> ChatConnection.py

    try to add

    print 'hello'

    at line 25 and see the result.

    More references:

    tornadio2

    tornado

    You might need to edit client (chat plugin) to meet server. You can reference to Zack0Wack0's socket.io, it's more clearly then mine.

  • rexrainbow

    In SocketIO.bat file

    engine\AppLoader.exe SocketIO\main.py

    You might add another bat file to link to a new folder just copy and fix "SocketIO\main.py"(folder\entrance_file).

    Have fun!

  • Thanks rexrainbow! I will have a bit of a play around and see how I go. Cheers! :D

  • valkyriegames

    I can install node.js on window7 very easily. you might try it.

  • rexrainbow

    The problem is not with installing node.js, but with using dbm to install socket.io. For some reason Windows doesn't recognize it being installed even when the folder in which dbm exists in is on the build path. I've been stumped and couldn't get any further :/ No chance you'd know why? Thanks for your help though!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)