diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-11-16 21:41:07 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-11-16 21:41:07 +0800 |
commit | eaa868e5c10158c2d8ca7fb623b9f522e495a829 (patch) | |
tree | 5032de1e0c62c77e31dc07c35a5bb34bc4cddae2 | |
parent | 64f4260e432c06146fc866eb5c74449a59f3deeb (diff) | |
download | pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.tar pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.tar.gz pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.tar.bz2 pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.tar.lz pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.tar.xz pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.tar.zst pttbbs-eaa868e5c10158c2d8ca7fb623b9f522e495a829.zip |
show ������������ in user list
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@575 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/pttstruct.h | 5 | ||||
-rw-r--r-- | mbbsd/cache.c | 14 | ||||
-rw-r--r-- | mbbsd/chc_play.c | 5 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 5 | ||||
-rw-r--r-- | mbbsd/talk.c | 18 |
5 files changed, 37 insertions, 10 deletions
diff --git a/include/pttstruct.h b/include/pttstruct.h index 7d546415..29984823 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -1,4 +1,4 @@ -/* $Id: pttstruct.h,v 1.26 2002/11/07 09:13:23 in2 Exp $ */ +/* $Id: pttstruct.h,v 1.27 2002/11/16 13:41:06 kcwu Exp $ */ #ifndef INCLUDE_STRUCT_H #define INCLUDE_STRUCT_H @@ -243,6 +243,9 @@ typedef struct userinfo_t { unsigned short int five_win; unsigned short int five_lose; unsigned short int five_tie; + unsigned short int chc_win; + unsigned short int chc_lose; + unsigned short int chc_tie; int mailalert; int sex; char color; diff --git a/mbbsd/cache.c b/mbbsd/cache.c index ff3a8340..1289dd51 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.52 2002/10/23 17:10:04 in2 Exp $ */ +/* $Id: cache.c,v 1.53 2002/11/16 13:41:07 kcwu Exp $ */ #include "bbs.h" #ifndef __FreeBSD__ @@ -374,6 +374,17 @@ cmputmpfive(const void *i, const void *j) } static int +cmputmpchc(const void *i, const void *j) +{ + int type; + if ((type = (*((userinfo_t **) j))->chc_win - (*((userinfo_t **) i))->chc_win)) + return type; + if ((type = (*((userinfo_t **) i))->chc_lose - (*((userinfo_t **) j))->chc_lose)) + return type; + return (*((userinfo_t **) i))->chc_tie - (*((userinfo_t **) j))->chc_tie; +} + +static int cmputmppid(const void *i, const void *j) { return (*((userinfo_t **) i))->pid - (*((userinfo_t **) j))->pid; @@ -422,6 +433,7 @@ sort_utmp() qsort(SHM->sorted[ns][2], count, sizeof(userinfo_t *), cmputmpidle); qsort(SHM->sorted[ns][3], count, sizeof(userinfo_t *), cmputmpfrom); qsort(SHM->sorted[ns][4], count, sizeof(userinfo_t *), cmputmpfive); + qsort(SHM->sorted[ns][5], count, sizeof(userinfo_t *), cmputmpchc); qsort(SHM->sorted[ns][6], count, sizeof(userinfo_t *), cmputmpuid); qsort(SHM->sorted[ns][7], count, sizeof(userinfo_t *), cmputmppid); SHM->currsorted = ns; diff --git a/mbbsd/chc_play.c b/mbbsd/chc_play.c index 74a9aadb..08eead20 100644 --- a/mbbsd/chc_play.c +++ b/mbbsd/chc_play.c @@ -1,4 +1,4 @@ -/* $Id: chc_play.c,v 1.6 2002/07/21 09:26:02 in2 Exp $ */ +/* $Id: chc_play.c,v 1.7 2002/11/16 13:41:07 kcwu Exp $ */ #include "bbs.h" typedef int (*play_func_t) (int, board_t, board_t); @@ -201,12 +201,15 @@ mainloop(int s, board_t board) if (endgame == 1) { strlcpy(chc_warnmsg, "¹ï¤è»{¿é¤F!", sizeof(chc_warnmsg)); cuser.chc_win++; + currutmp->chc_win++; } else if (endgame == 2) { strlcpy(chc_warnmsg, "§A»{¿é¤F!", sizeof(chc_warnmsg)); cuser.chc_lose++; + currutmp->chc_lose++; } else { strlcpy(chc_warnmsg, "©M´Ñ", sizeof(chc_warnmsg)); cuser.chc_tie++; + currutmp->chc_tie++; } cuser.chc_lose--; passwd_update(usernum, &cuser); diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 0adb2756..0f2cd58f 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.58 2002/09/26 16:18:36 in2 Exp $ */ +/* $Id: mbbsd.c,v 1.59 2002/11/16 13:41:07 kcwu Exp $ */ #include "bbs.h" #define SOCKET_QLEN 4 @@ -723,6 +723,9 @@ setup_utmp(int mode) uinfo.five_win = cuser.five_win; uinfo.five_lose = cuser.five_lose; uinfo.five_tie = cuser.five_tie; + uinfo.chc_win = cuser.chc_win; + uinfo.chc_lose = cuser.chc_lose; + uinfo.chc_tie = cuser.chc_tie; uinfo.invisible = cuser.invisible % 2; uinfo.pager = cuser.pager % 5; memcpy(uinfo.mind, cuser.mind, 4); diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 52f35173..76c1276f 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.94 2002/09/20 13:37:46 in2 Exp $ */ +/* $Id: talk.c,v 1.95 2002/11/16 13:41:07 kcwu Exp $ */ #include "bbs.h" #define QCAST int (*)(const void *, const void *) @@ -10,7 +10,7 @@ static char *sig_des[] = { "°«Âû", "²á¤Ñ", "", "¤U´Ñ", "¶H´Ñ", "·t´Ñ" }; -#define MAX_SHOW_MODE 3 +#define MAX_SHOW_MODE 4 #define M_INT 15 /* monitor mode update interval */ #define P_INT 20 /* interval to check for page req. in * talk/chat */ @@ -31,7 +31,7 @@ typedef struct pickup_t { /* °O¿ý friend ªº user number */ // -#define PICKUP_WAYS 6 +#define PICKUP_WAYS 7 static char *fcolor[11] = { "", "\033[36m", "\033[32m", "\033[1;32m", @@ -1457,6 +1457,12 @@ descript(int show_mode, userinfo_t * uentp, time_t diff) uentp->five_lose, uentp->five_tie); description[20] = 0; return description; + case 3: + snprintf(description, sizeof(description), + "%3d/%3d/%3d", uentp->chc_win, + uentp->chc_lose, uentp->chc_tie); + description[20] = 0; + return description; default: syslog(LOG_WARNING, "damn!!! what's wrong?? show_mode = %d", show_mode); @@ -1622,10 +1628,10 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, int show_pid, int myfriend, int friendme, int bfriend, int badfriend) { char *msg_pickup_way[PICKUP_WAYS] = { - "¶Ù! ªB¤Í", "ºô¤Í¥N¸¹", "ºô¤Í°ÊºA", "µo§b®É¶¡", "¨Ó¦Û¦ó¤è", "¤¤l´Ñ " + "¶Ù! ªB¤Í", "ºô¤Í¥N¸¹", "ºô¤Í°ÊºA", "µo§b®É¶¡", "¨Ó¦Û¦ó¤è", " ¤¤l´Ñ ", " ¶H´Ñ " }; char *MODE_STRING[MAX_SHOW_MODE] = { - "¬G¶m", "¦n¤Í´yz", "¤¤l´Ñ¾ÔÁZ" + "¬G¶m", "¦n¤Í´yz", "¤¤l´Ñ¾ÔÁZ", "¶H´Ñ¾ÔÁZ" }; char pagerchar[5] = "* -Wf"; @@ -2089,7 +2095,7 @@ userlist(void) break; case 'S': /* Åã¥Ü¦n¤Í´yz */ - show_mode = (++show_mode) % MAX_SHOW_MODE; + show_mode = (show_mode+1) % MAX_SHOW_MODE; redrawall = redraw = 1; break; |