commit b400ef0e74159bcd42de83cdf89648b27b0137ff Author: devhc Date: Wed Jul 13 06:41:39 2011 +0200 64-bit clientmask support diff --git a/src/game/g_public.h b/src/game/g_public.h index 312a5e5..745bb12 100644 --- a/src/game/g_public.h +++ b/src/game/g_public.h @@ -31,7 +31,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // special server behaviors #define SVF_NOCLIENT 0x00000001 // don't send entity to clients, even if it has effects -#define SVF_CLIENTMASK 0x00000002 +#define SVF_CLIENTMASK 0x00000002 // send to clients specified by these bitmasks: + // entityShared_t->singleClient: low-order bits (0..31) + // entityShared_t->hiMask: high-order bits (32..63) #define SVF_BROADCAST 0x00000020 // send to all connected clients #define SVF_PORTAL 0x00000040 // merge a second pvs at origin2 into snapshots @@ -54,8 +56,9 @@ typedef struct { qboolean linked; // qfalse if not in any good cluster int linkcount; - int svFlags; // SVF_NOCLIENT, SVF_BROADCAST, etc + int svFlags; // SVF_NOCLIENT, SVF_BROADCAST, etc. int singleClient; // only send to this client when SVF_SINGLECLIENT is set + int hiMask; // singleClient and hiMask are bitmasks if SVF_CLIENTMASK is set qboolean bmodel; // if false, assume an explicit mins / maxs bounding box // only set by trap_SetBrushModel diff --git a/src/server/sv_snapshot.c b/src/server/sv_snapshot.c index cfc5695..09cc0c3 100644 --- a/src/server/sv_snapshot.c +++ b/src/server/sv_snapshot.c @@ -350,10 +350,13 @@ static void SV_AddEntitiesVisibleFromPoint( vec3_t origin, clientSnapshot_t *fra } // entities can be flagged to be sent to a given mask of clients if ( ent->r.svFlags & SVF_CLIENTMASK ) { - if (frame->ps.clientNum >= 32) - Com_Error( ERR_DROP, "SVF_CLIENTMASK: clientNum >= 32\n" ); - if (~ent->r.singleClient & (1 << frame->ps.clientNum)) - continue; + if ( frame->ps.clientNum >= 32 ) { + if ( ~ent->r.hiMask & ( 1 << ( frame->ps.clientNum - 32 ) ) ) + continue; + } else { + if ( ~ent->r.singleClient & ( 1 << frame->ps.clientNum ) ) + continue; + } } svEnt = SV_SvEntityForGentity( ent );