mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-02 17:00:12 +08:00
1.3 KiB
1.3 KiB
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(playerStates: [player1State, player2State, ...], entityStates: [entity1State, entity2State, ...]))
GarageServerIO.getId() : 'playerid'
GarageServerIO.sendServerEvent(data)