Socket
Book a DemoInstallSign in
Socket

npm_crafty

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm_crafty

A server version of craftyJS. It allows multiple server-client(s) sessions.

0.5.3-8
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

npm_crafty

This is a nodeJS module. It runs a server version of craftyJS.

npm_crafty adds a logical overlay network on-top of crafty

  • You can create multiple rooms. Each room contains one server and multiple clients.
  • A client can send events to the server. The server can send events to all clients.
  • Define your client & server code in one place, and let the module determine which code to run.
  • Network events are automatically routed to the correct entity instance on the other end of the network.

Go multiplayer today with a minimalistic and easy-to-use net api!

Version

Current native crafty version is 0.5.3

Overview

The unmodified crafty version runs on the client (== browser). A heavily modified version runs on the server (== nodejs, drawing stuff and similar is omitted from the server version).
Both client and server version have additional features available for defining the game code on server or client, as well as enabling communication between them.
These differences between original crafty library and the modified libraries can be seen inside the diff folder.
You have to alter your game code to include these features.

In order for the communication to work between server and client(s) you also have to specify how connecting / disconnecting hosts will affect how your game sessions are setup. Each game session is an unique instance of your game; there can be multiple game sessions taking place at once and each one takes place inside a game room. A game room consists of one crafty server instance that communicates with multiple crafty client instances.
The documentation on game room setup (server and client) setup can be found inside the lib folder.
You have to setup game room(s) so that each server instance knows with which client instance to communicate.

An example can be found inside the example folder.

Misc

If you have a suggestion or bug report, open an issue. If you want to contribute, open a pull request.

License

The MIT License (MIT) (See LICENSE)

Keywords

crafty

FAQs

Package last updated on 02 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.