2013-07-22 18:24:46 -05:00
2013-07-22 13:30:25 -04:00
2013-07-22 13:30:25 -04:00
2013-05-05 23:50:15 -04:00
2013-06-08 16:43:37 -04:00
2013-05-05 23:00:43 -04:00
2013-07-22 18:24:46 -05:00

GarageServer.IO

A simple, lightweight, HTML multiplayer game server (and client) for Node.js

Features

  • Authoritative Game Server
  • Client Side / Input Prediciton
  • Client Side Smooting
  • Entity Interpolation
  • Server State History
  • Server and Client Messaging

Quick Start

Client

Server

API

Client

GarageServerIO.initializeGarageServer(path, options)

options = {
    onPlayerConnect(callback),
    onPlayerDisconnect(callback),
    onPlayerReconnect(callback),
    onPlayerUpdate(callback(state)),
    onEntityUpdate(callback(state)),
    onPlayerRemove(callback(id)),
    onEntityRemove(callback(id)),
    onEvent(callback(data)),
    onWorldState(callback(state)),
    onPing(callback(pingDelay)),
    onUpdatePlayerPhysics(callback(state, inputs, deltaTime)),
    onInterpolation(callback(previousState, targetState, amount)),
    onReady(callback,
    logging: true
}
GarageServerIO.addInput(input)
GarageServerIO.getStates(callback([player1State, player2State, ...], [entity1State, entity2State, ...]))
GarageServerIO.getId() : 'playerid'
GarageServerIO.sendServerEvent(data)

Server

createGarageServer(io, options)
start()
stop()
getPlayers() : [{ id, state, [input1, input2,...], [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
getEntities() : [{ id, state, [{ state1, executionTime1 }, { state2, executionTime2 }, ...] }]
updatePlayerState(id, state)
updateEntityState(id, state)
addEntity(id)
removeEntity(id)
sendPlayerEvent(id, data)
sendPlayersEvent(data)

Resources

License

MIT License

S
Description
A simple, lightweight, HTML multiplayer game server (and client) for Node.js
Readme
596 KiB
Languages
JavaScript 97.7%
Pug 1.5%
CSS 0.8%