Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twisterghost/patchwire
Multiplayer game server framework for Node.js
https://github.com/twisterghost/patchwire
gamemaker multiplayer-game server
Last synced: 2 months ago
JSON representation
Multiplayer game server framework for Node.js
- Host: GitHub
- URL: https://github.com/twisterghost/patchwire
- Owner: twisterghost
- License: mit
- Created: 2015-09-04T02:06:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:16:34.000Z (about 2 years ago)
- Last Synced: 2024-10-11T12:08:17.886Z (3 months ago)
- Topics: gamemaker, multiplayer-game, server
- Language: JavaScript
- Homepage:
- Size: 159 KB
- Stars: 28
- Watchers: 6
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Patchwire
Multiplayer game server framework for Node.js## Install
`npm install patchwire`## Use
```JavaScript
// MyGameServer.js
const Server = require('patchwire').Server;
const ClientManager = require('patchwire').ClientManager;const gameLobby = new ClientManager();
gameLobby.on('clientAdded', function() {
gameLobby.broadcast('chat', {
message: 'A new player has joined the game.'
});
});const server = new Server(function(client) {
gameLobby.addClient(client);
});server.listen(3001);
```## Documentation
See [the patchwire Github wiki](https://github.com/twisterghost/patchwire/wiki)
## 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:
```JavaScript
{
command: 'updatePosition',
x: 200,
y: 120
}
```## Clients
Patchwire is unassuming about the client side as it speaks primarily through JSON strings encoded over the wire. If you do not see your preferred client side below, creating your own client package is strongly encouraged, as Patchwire is built to be as easy as possible to implement. More client packages will come over time.
### List of client packages:
* [GameMaker: Studio](https://github.com/twisterghost/patchwire-gm)
* [iOS](https://github.com/VictorBX/patchwire-ios)