forked from mdp/JsPoker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplay.js
More file actions
29 lines (24 loc) · 871 Bytes
/
play.js
File metadata and controls
29 lines (24 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var
express = require('express'),
app = express(),
io = require('socket.io').listen(app.listen(3000)),
hbs = require('hbs');
app.engine('html', hbs.__express);
app.set('view engine', 'hbs');
app.set('views', './');
app.use('/public', express.static(__dirname + '/public'));
app.get('/', function(req, res) {
res.render('JsPoker.html');
});
io.on('connection', function(socket) {
socket.once('action', function() {
var tournament = require('./test/tournament')
, MachinePoker = require('./machine-poker')
, ChallBot = require('./players/liveBot')
, challenger = MachinePoker.seats.Live.create(ChallBot, null, socket)
, webNarrator = MachinePoker.observers.webNarrator(socket, challenger.name);
var table = tournament.createTable(challenger, {hands:500});
table.addObserver(webNarrator);
table.start();
});
});