Giter Club home page Giter Club logo

game-server's Introduction

Poker Game Hackathon.

Build and Start Poker Server

cd server-npm npm install node server.js

Build and Start Poker Client

cd client-npm npm install node client.js

Start Poker Game

cd client-npm node observe-and-start-game.js

GameState JSON

Example JSON that is used to represent the game state

Notes: Every player will only see his own hole_cards and api_key.

{
	"game_id": "550da1cb2d909006e90004b1",
	"small_blind": 10,
	"big_blind": 20,
	"largest_current_bet": 300,
	"pots": [{
		"size": 450,
		"eligible_players": [1, 2]
	}],
	"minimum_raise": 500,
	"dealer": 1,
	"in_action": 0,
	"game_started": true,
	"hand_started": true,
	"end_of_hand": true,
	"players": [{
			"id": 0,
			"uuid": "CpTKgYbvJhXrUBXdPLM64g==",
			"name": "Anne",
			"status": "active",
			"stack": 1010,
			"bet": 0,
			"hole_cards": ["7d", "2c"],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		},
		{
			"id": 1,
			"name": "Ben",
			"uuid": "koiugyhjokplkjnbnk",
			"status": "active",
			"stack": 1500,
			"bet": 0,
			"hole_cards": ["Qc", "Qh"],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		},
		{
			"id": 2,
			"uuid": "uyftcvhjkljhuyui",
			"name": "Charlotte",
			"status": "active",
			"stack": 2000,
			"bet": 50,
			"hole_cards": ["Js", "Ks"],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		},
		{
			"id": 3,
			"uuid": "uyftcvhjkljhuyui",
			"name": "David",
			"status": "active",
			"stack": 2140,
			"bet": 100,
			"hole_cards": ["3h", "4s"],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		},
		{
			"id": 4,
			"uuid": "uyftcvhjkljhuyui",
			"name": "Elisa",
			"status": "active",
			"stack": 3600,
			"bet": 300,
			"hole_cards": ["Ah", "Kh"],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		},
		{
			"id": 5,
			"uuid": "uyftcvhjkljhuyui",
			"name": "Finn",
			"status": "folded",
			"stack": 550,
			"bet": 0,
			"hole_cards": ["8d", "Td"],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		},
		{
			"id": 6,
			"uuid": "uyftcvhjkljhuyui",
			"name": "Gregory",
			"status": "out",
			"stack": 0,
			"bet": 0,
			"hole_cards": [],
			"api_key": "YDs)giYcQ0O|J=bhg:Tkrru(T&6K9]"
		}
	],
	"board": ["Ad", "Qd", "9h", "9d", "Jc"],
	"ranking": [{
			"uuid": "DbcxjB5jHkLwSrEfJQYDsQ==",
			"name": "Anne",
			"cards": "6s 2s 6c 6d Qc 9c As",
			"description": "Three of a Kind",
			"rank": 5
		},
		{
			"uuid": "6TfNIrn3arUhOl7wEzjCSw==",
			"name": "Ben",
			"cards": "Kh 2c 6c 6d Qc 9c As",
			"description": "One Pair",
			"rank": 7
		}
	],
	"chat": [{
			"timestamp": 1573771593227,
			"msg": "Ben placed a bet of 50"
		},
		{
			"timestamp": 1573771593227,
			"msg": "Anne called"
		}, {
			"timestamp": 1573771593227,
			"msg": "Anne wins 500 chips with Three of a kind"
		}
	],
	"final_ranking": [{
		"id": 0,
		"uuid": "CpTKgYbvJhXrUBXdPLM64g==",
		"name": "Anne"
	}, {
		"id": 1,
		"uuid": "CpTKgYbvJhXrUBXdPLM64g==",
		"name": "Ben"
	}, {
		"id": 2,
		"uuid": "CpTKgYbvJhXrUBXdPLM64g==",
		"name": "Charlotte"
	}]

}

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.