summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-05 10:42:29 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-05 10:42:29 +0800
commitfcb4ca800df95b25e65ad7cb8d9cd04c89be4409 (patch)
tree0b61aea0a74adb768c1ec0e0db3727ae12180f67
parent34b6115e332c9f1de548cf7c143f80cc9cf3e516 (diff)
downloadpttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.tar
pttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.tar.gz
pttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.tar.bz2
pttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.tar.lz
pttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.tar.xz
pttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.tar.zst
pttbbs-fcb4ca800df95b25e65ad7cb8d9cd04c89be4409.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@290 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/board.c32
-rw-r--r--mbbsd/mbbsd.c11
-rw-r--r--mbbsd/talk.c4
3 files changed, 21 insertions, 26 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index af997121..75503b23 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -1,4 +1,4 @@
-/* $Id: board.c,v 1.29 2002/06/04 13:08:33 in2 Exp $ */
+/* $Id: board.c,v 1.30 2002/06/05 02:42:29 ptt Exp $ */
#include "bbs.h"
#define BRC_STRLEN 15 /* Length of board name */
#define BRC_MAXSIZE 24576
@@ -653,26 +653,30 @@ static void dozap(int num){
zapbuf[ptr->bid-1] = (ptr->myattr&BRD_ZAP?0:login_start_time);
}
-void setutmpbid(int bid)
+void delutmpbid(int bid, userinfo_t *utmp)
{
- int id=currutmp->brc_id;
userinfo_t *u;
- if(id)
- {
- if (brdshm->busystate!=1 && now-brdshm->busystate_b[id-1]>=10)
+ if (brdshm->busystate!=1 && now-brdshm->busystate_b[bid-1]>=10)
{
- brdshm->busystate_b[id-1]=now;
- u=bcache[id-1].u;
- if(u!=(void*)currutmp)
+ brdshm->busystate_b[bid-1]=now;
+ u=bcache[bid-1].u;
+ if(u!=(void*)utmp)
{
- for(;u && u->nextbfriend != (void*)currutmp; u=u->nextbfriend);
- if(u) u->nextbfriend = currutmp->nextbfriend;
+ for(;u && u->nextbfriend != (void*)utmp; u=u->nextbfriend);
+ if(u) u->nextbfriend = utmp->nextbfriend;
}
else
- bcache[id-1].u=currutmp->nextbfriend;
- if(bcache[id-1].nuser>0) bcache[id-1].nuser--;
- brdshm->busystate_b[id-1]=0;
+ bcache[bid-1].u=utmp->nextbfriend;
+ if(bcache[bid-1].nuser>0) bcache[bid-1].nuser--;
+ brdshm->busystate_b[bid-1]=0;
}
+}
+
+void setutmpbid(int bid)
+{
+ if(currutmp->brc_id)
+ {
+ delutmpbid(currutmp->brc_id, currutmp);
}
if(bid)
{
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 036976f6..a933b6f3 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.32 2002/06/04 13:08:33 in2 Exp $ */
+/* $Id: mbbsd.c,v 1.33 2002/06/05 02:42:29 ptt Exp $ */
#include "bbs.h"
#define SOCKET_QLEN 4
@@ -724,7 +724,6 @@ setup_utmp (int mode)
uinfo.pid = currpid = getpid ();
uinfo.uid = usernum;
uinfo.mode = currstat = mode;
- uinfo.msgcount = 0;
uinfo.mailalert = load_mailalert (cuser.userid);
if (!(cuser.numlogins % 20) && cuser.userlevel & PERM_BM)
check_BM (); /* Ptt 自動取下離職板主權力 */
@@ -732,26 +731,18 @@ setup_utmp (int mode)
uinfo.userlevel = cuser.userlevel;
uinfo.sex = cuser.sex % 8;
uinfo.lastact = time (NULL);
-
- postrecord.times = 0; /* 計算crosspost數 */
-
strcpy (uinfo.userid, cuser.userid);
strcpy (uinfo.realname, cuser.realname);
strcpy (uinfo.username, cuser.username);
strncpy (uinfo.from, fromhost, 23);
-
uinfo.five_win = cuser.five_win;
uinfo.five_lose = cuser.five_lose;
uinfo.five_tie = cuser.five_tie;
-
uinfo.invisible = cuser.invisible % 2;
uinfo.pager = cuser.pager%5;
uinfo.mind = cuser.mind;
- uinfo.brc_id = 0;
#ifdef WHERE
uinfo.from_alias = where (fromhost);
-#else
- uinfo.from_alias = 0;
#endif
#ifndef FAST_LOGIN
setuserfile (buf, "remoteuser");
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 8b1ee687..3e078ef4 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.66 2002/06/05 02:24:25 ptt Exp $ */
+/* $Id: talk.c,v 1.67 2002/06/05 02:42:29 ptt Exp $ */
#include "bbs.h"
#define QCAST int (*)(const void *, const void *)
@@ -1469,7 +1469,7 @@ int pickup_maxpages(int pickupway, int nfriends)
else
number = utmpshm->number+
(pickupway == 0 ? nfriends : 0);
- return (number-1) / MAXPICKUP;
+ return (number-1) / MAXPICKUP +1;
}
static int pickup_myfriend(pickup_t *friends,