diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-08-12 21:03:28 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-08-12 21:03:28 +0800 |
commit | 2d360031b079b8f6181d1d5e244d617dd47cefe8 (patch) | |
tree | 31b390dc08dd62bd7b26ad430a07f23f4f9be511 /mbbsd | |
parent | 83ded54df48fa434f77831bb8280603973e2e989 (diff) | |
download | pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.tar pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.tar.gz pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.tar.bz2 pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.tar.lz pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.tar.xz pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.tar.zst pttbbs-2d360031b079b8f6181d1d5e244d617dd47cefe8.zip |
Chess country basic things constructing.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2162 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 20 | ||||
-rw-r--r-- | mbbsd/osdep.c | 2 | ||||
-rw-r--r-- | mbbsd/stuff.c | 2 |
3 files changed, 22 insertions, 2 deletions
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); } |