{"id":26578,"library":"v6-game-server","title":"V6 Game Server","description":"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.","status":"maintenance","version":"0.12.396","language":"javascript","source_language":"en","source_url":"https://github.com/levserk/v6-game-server","tags":["javascript"],"install":[{"cmd":"npm install v6-game-server","lang":"bash","label":"npm"},{"cmd":"yarn add v6-game-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add v6-game-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CJS-only and does not support ESM imports. Attempting to use ES import will throw a SyntaxError.","wrong":"import Server from 'v6-game-server'","symbol":"default","correct":"const Server = require('v6-game-server')"},{"note":"The package exports the constructor as module.exports directly (not a named export). Using destructuring will result in undefined.","wrong":"const { Server } = require('v6-game-server')","symbol":"Server","correct":"const Server = require('v6-game-server').default || require('v6-game-server')"},{"note":"Do not call require with arguments; instantiate after assignment.","wrong":"const server = new require('v6-game-server')(conf, engine)","symbol":"Server","correct":"const Server = require('v6-game-server')"}],"quickstart":{"code":"const Server = require('v6-game-server');\n\nconst conf = {\n    game: 'mygame',\n    port: 8080,\n    turnTime: 60,\n    timeMode: 'reset_every_turn',\n    timeStartMode: 'after_turn',\n    maxTimeouts: 2,\n    mongo: {\n        host: '127.0.0.1',\n        port: '27017'\n    },\n    redis: {\n        host: '127.0.0.1',\n        port: '6379'\n    }\n};\n\nconst engine = {\n    // Your game logic here\n};\n\nconst server = new Server(conf, engine);\nserver.start();","lang":"javascript","description":"Creates and starts a V6 game server with custom configuration and game engine."},"warnings":[{"fix":"Use require() instead of import","message":"package is CJS-only; ESM imports will fail","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use const Server = require('v6-game-server') not const { Server } = require(...)","message":"require returns the Server constructor directly, not an object with a Server property","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure MongoDB and Redis servers are running and accessible or set mode:'develop' to skip DB, but note this may disable some features.","message":"MongoDB and Redis are required for persistence even with mode:'develop'?","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use the correct pattern: const Server = require('v6-game-server'); const server = new Server(conf, engine);","message":"The documentation shows require() with two arguments which is invalid in Node.js","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace with const Server = require('v6-game-server')","cause":"Using destructuring import like const { Server } = require('v6-game-server') results in undefined","error":"TypeError: Server is not a constructor"},{"fix":"Use require() instead, or convert your project to CommonJS","cause":"Attempting to use ES import syntax with this CJS-only package","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Change conf.port to an available port or kill the process using the port","cause":"Port already in use, or multiple instances trying to use same port","error":"Error: listen EADDRINUSE :::8080"},{"fix":"Start MongoDB or update conf.mongo with correct host/port; or set mode:'develop' to bypass DB","cause":"MongoDB not running or not accessible","error":"MongoError: failed to connect to server [127.0.0.1:27017]"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}