sfs3-api

SmartFoxServer 3 client api for haxe
https://github.com/barisyild/sfs3-api-haxe

To install, run:

haxelib install sfs3-api 3.0.3 

See using Haxelib in Haxelib documentation for more information.

README.md

GitHub stars PRs Welcome GitHub release Ask DeepWiki

SFS3 API Haxe

SmartFoxServer 3 client API written in Haxe, cross-compiled to multiple targets.

Build

haxe build.hxml

Output

FileTarget
out/SFS3_API_PY.pyPython
out/SFS3_API_AS3.swcActionScript 3 (Flash/AIR)
out/SFS3_API_JS.jsBrowser JavaScript
out/SFS3_API_Node.jsNode.js
out/SFS3_API_CPP/C++ (hxcpp — native sources + output.exe stub)

C++ (hxcpp)

Requires hxcpp (haxelib install hxcpp) and a C++ toolchain (e.g. Visual Studio on Windows, clang++/g++ on macOS/Linux).

Public C API: cpp/include/SFS3_API.h + cpp/src/SFS3_API.cpp — a Loreline-style C wrapper with: - Lifecycle: SFS3_init/dispose/gc/update/registerThread (hxcpp GC management) - Opaque handles: SFS3_SmartFox*, SFS3_ConfigData*, SFS3_SFSObject*, SFS3_User*, SFS3_Room* - Type conversions: SFS3_String (ref-counted), SFS3_Value (tagged union) - Event callbacks: SFS3_addEventListener with C function pointers + userData - Requests: SFS3_sendLogin/Logout/JoinRoom/PublicMessage/ExtensionRequest/... - Data access: SFS3_SFSObject_putInt/getString/..., SFS3_SFSArray_add*/get*

See cpp/README.md for full usage example and compile/link instructions.

Protocol Support

TargetTCPUDPWebSocket
PythonYESNOYES
AS3 (Flash/AIR)YESYESYES
Browser JSNONOYES
Node.jsYESYESYES
C++ (hxcpp)YESYESYES

Flash/AIR (SWC + mxmlc)

When linking SFS3_API_AS3.swc with mxmlc, use -include-libraries+=... (not -library-path).
-library-path only pulls symbols reachable from your main class; the Haxe runtime and SFS3 API use indirect references, so many SWC types would be missing at runtime.

See sample/as3/SimpleChat/build.bat.

Sample

out/SimpleChat.py — Tkinter chat client for testing against a SmartFoxServer 3 instance.

pip install -r sample/python/requirements.txt
python out/SimpleChat.py
Contributors
barisyild
Version
3.0.3
Published
4 weeks ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂