From beac874f4523ed2b32dd48c7d19ba42d43f24fe4 Mon Sep 17 00:00:00 2001 From: in2 Date: Wed, 3 Apr 2002 17:41:12 +0000 Subject: hbfl move to brdshm git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@74 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/pttstruct.h | 6 ++++-- mbbsd/cache.c | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/pttstruct.h b/include/pttstruct.h index d2d5f59e..ea896dfd 100644 --- a/include/pttstruct.h +++ b/include/pttstruct.h @@ -1,4 +1,4 @@ -/* $Id: pttstruct.h,v 1.4 2002/03/19 16:03:23 ptt Exp $ */ +/* $Id: pttstruct.h,v 1.5 2002/04/03 17:41:10 in2 Exp $ */ #ifndef INCLUDE_STRUCT_H #define INCLUDE_STRUCT_H @@ -163,7 +163,6 @@ typedef struct uhash_t { int hash_head[1 << HASH_BITS]; int number; /* # of users total */ int loaded; /* .PASSWD has been loaded? */ - int hbfl[MAX_BOARD][MAX_FRIEND + 1]; } uhash_t; union xitem_t { @@ -240,11 +239,13 @@ typedef struct userinfo_t { unsigned short int five_win; unsigned short int five_lose; unsigned short int five_tie; + /* int myfavorite[FAVMAX]; char gfavorite[FAVGMAX][FAVGSLEN+1]; int ninGroup[FAVGMAX]; int nGroup; int ninRoot; + */ int mailalert; int sex; char color; @@ -293,6 +294,7 @@ typedef struct bcache_t { fileheader_t dircache[MAX_BOARD][DIRCACHESIZE]; int busystate_b[MAX_BOARD]; int total[MAX_BOARD]; + int hbfl[MAX_BOARD][MAX_FRIEND + 1]; time_t lastposttime[MAX_BOARD]; time_t uptime; time_t touchtime; diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 64b6bffe..bd380f19 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.4 2002/03/29 16:22:52 ptt Exp $ */ +/* $Id: cache.c,v 1.5 2002/04/03 17:41:12 in2 Exp $ */ #include #include #include @@ -1004,17 +1004,17 @@ void hbflreload(int bid) fclose(fp); } hbfl[0] = time(NULL); - memcpy(uhash->hbfl[bid], hbfl, sizeof(hbfl)); + memcpy(brdshm->hbfl[bid], hbfl, sizeof(hbfl)); } int hbflcheck(int bid, int uid) { int i; - if( uhash->hbfl[bid][0] < login_start_time - HBFLexpire ) + if( brdshm->hbfl[bid][0] < login_start_time - HBFLexpire ) hbflreload(bid); - for( i = 1 ; uhash->hbfl[bid][i] != 0 && i <= MAX_FRIEND ; ++i ){ - if( uhash->hbfl[bid][i] == uid ) + for( i = 1 ; brdshm->hbfl[bid][i] != 0 && i <= MAX_FRIEND ; ++i ){ + if( brdshm->hbfl[bid][i] == uid ) return 0; } return 1; -- cgit v1.2.3