Registry / web-framework / v6-game-server

v6-game-server

JSON →
library0.12.396jsnpmunverified

A Node.js server for turn-based games (board games, card games, etc.), current version 0.12.396. Provides WebSocket-based multiplayer with configurable turn timers, reconnection handling, spectator mode, MongoDB/Redis integration for persistence and ranking, and admin controls. Differentiators include flexible timer modes (per-turn, per-switch, common time, addTime), penalty/timeout systems, and cheat detection via unfocused turns. Released under an unspecified cadence, likely maintenance mode as updates are infrequent. Primarily documented in Russian.

npm install v6-game-server
INSTALL
IMPORT
SIG · V6-GAME-SERVER
V
v6-game-server
web-frameworkjavascriptv0.12.396
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ const Server = require('v6-game-server')
✗ import Server from 'v6-game-server'
This package is CJS-only and does not support ESM imports. Attempting to use ES import will throw a SyntaxError.
Server
✓ const Server = require('v6-game-server').default || require('v6-game-server')
✗ const { Server } = require('v6-game-server')
The package exports the constructor as module.exports directly (not a named export). Using destructuring will result in undefined.
Server
✓ const Server = require('v6-game-server')
✗ const server = new require('v6-game-server')(conf, engine)
Do not call require with arguments; instantiate after assignment.

Creates and starts a V6 game server with custom configuration and game engine.

const Server = require('v6-game-server'); const conf = { game: 'mygame', port: 8080, turnTime: 60, timeMode: 'reset_every_turn', timeStartMode: 'after_turn', maxTimeouts: 2, mongo: { host: '127.0.0.1', port: '27017' }, redis: { host: '127.0.0.1', port: '6379' } }; const engine = { // Your game logic here }; const server = new Server(conf, engine); server.start();
Debug
Known issues
gotchapackage is CJS-only; ESM imports will fail
fix
Use require() instead of import
affects: >=0.0.0
gotcharequire returns the Server constructor directly, not an object with a Server property
fix
Use const Server = require('v6-game-server') not const { Server } = require(...)
affects: >=0.0.0
gotchaMongoDB and Redis are required for persistence even with mode:'develop'?
fix
Ensure MongoDB and Redis servers are running and accessible or set mode:'develop' to skip DB, but note this may disable some features.
affects: >=0.0.0
deprecatedThe documentation shows require() with two arguments which is invalid in Node.js
fix
Use the correct pattern: const Server = require('v6-game-server'); const server = new Server(conf, engine);
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Server is not a constructor
Using destructuring import like const { Server } = require('v6-game-server') results in undefined
fix
Replace with const Server = require('v6-game-server')
SyntaxError: Cannot use import statement outside a module
Attempting to use ES import syntax with this CJS-only package
fix
Use require() instead, or convert your project to CommonJS
Error: listen EADDRINUSE :::8080
Port already in use, or multiple instances trying to use same port
fix
Change conf.port to an available port or kill the process using the port
MongoError: failed to connect to server [127.0.0.1:27017]
MongoDB not running or not accessible
fix
Start MongoDB or update conf.mongo with correct host/port; or set mode:'develop' to bypass DB
Upgrade
Version history
0.12.396latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
36
OpenAI (training)
2
Resources
v6-game-server — npm install v6-game-server · libregistry