{"id":50127486,"url":"https://github.com/zefir1990/mars-miners-server","last_synced_at":"2026-05-23T20:34:53.268Z","repository":{"id":339790082,"uuid":"1129314847","full_name":"zefir1990/mars-miners-server","owner":"zefir1990","description":"Mars miners game server","archived":false,"fork":false,"pushed_at":"2026-01-09T12:19:48.000Z","size":35,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-21T21:20:29.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zefir1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-06T23:16:01.000Z","updated_at":"2026-01-09T12:20:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zefir1990/mars-miners-server","commit_stats":null,"previous_names":["zefir1990/mars-miners-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zefir1990/mars-miners-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Fmars-miners-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Fmars-miners-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Fmars-miners-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Fmars-miners-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefir1990","download_url":"https://codeload.github.com/zefir1990/mars-miners-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Fmars-miners-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33412082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-23T20:34:53.192Z","updated_at":"2026-05-23T20:34:53.255Z","avatar_url":"https://github.com/zefir1990.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mars Miners Server\n\nA lightweight Node.js WebSocket server for managing battle sessions in Mars Miners.\n\n## Features\n\n- **WebSocket Communication**: Real-time bidirectional communication.\n- **In-Memory Storage**: Fast session management (reset on restart).\n- **Battle Sessions**: Create, join, and manage unique battle lobbies.\n- **Broadcasting**: Real-time updates to all players in a session.\n- **Docker Support**: Containerized deployment.\n\n## WebSocket API\n\nThe server listens on **port 3001**.\nAll messages are text-based strings.\n\n### Commands\n\n| Command | Syntax | Description |\n|---------|--------|-------------|\n| **CREATE** | `[playerID] CREATE [sessionID]` | Creates a new battle session. |\n| **JOIN** | `[playerID] JOIN [sessionID]` | Joins an existing battle session. |\n| **WRITE** | `[playerID] WRITE [sessionID] [message]` | Adds a log entry and broadcasts it to all players. |\n| **READFULL** | `[playerID] READFULL [sessionID]` | Requests the full command history of the session. |\n\n### Responses\n\n- **Success**: `OK: Created [sessionID]` or `OK: Joined [sessionID]`\n- **Update**: `UPDATE [\"log1\", \"log2\", ...]` (Broadcasted JSON array)\n- **Full Log**: `FULLLOG [\"log1\", \"log2\", ...]` (JSON array)\n- **Error**: `ERROR: [Description]`\n\n### Example Flow\n\n1. **Client A** connects.\n2. **Client A** sends: `Player1 CREATE BattleRoom1`\n   - Server: `OK: Created BattleRoom1`\n3. **Client B** sends: `Player2 JOIN BattleRoom1`\n   - Server: `OK: Joined BattleRoom1`\n4. **Client A** sends: `Player1 WRITE BattleRoom1 ATTACK_A`\n   - Server broadcasts to A and B: `UPDATE [\"ATTACK_A\"]`\n\n## Docker Setup\n\n### Pre-built Image\n\nPull the latest image from Docker Hub:\n\n```bash\ndocker pull demensdeum/mars-miners-server:latest\n```\n\n### Quick Start\n\nRun with Docker Compose:\n\n```bash\ndocker-compose up --build\n```\n\nThe server will be available at `ws://localhost:3001`.\n\n### Build Manually\n\n```bash\ndocker build -t mars-miners-server .\ndocker run -p 3001:3001 mars-miners-server\n```\n\nSee [DOCKER.md](DOCKER.md) for detailed configuration options.\n\n## Development\n\n1. Install dependencies:\n   ```bash\n   npm install\n   ```\n2. Start the server (autoreload):\n   ```bash\n   npm run dev\n   ```\n3. Run tests:\n   ```bash\n   node test-broadcast.js\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefir1990%2Fmars-miners-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefir1990%2Fmars-miners-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefir1990%2Fmars-miners-server/lists"}