{"id":13989643,"url":"https://github.com/floatinghotpot/casino-server","last_synced_at":"2025-04-08T10:18:19.565Z","repository":{"id":24517184,"uuid":"27923115","full_name":"floatinghotpot/casino-server","owner":"floatinghotpot","description":":fire: An online poker game server powered by Redis, node.js and socket.io","archived":false,"fork":false,"pushed_at":"2020-04-26T10:41:29.000Z","size":728,"stargazers_count":1083,"open_issues_count":29,"forks_count":478,"subscribers_count":96,"default_branch":"master","last_synced_at":"2025-04-01T08:42:26.638Z","etag":null,"topics":["casino","game","javascript","poker","poker-game-server","server","texasholdem"],"latest_commit_sha":null,"homepage":"","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/floatinghotpot.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}},"created_at":"2014-12-12T14:14:38.000Z","updated_at":"2025-03-30T06:01:27.000Z","dependencies_parsed_at":"2022-08-02T23:15:55.905Z","dependency_job_id":null,"html_url":"https://github.com/floatinghotpot/casino-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcasino-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcasino-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcasino-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcasino-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatinghotpot","download_url":"https://codeload.github.com/floatinghotpot/casino-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819940,"owners_count":21001394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["casino","game","javascript","poker","poker-game-server","server","texasholdem"],"created_at":"2024-08-09T13:01:53.400Z","updated_at":"2025-04-08T10:18:19.546Z","avatar_url":"https://github.com/floatinghotpot.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# casino-server #\n\n[![npm version](https://badge.fury.io/js/casino-server.svg)](http://badge.fury.io/js/casino-server)\n\n[![Build Status](https://travis-ci.org/floatinghotpot/casino-server.svg)](https://travis-ci.org/floatinghotpot/casino-server)\n\n[![NPM](https://nodei.co/npm-dl/casino-server.png?height=3)](https://nodei.co/npm/casino-server/)\n\nAn online poker game server powered by redis, node.js and socket.io\n\n![A](https://github.com/floatinghotpot/casino-server/raw/master/wwwsrc/img/4_14.png) ![A](https://github.com/floatinghotpot/casino-server/raw/master/wwwsrc/img/3_14.png)\n![A](https://github.com/floatinghotpot/casino-server/raw/master/wwwsrc/img/2_14.png)\n  \nGame rules supported:\n- [x] Chat Room (聊天室)\n- [x] Jinhua (诈金花/三张牌)\n- [x] Texas Holdem (德州扑克)\n- [ ] Fight Landlord (斗地主)\n- [ ] Blackjack (21点)\n\nFeatures: \n- [x] Cross-platform: powered by node.js, easy to deploy on various platforms.\n- [x] Scalable: using Redis as message bus and data storage.\n- [x] Open architecture: with Redis as the message bus, easy to interact and extend.\n- [x] Cluster: using PM2, sticky session, and socket.io-redis.\n- [x] WebSocket protocol: come with javascript client API and web-based demo. \n- [x] Event logger for server events and user actions.\n\nTODO List:\n- [ ] Client API for Unity3D (C#, support mono/.NET2.0)\n- [ ] Payment gateway callback URL.\n- [ ] Admin Portal.\n- [ ] Load balancing: using NginX, or auto handled if deployed to Amazon Cloud.\n\n# Architecture #\n\n![Architecture](https://github.com/floatinghotpot/casino-server/raw/master/docs/architecture.png)\n\n## Required ##\n\n* Redis\n\nRedis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.\n\n[Download](http://redis.io/download)\n\n* node.js / npm\n\nNode.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.\n\n[Download](http://nodejs.org/download)\n\n* PM2 (production \u0026 cluster)\n\nPM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.\n\n[Read More](https://github.com/Unitech/pm2)\n\n# Installation #\n\n* Installing globally and run as service with PM2: \n\n```bash\n[sudo] npm install pm2 -g\n[sudo] npm install casino-server -g\n\n# run redis-server first\nredis-server \u0026\n\n# run as service and cluster mode\npm2 start `which casino-server` -i 0\n```\n\n* Installing as a node app, and run in current folder:\n\n```bash\ngit clone https://github.com/floatinghotpot/casino-server.git casino\ncd casino\nnpm install\n# sudo npm install -g gulp\n# gulp build\nnode bin/casino-server [options]\n```\n\nNow you can visit http://localhost:7000, it's a web-based game client for testing and demo purpose.\n\n```bash\n# open a browser to access the test web page\nopen http://localhost:7000/\n```\n\n# Available Options: #\n\n-p Port to use (defaults to 7000)\n\n-h Host address to use (defaults to 0.0.0.0)\n\n-r Address of Redis server (defaults to 127.0.0.1:6379)\n\n# Tools #\n\nWith Redis as the message bus, it's very easy for tools to work with the open architecture.\n\n## Event Logger ##\n\nStart the event logger to monitor the events:\n\n```bash\nbin/logger.js\n```\n\nOr, log the events into log file:\n\n```bash\nbin/logger.js -o ./tmp/casino.log\n```\n# See Also\n\n* [socket.io for Unity3D](https://github.com/floatinghotpot/socket.io-unity), is a socket.io client library for Unity3D. You can develop casino games with Unity3D, and using this library to connect to this casino server.\n\n# Credits #\n\nThis poker game server is created by Raymond Xie, published under MIT license.\n\nIt can be used for FREE, but be aware that:\n\n* It is provided as it is. (Not a mature commercial product, may be incomplete, or even lots of bugs)\n* We will mainly focus on our own needs. \n* You can propose wish for new features, but don't rely on us to implement them. Instead of waiting for new features, welcome join us to implement them.\n* You need take your own risk, including that you need find answers from reading code instead of easily asking only. :P\n\nIf you are interested in this project, you can contribute in any of following aspects:\n\n* Simply \"Star\" it.\n* Use it or test it, report bugs or even send pull request of patches.\n* Add better HTML5 demo client.\n* Add new poker game rules.\n* Add client APIs in other languages (like C# for Unity, Java, Objective-C, C/C++, etc.)\n* Help us write documentation, if your English is good.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatinghotpot%2Fcasino-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatinghotpot%2Fcasino-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatinghotpot%2Fcasino-server/lists"}