Git Product home page Git Product logo

casino-server's Introduction

casino-server

npm version

Build Status

NPM

An online poker game server powered by redis, node.js and socket.io

A A A

Game rules supported:

  • Chat Room (聊天室)
  • Jinhua (诈金花/三张牌)
  • Texas Holdem (德州扑克)
  • Fight Landlord (斗地主)
  • Blackjack (21点)

Features:

  • Cross-platform: powered by node.js, easy to deploy on various platforms.
  • Scalable: using Redis as message bus and data storage.
  • Open architecture: with Redis as the message bus, easy to interact and extend.
  • Cluster: using PM2, sticky session, and socket.io-redis.
  • WebSocket protocol: come with javascript client API and web-based demo.
  • Event logger for server events and user actions.

TODO List:

  • Client API for Unity3D (C#, support mono/.NET2.0)
  • Payment gateway callback URL.
  • Admin Portal.
  • Load balancing: using NginX, or auto handled if deployed to Amazon Cloud.

Architecture

Architecture

Required

  • Redis

Redis 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.

Download

  • node.js / npm

Node.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.

Download

  • PM2 (production & cluster)

PM2 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.

Read More

Installation

  • Installing globally and run as service with PM2:
[sudo] npm install pm2 -g
[sudo] npm install casino-server -g

# run redis-server first
redis-server &

# run as service and cluster mode
pm2 start `which casino-server` -i 0
  • Installing as a node app, and run in current folder:
git clone https://github.com/floatinghotpot/casino-server.git casino
cd casino
npm install
# sudo npm install -g gulp
# gulp build
node bin/casino-server [options]

Now you can visit http://localhost:7000, it's a web-based game client for testing and demo purpose.

# open a browser to access the test web page
open http://localhost:7000/

Available Options:

-p Port to use (defaults to 7000)

-h Host address to use (defaults to 0.0.0.0)

-r Address of Redis server (defaults to 127.0.0.1:6379)

Tools

With Redis as the message bus, it's very easy for tools to work with the open architecture.

Event Logger

Start the event logger to monitor the events:

bin/logger.js

Or, log the events into log file:

bin/logger.js -o ./tmp/casino.log

See Also

  • socket.io for Unity3D, 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.

Credits

This poker game server is created by Raymond Xie, published under MIT license.

It can be used for FREE, but be aware that:

  • It is provided as it is. (Not a mature commercial product, may be incomplete, or even lots of bugs)
  • We will mainly focus on our own needs.
  • 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.
  • You need take your own risk, including that you need find answers from reading code instead of easily asking only. :P

If you are interested in this project, you can contribute in any of following aspects:

  • Simply "Star" it.
  • Use it or test it, report bugs or even send pull request of patches.
  • Add better HTML5 demo client.
  • Add new poker game rules.
  • Add client APIs in other languages (like C# for Unity, Java, Objective-C, C/C++, etc.)
  • Help us write documentation, if your English is good.

casino-server's People

Contributors

floatinghotpot avatar xphoniex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

casino-server's Issues

TypeError: socketio.listen is not a function

PS C:\Users\chalu\OneDrive\Desktop\casino_server> node bin/casino-server
C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\index.js:602
                throw err;
                ^

TypeError: socketio.listen is not a function
    at LoginServer.startInstance (C:\Users\chalu\OneDrive\Desktop\casino_server\lib\login_server.js:76:30)
    at C:\Users\chalu\OneDrive\Desktop\casino_server\lib\login_server.js:150:10
    at try_callback (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\index.js:592:9)
    at RedisClient.return_reply (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\index.js:685:13)
    at ReplyParser.<anonymous> (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\index.js:321:14)
    at ReplyParser.emit (node:events:513:28)
    at ReplyParser.send_reply (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\lib\parser\javascript.js:300:10)
    at ReplyParser.execute (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\lib\parser\javascript.js:189:22)
    at RedisClient.on_data (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\index.js:547:27)
    at Socket.<anonymous> (C:\Users\chalu\OneDrive\Desktop\casino_server\node_modules\redis\index.js:102:14)

Hi-card calculation wrong in case of pair in shared cards, and no combinations in both players :(

POKER:
Example:
Shared cards: A J 3 Q 3 (30, 27, 51, 44, 67)
player1 cards: 8 5 (72, 37)
player2 cards: 8 2 (56, 34)

player 2 win with message (rank): "one pair". It's wrong. See screenshot.
I think, the payer 1 must win with: highcard.

screen shot 2015-07-04 at 16 13 39

Also, i think, i'm found missing code for Holdem.sort function, then we need check last pair for double.
need to add at bottom of if block:
else if (d3 === 0) {
// ABCXX -> XXABC
for(var i=0; i<3; i++) cards.push( cards.shift() );
} else {
// ABCDE
}

There's no room or any other UI component

I see only the language dropdown and my own user on the right side. No other user is displayed although I logged in from 5 different computers. Further, when I click on the "games" button, nothing happens. Do I need to create the rooms somewhere before I can see the other UI elements?
screenshot from 2017-05-16 18 42 34

List of current problems I have found Jan 2019

  1. No automatic Check/Fold

Redundant infinite cycling of players turn or "timer allocated for players to make a decision" if one or more players fails to make a decision. A decision includes the following fold, check, call, or raise.

Solution:
After a players timer of '20 seconds" has expired they must automatically check/fold, that is check or fold.

Server should automatically check if there is no required additional wager during players turn in order to match previous players bets or blinds.

This means that during any post flop round no players before them placed a bet. All preceding players checked or folded.

The only player that can check preflop is the big blind assuming that nobody raised above the big blind wager.

In simple terms if the player is not required to make a wager during their turn after the timer they will automatically check.

If the player is required to place a bet during their turn for the round to progress then after the timer they automatically fold. So if there is any betting and a player fails to call, raise or fold then after the timer is up they will automatically fold.

Preflop if they did not post the blind they are required to match the blind and additional bets. If they fail to call or bet/raise they will automatically fold after timer expires. This is unless they placed the (100 blind) and no other players wagered/bet more than the blind.

  1. Failed "all in" functionality

For players that dont have a sufficient balance to match the all in amount they are forced to fold and cannot wager their remaining balance.

Solution: EASIEST WITHOUT SIDE POTS
If any active player (has not folded) makes a "all in" bet the value can only be equal to the lowest account balance of any active player at the table.

Eg:
player 1 has a balance of 10,000
Player 2 has a balance of 7,000
Player 3 has a balance of 20

Any player betting all in can only wager 20.

If player 3 has folded in a previous round then player 3 is not active and player 1 and 2 can wager 7,000 when betting all in. Since player 3 is not active the lowest active players balance is 7,000 and thus the default all in value.

  1. This was written about before but players with negative balances are sill allowed in the game. If player balance < 100 then player cannot click ready. They will get the same notification as a player gets when trying to sit down or join a room with no chips.

I really wish I could code. I am willing to help out in any way possible. I have a very strong understanding of the game and I'm from the US so my English is quite good. I can see the code gets a bit crazy in the all in functionality and I will look for other easier solutions so that it doesn't break down the game.

Some questions..

Hey, you did a nice job but when you will implement the Texas Holdem game mode ?

Documentation?

Hey guys,

thanks for the project, I was able to run it.
Actually, I'm currently developing a GUI for holdem and I'm searching for a suitable backend.
But the problem is, that I can not find any docs about your game protocol. I guess I have to reverse engineer that .... so therefore its faster to create my own. Sorry guys, but you really need to improve that.
Best,

Dan

Casino

Well! You can find many online casino slots at one of the reputed places, which is https://casinosanalyzer.com/free-slots-online. They would provide you with many online popular slots that you can play easily by going through the link provided above.

i cant run application

hi
how i can run redis server in windows?
i cant run app and i get Rediss Connection to localhost:6379 faild - connet ECONNREFUSED 127.0.0.1:6379
i use cmd in windows
thanks

Redis persistence store

I Am pretty new to redis, does the game store account info and player info as redis persistence store or is everything lost when the computer is shut down?

I can not login

db.hgetall(uid_key, function(err,userinfo) returned userinfo and err as null. Why it can happen?
2015-09-03 14 55 25

card comparison description bug

Then the game is over, and some one have combination of "Three of a kind", server it detect as FLUSH. But it is not flush, just free equal cards. :(

Some questions regarding GUI

Hi Raymond Xie,

First of all nice work, putting this all together. I studied your code and it's very clean code. I tested your frontend app as well. And based on that I am creating an interactive frontend app. And I have reached to a certain stage, but faced a problem there.

In my GUI Let's say user1 bets and user2 calls and the chips moves to middle and become the pot chips. now when user1 bet again I want to only show the new bet chips (not all chips that he betted). That I am also able to achieve by storing it from the call, raise event.

But if somehow my window is refreshed or socket not responded then in that case there is no property to see the last bet user1 has placed / user2 has called. I see a pot_chips in room details but that's just an array of all the bets. It's not associated with user/seat.

I hope you understood my problem. If so, can you guide me to the right direction on how to achieve it.

Also I have some suggestions/improvements that I can contribute to this project. How can I do that? Shall I send you pull request or create a discussion board.

Thanks in Advance.

redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379

PS X:\casino> node bin/casino-server
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
PS X:\casino> node bin/casino-server -p
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error: Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
redis error (db):Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (pub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
redis error (sub): Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at RedisClient.on_error (X:\casino\node_modules\redis\index.js:196:24)
    at Socket.<anonymous> (X:\casino\node_modules\redis\index.js:106:14)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
PS X:\casino>

Stable enough?

Hello,
is this project stable enough to use in a product ?
Is there any known bugs for the different games?

regards zilveer

Can not 'fastsignup'

I get this error when try to signup. I'm using Unity c# as a client.

ERROR:
{
"err": 400,
"ret": "invalid rpc req"
}

I am sending this as a string to Emit:
{"seq":1,"uid":0,"pin":0,"f":"fastsignup","args":0}

About websockets

Can you lighten me up with few words how do I actually can use websockets from mobile side for example android.

I only need to know about for instance, whats the actual "api" address for websocket protocol and is it ws:// schema starting. I'm new to websocket and I don't want to know all by asking, I'm going to do my own research.

Web client example seems pretty clear to me but it's socket.io at your image. Socket.io is similar to websockets or completely different method?

Thanks for awesome server platform!

GUI ?

Hi there Ray,

Is this code have GUI as well or it's just server like u said. I am interested in paying some freelancer to build me poker game, so thats why I am asking.

There is no proper documentation.

I want to use this server to use in my Unity3D game. I need to see which strings to be used in socket.emit to send to server. I don't even know how to "fastsignup" to the server.
Can anyone help me with this?

Regards,
Dan.

Players with a negative balance can blind bet..

Once the game is over and someone lost everything to zero, they still at the table.

And the player with zero balance can press ready(!), the game begins, zero balance will turn into a negative (because of the blind bets).
Can server throw players with a negative or zero balance from the table, after the game ends?

DON'T USE PLUGIN FROM THIS GUY, HE STEALS 30% OF YOUR MONEY!

Hi every one, don't use
https://github.com/floatinghotpot/cordova-plugin-facebookads
or
https://github.com/floatinghotpot/cordova-admob-pro

These plugins includes a precompiled .jar for "license system check" that share with the plugin author 30% of you traffic.

If you sniff the http traffic of your app with the plugin installed, you'll notice an http request to http://adlic.rjfun.com/adlic that returns a response with a "r" parameters set to "30". This means that you are sharing the 30% of you traffic.

I know that the license says the if you don't pay the 20$ license, you are agree with sharing the 2% of you traffic.

If use in commercial project, please get a license, or, you have monetized more than $1000 using this plugin, you are also required to: either get a commercial license ($20), or, no need pay but share 2% Ad traffic, read the License Agreement for details. As a commercial customer, you will be supported with high priority, via private email or even Skype chat.

BUT 30% is NOT 2%!!!

I found out that a guy on ionic forum had exactly the same problem. The plugin author remove his issue and then removed the issue tab from admob pro.
Here's the topic:
https://forum.ionicframework.com/t/don-t-use-admob-pro-plugin-steal-30/90245

And here's the pdf with the emails that he wrote to the plugin author:
https://drive.google.com/file/d/0B5vtpya8P4b-NUZTdUhBVkFlU0E/view?usp=sharing

I tried to write 3/4 emails to the plugin author 3 weeks ago asking for explainations, but still got no answer.

I believe this is very incorrect, a real scam.

Payment gateway

Hi, is there any kind of payment gateway to this app?
If not how is it easiest to achieve?

Regards

All-in bets goes to freeze game progress..

In no-limit game/pot-limit game, if one player, who have more coins than other, makes the all-in bet,
( or (in pot-limit) raise maximum possible summ )
Other players with less coins, can't move. They have only one way - fold / exit.
The check button do nothing, except reset countdown, and the button all-in/raise also does not appear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.