Hi guys, Im new in Cocos Creator, and I want to implement smartfoxserver 2x for my multiplayer game in web platform.
I tried import sfs2x api js file in Cocos Creator, but face some compile errors:
With “Import As Plugin” (Checked)
- Run in simulator error: Simulator: ScriptEngine::runScript script sfs2x-api, buffer is empty!
- Run in browser error: Uncaught TypeError: Cannot read property ‘SFS2X’ of null
Without “Import As Plugin” (Unchecked)
- Run in simulator error: Simulator: ERROR: ReferenceError: Can’t find variable: DataStream, location: assets/scripts/lib/sfs2x-api.js:3479:25
- Run in browser error:
Uncaught ReferenceError: DataStream is not defined
at Object. (sfs2x-api.js:6)
at Object. (sfs2x-api.js:6)
at n (sfs2x-api.js:6)
at Object. (sfs2x-api.js:7)
at n (sfs2x-api.js:6)
at Object. (sfs2x-api.js:6)
at n (sfs2x-api.js:6)
at Object. (sfs2x-api.js:6)
at n (sfs2x-api.js:6)
at Object. (sfs2x-api.js:7)
Download link:
SmartFoxServer2X Javascript API
I really appreciate if someone could guide me the sfs2x integration. Thank you.