Using Construct with smartfox server

  • Might be a stupid question but was just wondering can i use smartfox

    server with construct 2. Was just wanting to use chat with the game im developing, but multiplayer would be nice. thanks for all answers!!

  • There is currently a multiplayer plugin being developed.

    Follow the thread here:

    And yes im sure you can. But i would require some server side scripting.

  • You can use websockets to communicate with any server supporting them.

    For now you must go through custom plugins to add them, but if you are comfortable with those, you can use pretty much any server you like.

    There is also this plugin to build chat applications.

  • Hello,

    This is an old thread but I'm curious if the OP was ever successful at making Smartfox "talk" with Construct 2.

    I've been using Smartfox server for years with Flash only as client. Now I would like to publish to every platform without making too many changes to the server side code. Construct 2 seems like the right tool. From what I understand I need to create a Smartfox object that I will put in the <install path>\exporters\html5\plugins directory.

    The Smartfox team provides a client API under the form of a .js file, the first lines look like this:

            this._socketEngine=new SFS2X.SocketEngine;        
        [i]    .........[/i]
  "SmartFox instance ready!")
        this.isConnected()?this._log.warn("SetClientDetails must be called before the connection is started"):(this._clientDetails=null!=a?a.replace(":"," "):"",this._clientDetails+=":",this._clientDetails+=null!=b?b.replace(":"," "):"")
      [i] ......      [/i]  
    etc, it defines many other functions for communicating with the server. I believe I have to convert their file so it becomes a runtime.js file (based on the plugin template), but I'm not sure. If I do that, then I will not be using the WebSocket object but only the Smartfox object, right?
  • Try Construct 3


    Try Now Construct 3 users don't see these ads
  • You use both. The WebSocket object in C2 is the client side, and the SmartFox object is the server side.

  • Thank you. Usually, when using a Smartfox object on the client side you can listen to events such as room variables update or extension responses, so I understand it's possible to define those events within a C2 WebSocket?

  • Probably. I am not sure how though, as I have never worked with the SmartFox stuff.

Jump to:
Active Users