projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix populate.sql
[vchess.git]
/
server
/
sockets.js
diff --git
a/server/sockets.js
b/server/sockets.js
index
25abadb
..
e791293
100644
(file)
--- a/
server/sockets.js
+++ b/
server/sockets.js
@@
-209,6
+209,9
@@
module.exports = function(wss) {
clients[page][rid][rtmpId].socket,
{ code: "askfullgame", from: [sid,tmpId] }
);
clients[page][rid][rtmpId].socket,
{ code: "askfullgame", from: [sid,tmpId] }
);
+ } else {
+ // I'm the only person who have the game for the moment:
+ send(socket, { code: "fullgame", data: { empty: true } });
}
}
break;
}
}
break;
@@
-237,7
+240,8
@@
module.exports = function(wss) {
case "rematchoffer":
case "draw":
// "newgame" message can provide a page (corr Game --> Hall)
case "rematchoffer":
case "draw":
// "newgame" message can provide a page (corr Game --> Hall)
- notifyRoom(obj.page || page, obj.code, {data: obj.data}, obj.excluded);
+ notifyRoom(
+ obj.page || page, obj.code, {data: obj.data}, obj.excluded);
break;
case "rnewgame":
break;
case "rnewgame":
@@
-333,8
+337,8
@@
module.exports = function(wss) {
case "lastate":
{
const pg = obj.target[2] || page; //required for identity and game
case "lastate":
{
const pg = obj.target[2] || page; //required for identity and game
- // NOTE: if in game we ask identity to opponent still in Hall,
- //
but leaving Hall, clients[pg] or clients[pg][target] could be undefined
+ // NOTE: if in game we ask identity to opponent still in Hall,
but
+ //
leaving Hall, clients[pg] or clients[pg][target] could be undef.
if (!!clients[pg] && !!clients[pg][obj.target[0]]) {
send(
clients[pg][obj.target[0]][obj.target[1]].socket,
if (!!clients[pg] && !!clients[pg][obj.target[0]]) {
send(
clients[pg][obj.target[0]][obj.target[1]].socket,