{"_id":"casino-server","_rev":"23-904e4bd821febb71a80fc70b41112acf","name":"casino-server","time":{"modified":"2022-06-13T05:39:09.496Z","created":"2015-01-20T00:30:07.923Z","0.1.0":"2015-01-20T00:30:07.923Z","0.1.1":"2015-01-20T03:31:34.690Z","0.1.2":"2015-01-20T03:55:29.888Z","0.1.3":"2015-01-20T11:53:15.750Z","0.1.4":"2015-01-22T12:42:20.305Z","0.1.5":"2015-06-08T03:30:49.147Z","0.1.6":"2017-05-23T21:09:16.396Z"},"maintainers":[{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"}],"dist-tags":{"latest":"0.1.6"},"description":"An multi-rule scalable online poker game server powered by redis, node.js and socket.io","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- [ ] Load balancing: using NginX as load balancer.\n- [ ] Client API in other language (priority: C/C++, C#, Java, Objective-C, etc.)\n- [ ] Payment gateway callback URL.\n- [ ] Admin Portal.\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 & 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 &\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\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/C++, C#, Java, etc.)\n* Help us write documentation, if your English is good.\n\n","versions":{"0.1.3":{"name":"casino-server","version":"0.1.3","description":"An multi-rule scalable online poker game server powered by redis, node.js and socket.io","main":"./bin/casino-server.js","scripts":{"start":"node ./bin/casino-server.js","test":"gulp unit-test"},"repository":{"type":"git","url":"git://github.com/floatinghotpot/casino-server.git"},"keywords":["casino","poker","game","chat"],"author":{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com","url":"http://floatinghotpot.github.io/"},"contributors":[{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com"}],"license":"MIT","bugs":{"url":"https://github.com/floatinghotpot/casino-server/issues"},"dependencies":{"minimist":"^1.1.0","express":"^4.10.4","redis":"^0.12.1","socket.io":"^1.2.1","socket.io-redis":"^0.1.4"},"devDependencies":{"gulp":"^3.8.10","gulp-jasmine":"^1.0.1","gulp-concat":"^2.4.2","gulp-jshint":"^1.9.0","gulp-myth":"^1.0.2","gulp-minify-css":"^0.3.11","gulp-uglify":"^1.0.2","vinyl-source-stream":"^1.0.0","jasmine-reporters":"^1.0.1","browserify":"^7.0.0","browser-sync":"^1.7.2","del":"^1.1.0","read":"^1.0.5"},"analyze":false,"preferGlobal":"true","bin":{"casino-server":"./bin/casino-server.js","casino":"./bin/casino-server.js"},"homepage":"https://github.com/floatinghotpot/casino-server","_id":"casino-server@0.1.3","dist":{"shasum":"8e0693e269d3794cfd4cca9d94b2ab3f468a5308","tarball":"https://registry.npmjs.org/casino-server/-/casino-server-0.1.3.tgz","integrity":"sha512-I1MqVplzMGqxKgVh7kU0yw4Xs5jJvpOrlSKsfrWm3S8/p8KG2CzneHInA9z+x7UkfoFHhaPleNrRWSPKuTxZ/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB8ffcr8j0pwWpGbYHkMvwsHadcBBXc8lGivRcRy5xlTAiA+zNYwTYuQ9IT084ZkJUZ1cRIlHd3Sk7+Y1BPvrveAJg=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"},"maintainers":[{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"}]},"0.1.4":{"name":"casino-server","version":"0.1.4","description":"An multi-rule scalable online poker game server powered by redis, node.js and socket.io","main":"index.js","scripts":{"start":"node ./bin/casino-server.js","test":"gulp unit-test"},"repository":{"type":"git","url":"git://github.com/floatinghotpot/casino-server.git"},"keywords":["casino","poker","game","chat"],"author":{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com","url":"http://floatinghotpot.github.io/"},"contributors":[{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com"}],"license":"MIT","bugs":{"url":"https://github.com/floatinghotpot/casino-server/issues"},"dependencies":{"minimist":"^1.1.0","express":"^4.10.4","redis":"^0.12.1","socket.io":"^1.2.1","socket.io-redis":"^0.1.4"},"devDependencies":{"gulp":"^3.8.10","gulp-jasmine":"^1.0.1","gulp-concat":"^2.4.2","gulp-jshint":"^1.9.0","gulp-myth":"^1.0.2","gulp-minify-css":"^0.3.11","gulp-uglify":"^1.0.2","vinyl-source-stream":"^1.0.0","jasmine-reporters":"^1.0.1","browserify":"^7.0.0","browser-sync":"^1.7.2","del":"^1.1.0","read":"^1.0.5"},"analyze":false,"preferGlobal":"true","bin":{"casino-server":"./bin/casino-server.js","casino":"./bin/casino-server.js"},"gitHead":"0b30f5c0832ed74e152ed756b0b158158e7d993a","homepage":"https://github.com/floatinghotpot/casino-server","_id":"casino-server@0.1.4","_shasum":"f945fd8069f076ecba881a2041a9384a65ca94be","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"},"maintainers":[{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"}],"dist":{"shasum":"f945fd8069f076ecba881a2041a9384a65ca94be","tarball":"https://registry.npmjs.org/casino-server/-/casino-server-0.1.4.tgz","integrity":"sha512-eg7b9xNW0rj5iSlntDNQ/32HPg/mBAaWN9xxV6uma/5ctrcZ8LOF4JHY7V2Av1nAQCybdROmj1ELLv8IoJbS4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsEJDqDRy5+7RblE9KaDmPkJgJ4wEqAc4BWnuN1akVEwIgOdgfcYtRAQe34FE8zRn422bCofbbWbCVmpl01tDaUQg="}]}},"0.1.5":{"name":"casino-server","version":"0.1.5","description":"An multi-rule scalable online poker game server powered by redis, node.js and socket.io","main":"index.js","scripts":{"start":"node ./bin/casino-server.js","test":"gulp unit-test"},"repository":{"type":"git","url":"git://github.com/floatinghotpot/casino-server.git"},"keywords":["casino","poker","game","chat"],"author":{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com","url":"http://floatinghotpot.github.io/"},"contributors":[{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com"}],"license":"MIT","bugs":{"url":"https://github.com/floatinghotpot/casino-server/issues"},"dependencies":{"minimist":"^1.1.0","express":"^4.10.4","redis":"^0.12.1","socket.io":"^1.2.1","socket.io-redis":"^0.1.4"},"devDependencies":{"gulp":"^3.8.10","gulp-jasmine":"^1.0.1","gulp-concat":"^2.4.2","gulp-jshint":"^1.9.0","gulp-myth":"^1.0.2","gulp-minify-css":"^0.3.11","gulp-uglify":"^1.0.2","vinyl-source-stream":"^1.0.0","jasmine-reporters":"^1.0.1","browserify":"^7.0.0","browser-sync":"^1.7.2","del":"^1.1.0","read":"^1.0.5"},"analyze":false,"preferGlobal":"true","bin":{"casino-server":"./bin/casino-server.js","casino":"./bin/casino-server.js"},"gitHead":"47ecc1c7b81cc862796efb59883ac92c8975742d","homepage":"https://github.com/floatinghotpot/casino-server#readme","_id":"casino-server@0.1.5","_shasum":"d53a69dfebbf62666d3eb3ef38c18d2ced6291aa","_from":".","_npmVersion":"2.9.0","_nodeVersion":"0.12.2","_npmUser":{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"},"dist":{"shasum":"d53a69dfebbf62666d3eb3ef38c18d2ced6291aa","tarball":"https://registry.npmjs.org/casino-server/-/casino-server-0.1.5.tgz","integrity":"sha512-zlTEnfmR/N1DdqO6Aoh6R/86P8FK2GofAlqZIoHZOrgkloE6lGqGz9T3ICQT1URU2zneKj/7pRJSjqXXPxzyIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1EOn6hXl+Srs57wkz0jBypppzLQEeEyzWOkFUz9SlqAiA12NRShFvSl4d8zWzKNHApZuX9P0awsW9mHaEobqaAaQ=="}]},"maintainers":[{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"}]},"0.1.6":{"name":"casino-server","version":"0.1.6","description":"An multi-rule scalable online poker game server powered by redis, node.js and socket.io","main":"index.js","scripts":{"start":"node ./bin/casino-server.js","test":"gulp unit-test"},"repository":{"type":"git","url":"git://github.com/floatinghotpot/casino-server.git"},"keywords":["casino","poker","game","chat"],"author":{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com","url":"http://floatinghotpot.github.io/"},"contributors":[{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com"}],"license":"MIT","bugs":{"url":"https://github.com/floatinghotpot/casino-server/issues"},"dependencies":{"minimist":"^1.1.0","express":"^4.10.4","redis":"^0.12.1","socket.io":"^1.2.1","socket.io-redis":"^0.1.4"},"devDependencies":{"gulp":"^3.8.10","gulp-jasmine":"^1.0.1","gulp-concat":"^2.4.2","gulp-jshint":"^1.9.0","gulp-myth":"^1.0.2","gulp-minify-css":"^0.3.11","gulp-uglify":"^1.0.2","vinyl-source-stream":"^1.0.0","jasmine-reporters":"^1.0.1","browserify":"^7.0.0","browser-sync":"^1.7.2","del":"^1.1.0","read":"^1.0.5"},"analyze":false,"preferGlobal":"true","bin":{"casino-server":"./bin/casino-server.js","casino":"./bin/casino-server.js"},"gitHead":"61ac89d12a9ba09d8438e082cbf0fb26d4eda4dd","homepage":"https://github.com/floatinghotpot/casino-server#readme","_id":"casino-server@0.1.6","_shasum":"97517b8f832a89f4d79c3d94da9541a4fa141b43","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.0","_npmUser":{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"},"maintainers":[{"name":"floatinghotpot","email":"rjfun.mobile@gmail.com"}],"dist":{"shasum":"97517b8f832a89f4d79c3d94da9541a4fa141b43","tarball":"https://registry.npmjs.org/casino-server/-/casino-server-0.1.6.tgz","integrity":"sha512-UYrq/BZQK6RTnclY5rUHU0+ukijpIKVaqwoo46VQakAblu8C2mU8WZ15e1UvtmrJydp6STIflkDukxOWCAZN8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvJIP8u/Q+f9KwHE24KfNWToRqGFDIwhFYDk0JIp18wAiAqRqSWNd0mlIKq2xuRVSdJHsffC8aeErs2X6TUOWkcBw=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/casino-server-0.1.6.tgz_1495573756308_0.3270977570209652"}}},"homepage":"https://github.com/floatinghotpot/casino-server#readme","keywords":["casino","poker","game","chat"],"repository":{"type":"git","url":"git://github.com/floatinghotpot/casino-server.git"},"contributors":[{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com"}],"author":{"name":"Raymond Xie","email":"rjfun.mobile@gmail.com","url":"http://floatinghotpot.github.io/"},"bugs":{"url":"https://github.com/floatinghotpot/casino-server/issues"},"license":"MIT","readmeFilename":"README.md","users":{"kevbaker":true,"floatinghotpot":true,"jlsjonas":true,"codeamancoder":true}}