diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-04 17:48:27 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-04 17:48:27 +0800 |
commit | 431ac04533837d4d6bf8d01314f5c3e794e4a2a6 (patch) | |
tree | ea809f1e6a3bfe56fbc4f25d732231e1a6377c81 /mbbsd | |
parent | 911a0f4f78bf10384e32bd96cc2a2742b7005d94 (diff) | |
download | pttbbs-outtacache.tar pttbbs-outtacache.tar.gz pttbbs-outtacache.tar.bz2 pttbbs-outtacache.tar.lz pttbbs-outtacache.tar.xz pttbbs-outtacache.tar.zst pttbbs-outtacache.zip |
completeouttacache
git-svn-id: http://opensvn.csie.org/pttbbs/branches/outtacache@1687 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/cal.c | 7 | ||||
-rw-r--r-- | mbbsd/talk.c | 17 |
2 files changed, 18 insertions, 6 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c index 462818de..43c0d2f5 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -431,9 +431,14 @@ p_sysinfo(void) prints("記憶體用量: sbrk: %d KB, idrss: %d KB, isrss: %d KB\n", ((int)sbrk(0) - 0x8048000) / 1024, (int)ru.ru_idrss, (int)ru.ru_isrss); + prints("特別參數:" #ifdef CRITICAL_MEMORY - prints("目前在 CRITICAL_MEMORY 模式下\n"); + " CRITICAL_MEMORY" #endif +#ifdef OUTTACACHE + " OUTTACACHE" +#endif + ); } pressanykey(); return 0; diff --git a/mbbsd/talk.c b/mbbsd/talk.c index b801357b..604f3de8 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -210,20 +210,27 @@ reverse_friend_stat(int stat) return stat1; } -int -login_friend_online(void) +void login_friend_online(void) { userinfo_t *uentp; int i, stat, stat1; int offset = (int)(currutmp - &SHM->uinfo[0]); #ifdef OUTTACACHE int sfd; - - if( (sfd = toconnect(OUTTACACHEHOST, OUTTACACHEPOST)) > 0 ){ + if( (sfd = toconnect(OUTTACACHEHOST, OUTTACACHEPORT)) > 0 ){ if( towrite(sfd, &offset, sizeof(offset)) > 0 && towrite(sfd, &currutmp->uid, sizeof(currutmp->uid)) > 0 && towrite(sfd, currutmp->friend, sizeof(currutmp->friend)) > 0 && towrite(sfd, currutmp->reject, sizeof(currutmp->reject)) > 0 ){ + ocfs_t fs; + while( toread(sfd, &fs, sizeof(fs)) > 0 ) + if( SHM->uinfo[fs.index].uid == fs.uid ){ + currutmp->friend_online[currutmp->friendtotal++] + = fs.friendstat; + SHM->uinfo[fs.index].friend_online[ SHM->uinfo[fs.index].friendtotal++ ] = fs.rfriendstat; + } + close(sfd); + return; } close(sfd); } @@ -242,7 +249,7 @@ login_friend_online(void) } } } - return 0; + return; } int |