From 2d360031b079b8f6181d1d5e244d617dd47cefe8 Mon Sep 17 00:00:00 2001 From: scw Date: Thu, 12 Aug 2004 13:03:28 +0000 Subject: Chess country basic things constructing. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2162 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/admin.c | 20 ++++++++++++++++++++ mbbsd/osdep.c | 2 +- mbbsd/stuff.c | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/admin.c b/mbbsd/admin.c index bfc7f9ea..d193384b 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -492,6 +492,16 @@ m_mod_board(char *bname) trim(genbuf); strlcpy(newbh.BM, genbuf, sizeof(newbh.BM)); } +#ifdef CHESSCOUNTRY + snprintf(genbuf, sizeof(genbuf), "%d", bh.chesscountry); + if (getdata_str(16, 0, "設定棋國 (0)無 (1)五子棋 (2)象棋", ans, + sizeof(ans), LCECHO, genbuf)){ + newbh.chesscountry = atoi(ans); + if (newbh.chesscountry > CHESSCODE_MAX || + newbh.chesscountry < CHESSCODE_NONE) + newbh.chesscountry = bh.chesscountry; + } +#endif /* defined(CHESSCOUNTRY) */ if (HAS_PERM(PERM_SYSOP)) { move(1, 0); clrtobot(); @@ -523,6 +533,7 @@ m_mod_board(char *bname) clear(); } } + getdata(b_lines - 1, 0, "請您確定(Y/N)?[Y]", genbuf, 4, LCECHO); if ((*genbuf != 'n') && memcmp(&newbh, &bh, sizeof(bh))) { @@ -780,6 +791,15 @@ m_newbrd(int recover) newboard.level = 0; getdata(11, 0, "板主名單:", newboard.BM, sizeof(newboard.BM), DOECHO); +#ifdef CHESSCOUNTRY + if (getdata_str(12, 0, "設定棋國 (0)無 (1)五子棋 (2)象棋", ans, + sizeof(ans), LCECHO, "0")){ + newboard.chesscountry = atoi(ans); + if (newboard.chesscountry > CHESSCODE_MAX || + newboard.chesscountry < CHESSCODE_NONE) + newboard.chesscountry = CHESSCODE_NONE; + } +#endif /* defined(CHESSCOUNTRY) */ if (HAS_PERM(PERM_SYSOP) && !(newboard.brdattr & BRD_HIDE)) { getdata_str(14, 0, "設定讀寫權限(Y/N)?", ans, sizeof(ans), LCECHO, "N"); diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c index 4647d198..fb5ce17c 100644 --- a/mbbsd/osdep.c +++ b/mbbsd/osdep.c @@ -228,7 +228,7 @@ swapused(int *total, long *used) if ((fp = fopen("/proc/meminfo", "r"))) { while (fgets(buf, 100, fp) && buf[0] != 'S'); - if (sscanf(buf + 6, "%ld %ld", total, used) == 2) + if (sscanf(buf + 6, "%d %ld", total, used) == 2) if (*total != 0) percent = (double)*used / (double)*total; fclose(fp); diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index a369affb..5e2048f5 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -31,7 +31,7 @@ sethomeman(char *buf, char *userid) void -sethomefile(char *buf, char *userid, char *fname) +sethomefile(char *buf, char *userid, const char *fname) { sprintf(buf, str_home_file, userid[0], userid, fname); } -- cgit v1.2.3