npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sfs2x-api

v1.8.2

Published

Official JavaScript client API for SmartFoxServer 2X, the leading SDK to create large scale multiplayer games and MMOs

Downloads

3,680

Readme

SFS Logo

What is SmartFoxServer 2X

SmartFoxServer is a comprehensive SDK for rapidly developing multiplayer games and applications using all the major web and mobile technologies like Adobe Flash, Unity, iOS, Android, Windows Phone and, in particular, HTML5 / JavaScript.

SmartFoxServer comes with a rich set of features, an impressive documentation set, a large number of examples with their source code, powerful administration tools, a free Community Edition and a very active support forum.

Born in 2004 and evolving continuously since then, today SmartFoxServer 2X (aka SFS2X) keeps expanding the core SmartFoxServer philosophy established by the previous Basic and Pro editions, making our platform the leading middleware to create large scale multiplayer games, MMOs and virtual communities.

Thanks to its simplicity of use, versatility and performance, SmartFoxServer currently powers hundreds of projects all over the world, from small chats and turn-based games to massive virtual worlds and realtime games.

Please visit smartfoxserver.com to get started.

JavaScript client API for SFS2X

This npm package installs the latest version of the SmartFoxServer 2X client API for JavaScript, enabling games and applications developed with this programming language to "speak" the SFS2X protocol and interact with the server very easily and securely.

RELEASE NOTES: https://www.smartfoxserver.com/download/releaseNotes/SFS2X_API_JavaScript-bin.txt

NOTE ON VERSIONING: the version number of this package mirrors the JavaScript API version number on the SmartFoxServer website. In case of changes to this readme document only, a letter will be added (for example 1.7.10-a).

Installation

To install the SFS2X API package for JavaScript, go to your project's folder in a terminal/console window and execute this command:

npm install sfs2x-api --save

This automatically adds the sfs2x-api entry in the dependancies section of your project's package.json file.

Usage

In your project you can use a module bundler (we recommend webpack) and the ES2015 module loading syntax to access the API, like this:

import * as SFS2X from "sfs2x-api";

You can then instantiate the API classes by means of the SFS2X namespace. The following example shows how to create an instance of the main SmartFox class, add a few listeners and establish a connection with SmartFoxServer.

var sfs = new SFS2X.SmartFox();
sfs.addEventListener(SFS2X.SFSEvent.CONNECTION, onConnection, this);

sfs.connect(127.0.0.1, 8080);

function onConnection(evtParams)
{
     if (evtParams.success)
         console.log("Connected to SmartFoxServer 2X!");
     else
         console.log("Connection failed. Is the server running at all?");
}

Basic example

A complete, yet simple example showing how to setup your npm project and build it using webpack is available here.

Other resources

  • Full SmartFoxServer documentation: http://docs2x.smartfoxserver.com
  • JavaScript client API documentation: http://docs2x.smartfoxserver.com/api-docs/jsdoc/client/
  • HTML5 tutorials and examples: http://docs2x.smartfoxserver.com/ExamplesJS/introduction