Skip to content
Snippets Groups Projects
Commit 6898c94e authored by mcmlxxix's avatar mcmlxxix
Browse files

Added turn notification, fixed timer display bug, disabled logging

parent 1fe7f705
Branches
Tags
No related merge requests found
......@@ -67,7 +67,7 @@ function ChessLobby()
console.ctrlkey_passthru=oldpass;
bbs.sys_status&=~SS_MOFF;
bbs.sys_status&=~SS_PAUSEOFF;
write(console.ansi(ANSI_NORMAL));
console.attributes=(ANSI_NORMAL);
exit(0);
}
this.InitChat=function()
......
......@@ -299,7 +299,7 @@ function GameSession(game)
this.game.LoadGameTable();
this.game.LoadGameData();
this.InfoBar();
this.ShowTimers();
if(this.game.timed) this.ShowTimers();
}
if(this.queue.DataWaiting("timer"))
{
......@@ -447,6 +447,7 @@ function GameSession(game)
this.SendMove=function(move)
{
this.game.NextTurn();
this.game.NotifyPlayer();
this.board.lastmove=move;
this.game.movelist.push(move);
this.game.StoreGame();
......@@ -1327,7 +1328,7 @@ function ChessGame(gamefile)
}
var fName=chessroot + gNum + ".chs";
this.gamefile=new File(fName);
this.gamenumber=gNum;
this.gamenumber=parseInt(gNum);
}
this.StoreGame=function()
{
......@@ -1446,6 +1447,18 @@ function ChessGame(gamefile)
}
gFile.close();
}
this.NotifyPlayer=function()
{
var nextturn=this.players[this.turn];
if(!chesschat.FindUser(nextturn.id))
{
var uname=chessplayers.players[nextturn.id].name;
var unum=system.matchuser(uname);
var message="\1n\1yIt is your turn in \1hChess\1n\1y game #\1h" + this.gamenumber + "\r\n\r\n";
system.put_telegram(unum, message);
//TODO: make this handle interbbs games if possible
}
}
this.NewGame=function()
{
this.board=new ChessBoard();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment