diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-12 00:25:31 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-12 00:25:31 +0800 |
commit | 5832cb08c4136712641beec501dca2a99aeb0668 (patch) | |
tree | 9b7946d332781a9da5c3b290156206b80ab8fb9e | |
parent | 539bfe465e5b956eb0dbcf77b4d340b340f22173 (diff) | |
download | pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.tar pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.tar.gz pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.tar.bz2 pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.tar.lz pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.tar.xz pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.tar.zst pttbbs-5832cb08c4136712641beec501dca2a99aeb0668.zip |
Gomoku playing screen changed. Money is no longer shown.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2494 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/gomo.c | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index ab08d644..93df4de6 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -398,14 +398,31 @@ gomoku(int fd) "│ 片│", "└──────┘" }; + char country[5], level[11]; setuserfile(genbuf, "photo_fivechess"); fp = fopen(genbuf, "r"); + + if (fp == NULL) { + strcpy(country, "無"); + level[0] = 0; + } else { + for (line = 1; line < 8; ++line) + fgets(genbuf, 200, fp); + fgets(genbuf, 200, fp); + chomp(genbuf); + strlcpy(country, genbuf + 11, 5); /* two chinese words */ + fgets(genbuf, 200, fp); + chomp(genbuf); + strlcpy(level, genbuf + 11, 11); /* five chinese words*/ + rewind(fp); + } + for (line = 2; line < 8; ++line) { move(line, 37); if (fp != NULL) { if (fgets(genbuf, 200, fp)) { - genbuf[strlen(genbuf) - 1] = 0; + chomp(genbuf); prints("%s ", genbuf); } else outs(" "); @@ -417,7 +434,7 @@ gomoku(int fd) case 1: prints("<暱稱> %.16s", cuser.username); break; case 2: prints("<上站> %d", cuser.numlogins); break; case 3: prints("<文章> %d", cuser.numposts); break; - case 4: prints("<財產> %d", cuser.money); break; + case 4: prints("<職位> %-4s %s", country, level); break; case 5: prints("<來源> %.16s", cuser.lasthost); break; } } @@ -433,6 +450,22 @@ gomoku(int fd) sethomefile(genbuf, my->mateid, "photo_fivechess"); fp = fopen(genbuf, "r"); + + if (fp == NULL) { + strcpy(country, "無"); + level[0] = 0; + } else { + for (line = 1; line < 8; ++line) + fgets(genbuf, 200, fp); + fgets(genbuf, 200, fp); + chomp(genbuf); + strlcpy(country, genbuf + 11, 5); /* two chinese words */ + fgets(genbuf, 200, fp); + chomp(genbuf); + strlcpy(level, genbuf + 11, 11); /* five chinese words*/ + rewind(fp); + } + for (line = 11; line < 17; ++line) { move(line, 37); switch (line - 11) { @@ -440,13 +473,13 @@ gomoku(int fd) case 1: prints("<暱稱> %-16.16s ", xuser.username); break; case 2: prints("<上站> %-16d ", xuser.numlogins); break; case 3: prints("<文章> %-16d ", xuser.numposts); break; - case 4: prints("<財產> %-16d ", xuser.money); break; + case 4: prints("<職位> %-4s %-10s ", country, level); break; case 5: prints("<來源> %-16.16s ", xuser.lasthost); break; } if (fp != NULL) { if (fgets(genbuf, 200, fp)) { - genbuf[strlen(genbuf) - 1] = 0; + chomp(genbuf); outs(genbuf); } else outs(" "); |