New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

patchwire

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

patchwire

Multiplayer game server framework for Node.js

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Patchwire

Multiplayer game server framework for Node.js

Circle CI

Quick Start

Install

npm install patchwire

Use

// MyGameServer.js
var Server = require('patchwire').Server;
var ClientManager = require('patchwire').ClientManager;

var server = new Server();
var gameLobby = new ClientManager();
gameLobby.on('clientAdded', function() {
    gameLobby.broadcast('chat', {
        message: 'A new player has joined the game.'
    });
});

var server = new Server(function(client) {
  gameLobby.addClient(client);
});

server.listen(3001);

Documentation

You can find all of the documentation for Patchwire at the wiki for patchwire

About

Patchwire is a server framework designed for multiplayer games. Originally built to work with GameMaker: Studio's networking code, it has been standardized to be unassuming about the client end framework.

Patchwire uses a paradigm of sending "commands" to clients, and in turn, listening for commands from the client. A command is nothing more than a string identifier, and some data. A command looks like this:

{
  command: 'updatePosition',
  x: 200,
  y: 120
}

Client Side

Patchwire speaks JSON via a networking socket. All you need to connect to a Patchwire server is the ability to connect to a socket. Currently, Patchwire only has official support for GameMaker as a client library, the code for which can be found here

Keywords

server

FAQs

Package last updated on 06 Sep 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