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:
SFS2X=
{
SmartFox:
function(a)
{
this._majVersion=1;
this._minVersion=2;
this._subVersion=0;
this._socketEngine=new SFS2X.SocketEngine;
[i] .........[/i]
this._controllers=
{
}
;
this._initialize();
this._log.info("SmartFox instance ready!")
}
}
;
SmartFox=SFS2X.SmartFox;
SFS2X.SmartFox.prototype.addEventListener=function(a,b,c)
{
this._eventDispatcher.addEventListener(a,b,c)
}
;
SFS2X.SmartFox.prototype.removeEventListener=function(a,b)
{
this._eventDispatcher.removeEventListener(a,b)
}
;
SFS2X.SmartFox.prototype.setClientDetails=function(a,b)
{
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(":"," "):"")
}
;
SFS2X.SmartFox.prototype.connect=function(a,b,c)
{
[i] ...... [/i]
}
[u].....[/u]
[/code:rgjmirpb]
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?