diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-10 18:05:12 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-10 18:05:12 +0800 |
commit | 0a50f91422cc78e215c541d08dbf30fdeb91477c (patch) | |
tree | 9b09fa98181fe6ef345109eb0c279d3628889c09 /mbbsd/ch_go.c | |
parent | 78a17f4498134b9db1fc95e7be14798422475475 (diff) | |
parent | f115309f094fb58ce49a14a24d58144aa13d3e5c (diff) | |
download | pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.tar pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.tar.gz pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.tar.bz2 pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.tar.lz pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.tar.xz pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.tar.zst pttbbs-0a50f91422cc78e215c541d08dbf30fdeb91477c.zip |
* make pwcu branch as trunk.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4826 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/ch_go.c')
-rw-r--r-- | mbbsd/ch_go.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/mbbsd/ch_go.c b/mbbsd/ch_go.c index 9c7256cd..308061b8 100644 --- a/mbbsd/ch_go.c +++ b/mbbsd/ch_go.c @@ -793,35 +793,14 @@ go_post_game(ChessInfo* info) } static void -go_usr_put(userec_t* userec, const ChessUser* user) -{ - userec->go_win = user->win; - userec->go_lose = user->lose; - userec->go_tie = user->tie; -} - -static void go_gameend(ChessInfo* info, ChessGameResult result) { if (info->mode == CHESS_MODE_VERSUS) { - ChessUser* const user1 = &info->user1; - /* ChessUser* const user2 = &info->user2; */ - - user1->lose--; - if (result == CHESS_RESULT_WIN) { - user1->win++; - currutmp->go_win++; - } else if (result == CHESS_RESULT_LOST) { - user1->lose++; - currutmp->go_lose++; - } else { - user1->tie++; - currutmp->go_tie++; - } - go_usr_put(&cuser, user1); + // lost was already initialized + if (result != CHESS_RESULT_LOST) + pwcuChessResult(SIG_GO, result); - passwd_sync_update(usernum, &cuser); } else if (info->mode == CHESS_MODE_REPLAY) { free(info->board); free(info->tag); @@ -936,9 +915,7 @@ gochess(int s, ChessGameMode mode) if (info->mode == CHESS_MODE_VERSUS) { /* Assume that info->user1 is me. */ info->user1.lose++; - passwd_sync_query(usernum, &cuser); - go_usr_put(&cuser, &info->user1); - passwd_sync_update(usernum, &cuser); + pwcuChessResult(SIG_GO, CHESS_RESULT_LOST); } if (mode == CHESS_MODE_WATCH) |