From 45cf571a04e8a8781c1664cc6e993f4a09118e07 Mon Sep 17 00:00:00 2001 From: scw Date: Sun, 4 Jul 2004 07:55:01 +0000 Subject: GO game merged from FPG. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2113 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 9c5d4ce7..f887fd3e 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -7,7 +7,7 @@ static char * const IdleTypeTable[] = { "偶在花呆啦", "情人來電", "覓食中", "拜見周公", "假死狀態", "我在思考" }; static char * const sig_des[] = { - "鬥雞", "聊天", "", "下棋", "象棋", "暗棋" + "鬥雞", "聊天", "", "下棋", "象棋", "暗棋", "下圍棋", }; #define MAX_SHOW_MODE 4 @@ -1386,8 +1386,9 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) outs(msg_usr_left); } else { showplans(uin->userid); - getdata(2, 0, "要和他(她) (T)談天(F)下五子棋(P)鬥寵物" - "(C)下象棋(D)下暗棋(N)沒事找錯人了?[N] ", genbuf, 4, LCECHO); + move(2, 0); + outs("要和他(她) (T)談天(F)下五子棋(P)鬥寵物(C)下象棋(D)下暗棋(G)下圍棋\n"); + getdata(3, 0, " (N)沒事找錯人了?[N] ", genbuf, 4, LCECHO); switch (*genbuf) { case 'y': case 't': @@ -1404,6 +1405,9 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) case 'd': uin->sig = SIG_DARK; break; + case 'g': + uin->sig = SIG_GO; + break; case 'p': reload_chicken(); getuser(uin->userid); @@ -1457,6 +1461,9 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) case SIG_CHC: chc(msgsock, CHC_VERSUS); break; + case SIG_GO: + gochess(msgsock); + break; case SIG_TALK: default: do_talk(msgsock); @@ -2748,9 +2755,9 @@ talkreply(void) " (B) 對不起,我有事情不能跟你 %s\n", sig_des[sig], sig_des[sig]); prints(" (C) 請不要吵我好嗎?" - " (D) 我要離站囉..下次再聊吧.......\n"); + " (D) 我要離站囉..下次再聊吧.......\n"); prints(" (E) 有事嗎?請先來信" - " (F) \033[1;33m我自己輸入理由好了...\033[m\n"); + " (F) \033[1;33m我自己輸入理由好了...\033[m\n"); prints(" (1) %s?先拿100銀兩來" " (2) %s?先拿1000銀兩來..\n\n", sig_des[sig], sig_des[sig]); @@ -2799,6 +2806,9 @@ talkreply(void) case SIG_CHC: chc(a, CHC_VERSUS); break; + case SIG_GO: + gochess(a); + break; case SIG_TALK: default: do_talk(a); -- cgit v1.2.3 From 4400234c5cbc7d8fbc51da99f21b0e38efa9fd4d Mon Sep 17 00:00:00 2001 From: in2 Date: Mon, 5 Jul 2004 05:39:07 +0000 Subject: fix bug in sending a mail in userlist git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2115 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index f887fd3e..f7e89313 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2475,9 +2475,11 @@ userlist(void) case 'm': if (HAS_PERM(PERM_BASIC)) { + char userid[IDLEN + 1]; + strlcpy(userid, uentp->userid, sizeof(userid)); stand_title("寄 信"); - prints("[寄信] 收信人:%s", uentp->userid); - my_send(uentp->userid); + prints("[寄信] 收信人:%s", userid); + my_send(userid); setutmpmode(LUSERS); redrawall = redraw = 1; } -- cgit v1.2.3 From 931c629495f328fcd0a2b6aabf8c80db23707963 Mon Sep 17 00:00:00 2001 From: scw Date: Sat, 10 Jul 2004 06:05:54 +0000 Subject: correcting mode strings. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2119 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index f7e89313..1bd98ce6 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -78,7 +78,7 @@ char * modestring(userinfo_t * uentp, int simple) { static char modestr[40]; - char *notonline = "不在站上"; + static char *const notonline = "不在站上"; register int mode = uentp->mode; register char *word; int fri_stat; @@ -89,6 +89,7 @@ modestring(userinfo_t * uentp, int simple) word = ModeTypeTable[mode % MAX_MODES]; } else word = ModeTypeTable[mode]; + fri_stat = friend_stat(currutmp, uentp); if (!(HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_SEECLOAK)) && ((uentp->invisible || (fri_stat & HRM)) && @@ -101,8 +102,9 @@ modestring(userinfo_t * uentp, int simple) word = modestr; } else if (!mode && *uentp->chatid == 1) { if (!simple) - snprintf(modestr, sizeof(modestr), - "回應 %s", getuserid(uentp->destuid)); + snprintf(modestr, sizeof(modestr), "回應 %s", + isvisible_uid(uentp->destuid) ? + getuserid(uentp->destuid) : "空氣"); else snprintf(modestr, sizeof(modestr), "回應呼叫"); } @@ -131,26 +133,16 @@ modestring(userinfo_t * uentp, int simple) return word; else if (uentp->in_chat && mode == CHATING) snprintf(modestr, sizeof(modestr), "%s (%s)", word, uentp->chatid); - else if (mode == TALK) { + else if (mode == TALK || mode == M_FIVE || mode == CHC || mode == GO + || mode == DARK) { if (!isvisible_uid(uentp->destuid)) /* Leeym 對方(紫色)隱形 */ - snprintf(modestr, sizeof(modestr), "%s", "交談 空氣"); + snprintf(modestr, sizeof(modestr), "%s 空氣", word); /* Leeym * 大家自己發揮吧! */ else snprintf(modestr, sizeof(modestr), "%s %s", word, getuserid(uentp->destuid)); - } else if (mode == M_FIVE) { - if (!isvisible_uid(uentp->destuid)) - snprintf(modestr, sizeof(modestr), "%s", "五子棋 空氣"); - else - snprintf(modestr, sizeof(modestr), "%s %s", word, getuserid(uentp->destuid)); } else if (mode == CHESSWATCHING) { snprintf(modestr, sizeof(modestr), "觀棋"); - } else if (mode == CHC) { - if (isvisible_uid(uentp->destuid)) - snprintf(modestr, sizeof(modestr), "%s", "下象棋"); - else - snprintf(modestr, sizeof(modestr), - "下象棋 %s", getuserid(uentp->destuid)); } else if (mode != PAGE && mode != TQUERY) return word; else -- cgit v1.2.3 From 8d16862e885b22d24432996c8e3039a34b910f2a Mon Sep 17 00:00:00 2001 From: scw Date: Sat, 10 Jul 2004 06:22:10 +0000 Subject: No talk request when playing go and dark. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2120 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 1 + 1 file changed, 1 insertion(+) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 1bd98ce6..78c3c251 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1349,6 +1349,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) if (ch == EDITING || ch == TALK || ch == CHATING || ch == PAGE || ch == MAILALL || ch == MONITOR || ch == M_FIVE || ch == CHC || + ch == DARK || ch == GO || (!ch && (uin->chatid[0] == 1 || uin->chatid[0] == 3)) || uin->lockmode == M_FIVE || uin->lockmode == CHC) { if (ch == CHC) { -- cgit v1.2.3