summaryrefslogtreecommitdiffstats
path: root/mbbsd/user.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-30 20:47:31 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-30 20:47:31 +0800
commit48b5100a347dfb5bb48a4d695a44c81e4378d69d (patch)
tree9eb7d4c6a9965ea15978afd7996310f1df0a2be0 /mbbsd/user.c
parentbe508920d9516539c9423d351fa2ba7fe2b910e1 (diff)
downloadpttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.tar
pttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.tar.gz
pttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.tar.bz2
pttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.tar.lz
pttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.tar.xz
pttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.tar.zst
pttbbs-48b5100a347dfb5bb48a4d695a44c81e4378d69d.zip
* allow setting chess_go results and lastlogin
git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4801 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r--mbbsd/user.c60
1 files changed, 58 insertions, 2 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 386e5a23..ef73930f 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -821,6 +821,32 @@ uinfo_query(const char *orig_uid, int adminmode, int unum)
getdata_buf(y++, 0, "最近光臨機器:",
x.lasthost, sizeof(x.lasthost), DOECHO);
+ while (1) {
+ struct tm t = {0};
+ time4_t clk = x.lastlogin;
+ localtime4_r(&clk, &t);
+ snprintf(genbuf, sizeof(genbuf), "%04i/%02i/%02i %02i:%02i:%02i",
+ t.tm_year + 1900, t.tm_mon+1, t.tm_mday,
+ t.tm_hour, t.tm_min, t.tm_sec);
+ if (getdata_str(y, 0, "最近上線時間:", buf, 20, DOECHO, genbuf) != 0) {
+ int y, m, d, hh, mm, ss;
+ if (ParseDateTime(buf, &y, &m, &d, &hh, &mm, &ss))
+ continue;
+ t.tm_year = y-1900;
+ t.tm_mon = m-1;
+ t.tm_mday = d;
+ t.tm_hour = hh;
+ t.tm_min = mm;
+ t.tm_sec = ss;
+ clk = mktime(&t);
+ if (!clk)
+ continue;
+ x.lastlogin= clk;
+ }
+ y++;
+ break;
+ }
+
snprintf(genbuf, sizeof(genbuf), "%d", x.numlogindays);
if (getdata_str(y++, 0, "上線資歷:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)
@@ -831,10 +857,13 @@ uinfo_query(const char *orig_uid, int adminmode, int unum)
x.numposts = tmp;
#ifdef ASSESS
snprintf(genbuf, sizeof(genbuf), "%d", x.badpost);
- if (getdata_str(y++, 0, "惡劣文章數:", buf, 10, DOECHO, genbuf))
+ if (getdata_str(y, 0, "惡劣文章數:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)
x.badpost = tmp;
#endif // ASSESS
+ move(y-1, 0); clrtobot();
+ prints("文章數目: %d (劣: %d)\n",
+ x.numposts, x.badpost);
snprintf(genbuf, sizeof(genbuf), "%d", x.vl_count);
if (getdata_str(y++, 0, "違法記錄:", buf, 10, DOECHO, genbuf))
@@ -864,7 +893,7 @@ uinfo_query(const char *orig_uid, int adminmode, int unum)
}
snprintf(genbuf, sizeof(genbuf),
"%d/%d/%d", x.chc_win, x.chc_lose, x.chc_tie);
- if (getdata_str(y++, 0, "象棋戰績 勝/敗/和:", buf, 16, DOECHO,
+ if (getdata_str(y++, 0, " 象棋 戰績 勝/敗/和:", buf, 16, DOECHO,
genbuf))
while (1) {
char *p;
@@ -883,6 +912,33 @@ uinfo_query(const char *orig_uid, int adminmode, int unum)
x.chc_tie = atoi(p);
break;
}
+ snprintf(genbuf, sizeof(genbuf),
+ "%d/%d/%d", x.go_win, x.go_lose, x.go_tie);
+ if (getdata_str(y++, 0, " 圍棋 戰績 勝/敗/和:", buf, 16, DOECHO,
+ genbuf))
+ while (1) {
+ char *p;
+ char *strtok_pos;
+ p = strtok_r(buf, "/\r\n", &strtok_pos);
+ if (!p)
+ break;
+ x.go_win = atoi(p);
+ p = strtok_r(NULL, "/\r\n", &strtok_pos);
+ if (!p)
+ break;
+ x.go_lose = atoi(p);
+ p = strtok_r(NULL, "/\r\n", &strtok_pos);
+ if (!p)
+ break;
+ x.go_tie = atoi(p);
+ break;
+ }
+ y -= 3; // rollback games set to get more space
+ move(y++, 0); clrtobot();
+ prints("棋類: (五子棋)%d/%d/%d (象棋)%d/%d/%d (圍棋)%d/%d/%d\n",
+ x.five_win, x.five_lose, x.five_tie,
+ x.chc_win, x.chc_lose, x.chc_tie,
+ x.go_win, x.go_lose, x.go_tie);
#ifdef FOREIGN_REG
if (getdata_str(y++, 0, "住在 1)台灣 2)其他:", buf, 2, DOECHO, x.uflag2 & FOREIGN ? "2" : "1"))
if ((tmp = atoi(buf)) > 0){