diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-24 03:43:10 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-24 03:43:10 +0800 |
commit | dcce445703588499ffcd2a3de2e1df2410deb6d9 (patch) | |
tree | fd071b47ded42b246bf718cdd70e63e3cc2d97a7 /mbbsd/chc.c | |
parent | fab6b7c672366015ca996d094f9e3509e2e2ac4a (diff) | |
download | pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.tar pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.tar.gz pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.tar.bz2 pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.tar.lz pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.tar.xz pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.tar.zst pttbbs-dcce445703588499ffcd2a3de2e1df2410deb6d9.zip |
log outcome of chess playing
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2527 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chc.c')
-rw-r--r-- | mbbsd/chc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c index cac9f75e..8b74709d 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -854,6 +854,18 @@ mainloop(int s, chcusr_t *user1, chcusr_t *user2, board_t board, play_func_t pla if (chc_mode & CHC_VERSUS) { user1->rating = user1->orig_rating; user1->lose--; + if(chc_my==RED) { + /* 由紅方作 log. 記的是下棋前的原始分數 */ + /* NOTE, 若紅方斷線則無 log */ + time_t t=time(NULL); + char buf[100]; + sprintf(buf, "%s %s(%d,W%d/D%d/L%d) %s %s(%d,W%d/D%d/W%d)\n", ctime(&t), + user1->userid, user1->rating, user1->win, user1->tie, user1->lose, + (endgame==3?"和":endgame==1?"勝":"負"), + user2->userid, user2->rating, user2->win, user2->tie, user2->lose); + buf[24]=' '; // replace '\n' + log_file(BBSHOME"/log/chc.log", LOG_CREAT, buf); + } if (endgame == 1) { strlcpy(chc_warnmsg, "對方認輸了!", sizeof(chc_warnmsg)); count_chess_elo_rating(user1, user2, 1.0); |