qccgui: reworked compile prints to split the screen instead of being some other window that's hidden when fullscreened etc.
splitscreen: split spectator setting into a per-seat setting. scoreboards are now also per-seat. added parm_string global for richer map change stuff. dpp7: fixed and reinstated. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5110 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
0fad8fe37d
commit
025aeff8a4
50 changed files with 1150 additions and 813 deletions
|
@ -820,6 +820,7 @@ void PR_LoadGlabalStruct(qboolean muted)
|
|||
globalfloat (false, input_buttons);
|
||||
globalint (false, serverid);
|
||||
globalvec (false, global_gravitydir);
|
||||
globalstring (false, parm_string);
|
||||
|
||||
memset(&evalc_idealpitch, 0, sizeof(evalc_idealpitch));
|
||||
memset(&evalc_pitch_speed, 0, sizeof(evalc_pitch_speed));
|
||||
|
@ -2664,15 +2665,25 @@ void PF_setmodel_Internal (pubprogfuncs_t *prinst, edict_t *e, const char *m)
|
|||
|
||||
if (sv.state != ss_loading)
|
||||
{
|
||||
int j;
|
||||
Con_DPrintf("Delayed model precache: %s\n", m);
|
||||
MSG_WriteByte(&sv.reliable_datagram, svcfte_precache);
|
||||
MSG_WriteShort(&sv.reliable_datagram, i);
|
||||
MSG_WriteString(&sv.reliable_datagram, m);
|
||||
#ifdef NQPROT
|
||||
MSG_WriteByte(&sv.nqreliable_datagram, svcdp_precache);
|
||||
MSG_WriteShort(&sv.nqreliable_datagram, i);
|
||||
MSG_WriteString(&sv.nqreliable_datagram, m);
|
||||
#endif
|
||||
|
||||
for (j = 0; j < sv.allocated_client_slots; j++)
|
||||
{
|
||||
if (svs.clients[j].state < cs_connected)
|
||||
continue;
|
||||
if (ISDPCLIENT(&svs.clients[j]) || (svs.clients[j].fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS))
|
||||
{
|
||||
ClientReliableWrite_Begin (&svs.clients[j], ISNQCLIENT(&svs.clients[j])?svcdp_precache:svcfte_precache, strlen(m)+4);
|
||||
ClientReliableWrite_Short (&svs.clients[j], i);
|
||||
ClientReliableWrite_String (&svs.clients[j], m);
|
||||
}
|
||||
else
|
||||
{
|
||||
//client doesn't support this... reset the connection so they're forced to reload everything.
|
||||
//SV_StuffcmdToClient(&svs.clients[j], "cmd new\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3677,6 +3688,25 @@ void PF_stuffcmd_Internal(int entnum, const char *str, unsigned int flags)
|
|||
{
|
||||
client_t *cl;
|
||||
int slen;
|
||||
unsigned int i;
|
||||
|
||||
if (flags & STUFFCMD_BROADCAST)
|
||||
{
|
||||
for (i = 0, cl = svs.clients; i < sv.allocated_client_slots; i++, cl++)
|
||||
{
|
||||
if (cl->state != cs_spawned || cl->controller == cl)
|
||||
continue;
|
||||
SV_StuffcmdToClient(cl, str);
|
||||
}
|
||||
if (!(flags & STUFFCMD_IGNOREINDEMO))
|
||||
if (sv.mvdrecording)
|
||||
{
|
||||
sizebuf_t *msg = MVDWrite_Begin (dem_all, 0, 2 + strlen(str));
|
||||
MSG_WriteByte (msg, svc_stufftext);
|
||||
MSG_WriteString (msg, str);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (entnum < 1 || entnum > sv.allocated_client_slots)
|
||||
return;
|
||||
|
@ -5529,9 +5559,7 @@ void QCBUILTIN PF_setspawnparms (pubprogfuncs_t *prinst, struct globalvars_s *pr
|
|||
// copy spawn parms out of the client_t
|
||||
client = svs.clients + (i-1);
|
||||
|
||||
for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
*pr_global_ptrs->spawnparamglobals[i] = client->spawn_parms[i];
|
||||
SV_SpawnParmsToQC(client);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -5744,7 +5772,7 @@ char *PF_infokey_Internal (int entnum, const char *key)
|
|||
value = ""; //could be a writebyted bot...
|
||||
break;
|
||||
case SCP_QUAKEWORLD:
|
||||
if (!svs.clients[entnum-1].fteprotocolextensions && !svs.clients[entnum-1].fteprotocolextensions)
|
||||
if (!svs.clients[entnum-1].fteprotocolextensions && !svs.clients[entnum-1].fteprotocolextensions2)
|
||||
value = "quakeworld";
|
||||
else
|
||||
value = "quakeworld+";
|
||||
|
@ -8550,29 +8578,44 @@ static void QCBUILTIN PF_te_teleport(pubprogfuncs_t *prinst, struct globalvars_s
|
|||
//void(vector org, float color, float length) te_explosion2 = #427;
|
||||
static void QCBUILTIN PF_te_explosion2(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
qboolean old = false;
|
||||
float *org = G_VECTOR(OFS_PARM0);
|
||||
int start = G_FLOAT(OFS_PARM1);
|
||||
int length = G_FLOAT(OFS_PARM2);
|
||||
start = bound(0, start, 255);
|
||||
length = bound(0, length, 255-start);
|
||||
|
||||
MSG_WriteByte (&sv.multicast, svc_temp_entity);
|
||||
MSG_WriteByte (&sv.multicast, TEQW_EXPLOSION2);
|
||||
MSG_WriteCoord (&sv.multicast, org[0]);
|
||||
MSG_WriteCoord (&sv.multicast, org[1]);
|
||||
MSG_WriteCoord (&sv.multicast, org[2]);
|
||||
MSG_WriteByte (&sv.multicast, start);
|
||||
MSG_WriteByte (&sv.multicast, length);
|
||||
#ifdef NQPROT
|
||||
MSG_WriteByte (&sv.nqmulticast, svc_temp_entity);
|
||||
MSG_WriteByte (&sv.nqmulticast, TENQ_EXPLOSION2);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[0]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[1]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[2]);
|
||||
MSG_WriteByte (&sv.nqmulticast, start);
|
||||
MSG_WriteByte (&sv.nqmulticast, length);
|
||||
#endif
|
||||
SV_MulticastProtExt(org, MULTICAST_PHS, pr_global_struct->dimension_send, 0, 0);
|
||||
for(;;)
|
||||
{
|
||||
MSG_WriteByte (&sv.multicast, svc_temp_entity);
|
||||
MSG_WriteByte (&sv.multicast, old?TE_EXPLOSION:TEQW_EXPLOSION2);
|
||||
MSG_WriteCoord (&sv.multicast, org[0]);
|
||||
MSG_WriteCoord (&sv.multicast, org[1]);
|
||||
MSG_WriteCoord (&sv.multicast, org[2]);
|
||||
if (!old)
|
||||
{
|
||||
MSG_WriteByte (&sv.multicast, start);
|
||||
MSG_WriteByte (&sv.multicast, length);
|
||||
}
|
||||
#ifdef NQPROT
|
||||
MSG_WriteByte (&sv.nqmulticast, svc_temp_entity);
|
||||
MSG_WriteByte (&sv.nqmulticast, TENQ_EXPLOSION2);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[0]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[1]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[2]);
|
||||
MSG_WriteByte (&sv.nqmulticast, start);
|
||||
MSG_WriteByte (&sv.nqmulticast, length);
|
||||
#endif
|
||||
|
||||
if (old)
|
||||
{
|
||||
SV_MulticastProtExt(org, MULTICAST_PHS, pr_global_struct->dimension_send, 0, PEXT_TE_BULLET);
|
||||
break;
|
||||
}
|
||||
else
|
||||
SV_MulticastProtExt(org, MULTICAST_PHS, pr_global_struct->dimension_send, PEXT_TE_BULLET, 0);
|
||||
old = true;
|
||||
}
|
||||
}
|
||||
|
||||
//DP_TE_FLAMEJET
|
||||
|
|
|
@ -2097,6 +2097,7 @@ qboolean PR_LoadQ1QVM(void)
|
|||
pr_global_ptrs->spawnparamglobals[i] = (float*)((char*)VM_MemoryBase(q1qvm)+(qintptr_t)(&global->parm1 + i));
|
||||
for (; i < NUM_SPAWN_PARMS; i++)
|
||||
pr_global_ptrs->spawnparamglobals[i] = NULL;
|
||||
pr_global_ptrs->parm_string = NULL;
|
||||
|
||||
#define emufield(n,t) if (field[i].type == t && !strcmp(#n, fname)) {fofs.n = (field[i].ofs - WASTED_EDICT_T_SIZE)/sizeof(float); continue;}
|
||||
if (VM_NonNative(q1qvm))
|
||||
|
|
|
@ -100,6 +100,7 @@ typedef struct nqglobalvars_s
|
|||
float *input_buttons;
|
||||
vec3_t *global_gravitydir;
|
||||
float *spawnparamglobals[NUM_SPAWN_PARMS];
|
||||
string_t *parm_string;
|
||||
int *serverid;
|
||||
} globalptrs_t;
|
||||
|
||||
|
|
|
@ -803,11 +803,7 @@ qboolean SV_LoadLevelCache(const char *savename, const char *level, const char *
|
|||
e2 = svprogfuncs->GetEdictFieldValue(svprogfuncs, ent, "stats_restored", ev_float, NULL);
|
||||
if (e2)
|
||||
e2->_float = 1;
|
||||
for (j=0 ; j< NUM_SPAWN_PARMS ; j++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[j])
|
||||
*pr_global_ptrs->spawnparamglobals[j] = host_client->spawn_parms[j];
|
||||
}
|
||||
SV_SpawnParmsToQC(host_client);
|
||||
pr_global_struct->time = sv.world.physicstime;
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
|
||||
ent->area.next = ent->area.prev = NULL;
|
||||
|
|
|
@ -333,13 +333,18 @@ typedef struct
|
|||
float move_msecs; //
|
||||
int packetsizein; //amount of data received for this frame
|
||||
int packetsizeout; //amount of data that was sent in the frame
|
||||
packet_entities_t entities; //package containing entity states that were sent in this frame, for deltaing
|
||||
|
||||
packet_entities_t qwentities; //package containing entity states that were sent in this frame, for deltaing
|
||||
|
||||
struct resendinfo_s
|
||||
{
|
||||
unsigned int entnum;
|
||||
unsigned int bits; //delta
|
||||
unsigned int bits; //delta (fte or dpp5+)
|
||||
unsigned int flags; //csqc
|
||||
} *resend;
|
||||
unsigned int numresend;
|
||||
unsigned int maxresend;
|
||||
|
||||
unsigned short resendstats[32];//the number of each entity that was sent in this frame
|
||||
unsigned int numresendstats; //the bits of each entity that were sent in this frame
|
||||
|
||||
|
@ -396,7 +401,7 @@ typedef struct //merge?
|
|||
enum
|
||||
{
|
||||
PRESPAWN_INVALID=0,
|
||||
PRESPAWN_PROTOCOLSWITCH, //nq drops unreliables until reliables are acked
|
||||
PRESPAWN_PROTOCOLSWITCH, //nq drops unreliables until reliables are acked. this gives us a chance to drop any clc_move packets with formats from the previous map
|
||||
PRESPAWN_SERVERINFO,
|
||||
PRESPAWN_SOUNDLIST, //nq skips these
|
||||
PRESPAWN_VWEPMODELLIST, //qw ugly extension.
|
||||
|
@ -504,7 +509,8 @@ typedef struct client_s
|
|||
|
||||
// spawn parms are carried from level to level
|
||||
float spawn_parms[NUM_SPAWN_PARMS];
|
||||
char *spawninfo;
|
||||
char *spawn_parmstring; //qc-specified data.
|
||||
char *spawninfo; //entity-formatted data (for hexen2's ClientReEnter)
|
||||
float spawninfotime;
|
||||
float nextservertimeupdate; //next time to send STAT_TIME
|
||||
float lastoutgoingphysicstime;//sv.world.physicstime of the last outgoing message.
|
||||
|
@ -1119,6 +1125,8 @@ void SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg);
|
|||
void SVQW_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, unsigned int protext);
|
||||
|
||||
client_t *SV_AddSplit(client_t *controller, char *info, int id);
|
||||
void SV_SpawnParmsToQC(client_t *client);
|
||||
void SV_SpawnParmsToClient(client_t *client);
|
||||
void SV_GetNewSpawnParms(client_t *cl);
|
||||
void SV_SaveSpawnparms (void);
|
||||
void SV_SaveSpawnparmsClient(client_t *client, float *transferparms); //if transferparms, calls SetTransferParms instead, and does not modify the player.
|
||||
|
|
|
@ -759,7 +759,8 @@ void SV_Map_f (void)
|
|||
Z_Free(host_client->spawninfo);
|
||||
host_client->spawninfo = NULL;
|
||||
memset(host_client->spawn_parms, 0, sizeof(host_client->spawn_parms));
|
||||
SV_GetNewSpawnParms(host_client);
|
||||
if (host_client->state > cs_zombie)
|
||||
SV_GetNewSpawnParms(host_client);
|
||||
}
|
||||
|
||||
if (preserveplayers && svprogfuncs && host_client->state == cs_spawned && host_client->spawninfo)
|
||||
|
@ -2855,16 +2856,14 @@ void SV_MemInfo_f(void)
|
|||
sz += lp->length;
|
||||
|
||||
fr = 0;
|
||||
fr += sizeof(client_frame_t)*UPDATE_BACKUP;
|
||||
if (cl->pendingdeltabits)
|
||||
{
|
||||
int maxents = cl->frameunion.frames[0].entities.max_entities; /*this is the max number of ents updated per frame. we can't track more, so...*/
|
||||
fr = sizeof(cl)*UPDATE_BACKUP+
|
||||
sizeof(*cl->pendingdeltabits)*cl->max_net_ents+
|
||||
sizeof(unsigned int)*maxents*UPDATE_BACKUP+
|
||||
sizeof(unsigned int)*maxents*UPDATE_BACKUP;
|
||||
fr += sizeof(cl)*UPDATE_BACKUP+
|
||||
sizeof(*cl->pendingdeltabits)*cl->max_net_ents;
|
||||
}
|
||||
else
|
||||
fr = (sizeof(client_frame_t)+sizeof(entity_state_t)*cl->frameunion.frames[0].entities.max_entities)*UPDATE_BACKUP;
|
||||
fr += sizeof(*cl->frameunion.frames[0].resend)*cl->frameunion.frames[0].maxresend*UPDATE_BACKUP;
|
||||
fr += sizeof(entity_state_t)*cl->frameunion.frames[0].qwentities.max_entities*UPDATE_BACKUP;
|
||||
fr += sizeof(*cl->sentents.entities) * cl->sentents.max_entities;
|
||||
|
||||
csfr = sizeof(*cl->pendingcsqcbits) * cl->max_net_ents;
|
||||
|
@ -2873,7 +2872,8 @@ void SV_MemInfo_f(void)
|
|||
}
|
||||
}
|
||||
|
||||
//FIXME: report vm memory
|
||||
if (sv.world.progs)
|
||||
Con_Printf("ssqc: %u (used) / %u (reserved)\n", sv.world.progs->stringtablesize, sv.world.progs->stringtablemaxsize);
|
||||
}
|
||||
|
||||
void SV_Download_f (void)
|
||||
|
|
|
@ -125,18 +125,18 @@ unsigned int SV_Q2BSP_FatPVS (model_t *mod, vec3_t org, qbyte *resultbuf, unsig
|
|||
#endif
|
||||
|
||||
|
||||
void SVFTE_ExpandFrames(client_t *client, int require)
|
||||
void SV_ExpandNackFrames(client_t *client, int require)
|
||||
{
|
||||
client_frame_t *newframes;
|
||||
char *ptr;
|
||||
int i;
|
||||
int maxents = require * 2; /*this is the max number of ents updated per frame. we can't track more, so...*/
|
||||
if (maxents > client->max_net_ents)
|
||||
maxents = client->max_net_ents;
|
||||
int maxlog = require * 2; /*this is the max number of ents updated per frame. we can't track more, so...*/
|
||||
if (maxlog > client->max_net_ents)
|
||||
maxlog = client->max_net_ents;
|
||||
ptr = Z_Malloc( sizeof(client_frame_t)*UPDATE_BACKUP+
|
||||
sizeof(*client->pendingdeltabits)*client->max_net_ents+
|
||||
sizeof(*client->pendingcsqcbits)*client->max_net_ents+
|
||||
sizeof(newframes[i].resend)*maxents*UPDATE_BACKUP);
|
||||
sizeof(newframes[i].resend)*maxlog*UPDATE_BACKUP);
|
||||
newframes = (void*)ptr;
|
||||
memcpy(newframes, client->frameunion.frames, sizeof(client_frame_t)*UPDATE_BACKUP);
|
||||
ptr += sizeof(client_frame_t)*UPDATE_BACKUP;
|
||||
|
@ -148,9 +148,11 @@ void SVFTE_ExpandFrames(client_t *client, int require)
|
|||
ptr += sizeof(*client->pendingcsqcbits)*client->max_net_ents;
|
||||
for (i = 0; i < UPDATE_BACKUP; i++)
|
||||
{
|
||||
newframes[i].entities.max_entities = maxents;
|
||||
newframes[i].maxresend = maxlog;
|
||||
newframes[i].qwentities.max_entities = 0;
|
||||
newframes[i].resend = (void*)ptr;
|
||||
memcpy(newframes[i].resend, client->frameunion.frames[i].resend, sizeof(newframes[i].resend)*client->frameunion.frames[i].entities.num_entities);
|
||||
newframes[i].numresend = client->frameunion.frames[i].numresend;
|
||||
memcpy(newframes[i].resend, client->frameunion.frames[i].resend, sizeof(newframes[i].resend)*newframes[i].numresend);
|
||||
newframes[i].senttime = realtime;
|
||||
}
|
||||
Z_Free(client->frameunion.frames);
|
||||
|
@ -348,10 +350,11 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
qboolean writtenheader = false;
|
||||
int viewerent;
|
||||
int entnum;
|
||||
int lognum = client->frameunion.frames[currentsequence & UPDATE_MASK].entities.num_entities;
|
||||
client_frame_t *frame = &client->frameunion.frames[currentsequence & UPDATE_MASK];
|
||||
int lognum = frame->numresend;
|
||||
|
||||
struct resendinfo_s *resend = client->frameunion.frames[currentsequence & UPDATE_MASK].resend;
|
||||
int maxlog = client->frameunion.frames[currentsequence & UPDATE_MASK].entities.max_entities;
|
||||
struct resendinfo_s *resend = frame->resend;
|
||||
int maxlog = frame->maxresend;
|
||||
|
||||
//we don't check that we got some already - because this is delta compressed!
|
||||
|
||||
|
@ -391,7 +394,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
|
||||
if (lognum > maxlog)
|
||||
{
|
||||
SVFTE_ExpandFrames(client, lognum+1);
|
||||
SV_ExpandNackFrames(client, lognum+1);
|
||||
break;
|
||||
}
|
||||
resend[lognum].entnum = entnum;
|
||||
|
@ -444,7 +447,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
|
||||
if (lognum > maxlog)
|
||||
{
|
||||
SVFTE_ExpandFrames(client, lognum+1);
|
||||
SV_ExpandNackFrames(client, lognum+1);
|
||||
break;
|
||||
}
|
||||
resend[lognum].entnum = entnum;
|
||||
|
@ -478,7 +481,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
|
||||
if (lognum > maxlog)
|
||||
{
|
||||
SVFTE_ExpandFrames(client, lognum+1);
|
||||
SV_ExpandNackFrames(client, lognum+1);
|
||||
break;
|
||||
}
|
||||
resend[lognum].entnum = entnum;
|
||||
|
@ -514,7 +517,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
|
||||
if (lognum > maxlog)
|
||||
{
|
||||
SVFTE_ExpandFrames(client, lognum+1);
|
||||
SV_ExpandNackFrames(client, lognum+1);
|
||||
break;
|
||||
}
|
||||
resend[lognum].entnum = entnum;
|
||||
|
@ -540,7 +543,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
|
||||
csqcnuments = 0;
|
||||
|
||||
client->frameunion.frames[currentsequence & UPDATE_MASK].entities.num_entities = lognum;
|
||||
frame->numresend = lognum;
|
||||
|
||||
//prevent the qc from trying to use it at inopertune times.
|
||||
csqcmsgbuffer.maxsize = 0;
|
||||
|
@ -551,6 +554,7 @@ void SV_EmitCSQCUpdate(client_t *client, sizebuf_t *msg, qbyte svcnumber)
|
|||
void SV_CSQC_DroppedPacket(client_t *client, int sequence)
|
||||
{
|
||||
int i;
|
||||
client_frame_t *frame;
|
||||
if (!ISQWCLIENT(client) && !ISNQCLIENT(client))
|
||||
return;
|
||||
|
||||
|
@ -559,39 +563,35 @@ void SV_CSQC_DroppedPacket(client_t *client, int sequence)
|
|||
Con_Printf("Server bug: No frames!\n");
|
||||
return;
|
||||
}
|
||||
frame = &client->frameunion.frames[sequence & UPDATE_MASK];
|
||||
|
||||
//skip it if we never generated that frame, to avoid pulling in stale data
|
||||
if (client->frameunion.frames[sequence & UPDATE_MASK].sequence != sequence)
|
||||
if (frame->sequence != sequence)
|
||||
{
|
||||
// Con_Printf("SV: Stale %i\n", sequence);
|
||||
return;
|
||||
}
|
||||
|
||||
//lost entities need flagging for a resend
|
||||
if (client->fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
|
||||
if (frame->numresend)
|
||||
{
|
||||
struct resendinfo_s *resend = client->frameunion.frames[sequence & UPDATE_MASK].resend;
|
||||
struct resendinfo_s *resend = frame->resend;
|
||||
// Con_Printf("SV: Resend %i\n", sequence);
|
||||
i = client->frameunion.frames[sequence & UPDATE_MASK].entities.num_entities;
|
||||
i = frame->numresend;
|
||||
while (i > 0)
|
||||
{
|
||||
i--;
|
||||
|
||||
// if (f[i] & UF_RESET)
|
||||
// Con_Printf("Resend %i @ %i\n", i, sequence);
|
||||
// if (f[i] & UF_REMOVE)
|
||||
// Con_Printf("Remove %i @ %i\n", i, sequence);
|
||||
client->pendingdeltabits[resend[i].entnum] |= resend[i].bits;
|
||||
client->pendingcsqcbits[resend[i].entnum] |= resend[i].flags;
|
||||
}
|
||||
client->frameunion.frames[sequence & UPDATE_MASK].entities.num_entities = 0;
|
||||
frame->numresend = 0; //don't resend the same info twice!
|
||||
}
|
||||
//lost stats do too
|
||||
if (client->fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
|
||||
if (frame->numresendstats)
|
||||
{
|
||||
client_t *sp;
|
||||
unsigned short *n = client->frameunion.frames[sequence & UPDATE_MASK].resendstats;
|
||||
i = client->frameunion.frames[sequence & UPDATE_MASK].numresendstats;
|
||||
unsigned short *n = frame->resendstats;
|
||||
i = frame->numresendstats;
|
||||
while(i-->0)
|
||||
{
|
||||
unsigned short s = n[i];
|
||||
|
@ -608,7 +608,7 @@ void SV_CSQC_DroppedPacket(client_t *client, int sequence)
|
|||
else
|
||||
client->pendingstats[s>>5u] |= 1u << (s & 0x1fu);
|
||||
}
|
||||
client->frameunion.frames[sequence & UPDATE_MASK].numresendstats = 0;
|
||||
frame->numresendstats = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1532,7 +1532,7 @@ qboolean SVFTE_EmitPacketEntities(client_t *client, packet_entities_t *to, sizeb
|
|||
/*cache frame info*/
|
||||
resend = client->frameunion.frames[sequence & UPDATE_MASK].resend;
|
||||
outno = 0;
|
||||
outmax = client->frameunion.frames[sequence & UPDATE_MASK].entities.max_entities;
|
||||
outmax = client->frameunion.frames[sequence & UPDATE_MASK].maxresend;
|
||||
|
||||
/*start writing the packet*/
|
||||
MSG_WriteByte (msg, svcfte_updateentities);
|
||||
|
@ -1564,7 +1564,7 @@ qboolean SVFTE_EmitPacketEntities(client_t *client, packet_entities_t *to, sizeb
|
|||
}
|
||||
if (outno >= outmax)
|
||||
{ //expand the frames. may need some copying...
|
||||
SVFTE_ExpandFrames(client, outno+1);
|
||||
SV_ExpandNackFrames(client, outno+1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1615,7 +1615,7 @@ qboolean SVFTE_EmitPacketEntities(client_t *client, packet_entities_t *to, sizeb
|
|||
else
|
||||
client->nextdeltaindex = j; //we overflowed or something, start going round-robin
|
||||
|
||||
client->frameunion.frames[sequence & UPDATE_MASK].entities.num_entities = outno;
|
||||
client->frameunion.frames[sequence & UPDATE_MASK].numresend = outno;
|
||||
client->frameunion.frames[sequence & UPDATE_MASK].sequence = sequence;
|
||||
return overflow;
|
||||
}
|
||||
|
@ -1642,7 +1642,7 @@ void SVQW_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t
|
|||
if (client->delta_sequence != -1)
|
||||
{
|
||||
fromframe = &client->frameunion.frames[client->delta_sequence & UPDATE_MASK];
|
||||
from = &fromframe->entities;
|
||||
from = &fromframe->qwentities;
|
||||
oldmax = from->num_entities;
|
||||
|
||||
MSG_WriteByte (msg, svc_deltapacketentities);
|
||||
|
@ -1916,122 +1916,148 @@ void SVDP_EmitEntityDelta(unsigned int bits, entity_state_t *to, sizebuf_t *msg,
|
|||
MSG_WriteShort(msg, to->u.q1.traileffectnum);
|
||||
}
|
||||
|
||||
void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t *msg)
|
||||
void SVDP_EmitEntitiesUpdate (client_t *client, client_frame_t *frame, packet_entities_t *to, sizebuf_t *msg)
|
||||
{
|
||||
packet_entities_t *from;
|
||||
int oldindex, newindex;
|
||||
int oldnum, newnum;
|
||||
int oldmax;
|
||||
packet_entities_t *cur;
|
||||
int newindex;
|
||||
int curnum, newnum;
|
||||
int j;
|
||||
int sequence = client->netchan.incoming_sequence;
|
||||
|
||||
// this is the frame that we are going to delta update from
|
||||
cur = &client->sentents;
|
||||
if (!client->netchan.incoming_sequence)
|
||||
{
|
||||
oldmax = 0;
|
||||
from = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
from = &client->sentents;
|
||||
oldmax = from->num_entities;
|
||||
{ //first packet deltas from nothing.
|
||||
//so make sure we start with nothing
|
||||
cur->num_entities = 0;
|
||||
}
|
||||
|
||||
if (to->num_entities)
|
||||
{
|
||||
j = to->entities[to->num_entities-1].number+1;
|
||||
if (j > from->max_entities)
|
||||
if (j > cur->max_entities)
|
||||
{
|
||||
from->entities = BZ_Realloc(from->entities, sizeof(*from->entities) * j);
|
||||
memset(&from->entities[from->max_entities], 0, sizeof(from->entities[0]) * (j - from->max_entities));
|
||||
from->max_entities = j;
|
||||
cur->entities = BZ_Realloc(cur->entities, sizeof(*cur->entities) * j);
|
||||
memset(&cur->entities[cur->max_entities], 0, sizeof(cur->entities[0]) * (j - cur->max_entities));
|
||||
cur->max_entities = j;
|
||||
}
|
||||
while(j > client->sentents.num_entities)
|
||||
while(j > cur->num_entities)
|
||||
{
|
||||
from->entities[from->num_entities].number = 0;
|
||||
from->num_entities++;
|
||||
cur->entities[cur->num_entities].number = 0;
|
||||
cur->num_entities++;
|
||||
}
|
||||
}
|
||||
|
||||
//diff the from+to states, flagging any changed state (which is combined with any state from previous packet loss
|
||||
newindex = 0;
|
||||
oldindex = 0;
|
||||
while (newindex < to->num_entities || oldindex < oldmax)
|
||||
curnum = 0;
|
||||
while (newindex < to->num_entities || curnum < cur->num_entities)
|
||||
{
|
||||
newnum = newindex >= to->num_entities ? 0x7fff : to->entities[newindex].number;
|
||||
oldnum = oldindex >= oldmax ? 0x7fff : from->entities[oldindex].number;
|
||||
newnum = newindex >= to->num_entities ? 0x8000 : to->entities[newindex].number;
|
||||
|
||||
if (newnum < oldnum)
|
||||
{ // this is a new entity, send it from the baseline... as far as dp understands it...
|
||||
client->pendingdeltabits[newnum] |= E5_FULLUPDATE | SVDP_CalcDelta(&nullentitystate, NULL, &to->entities[oldindex], to->bonedata);
|
||||
newindex++;
|
||||
}
|
||||
else if (newnum > oldnum)
|
||||
{ // the old entity isn't present in the new message
|
||||
client->pendingdeltabits[oldnum] = E5_SERVERREMOVE;
|
||||
oldindex++;
|
||||
}
|
||||
else
|
||||
{ // delta update from old position
|
||||
client->pendingdeltabits[newnum] |= SVDP_CalcDelta(&from->entities[oldindex], NULL/*from->bonedata*/, &to->entities[oldindex], to->bonedata);
|
||||
if (client->pendingdeltabits[newnum] & E5_SERVERREMOVE)
|
||||
{ //if it got flagged for removal, but its actually a valid entity, then assume that its an outdated remove and just flag it for a full update in case stuff got lost.
|
||||
client->pendingdeltabits[newnum] &= ~E5_SERVERREMOVE;
|
||||
client->pendingdeltabits[newnum] |= E5_FULLUPDATE;
|
||||
if (newnum == curnum)
|
||||
{
|
||||
if (cur->entities[curnum].number)
|
||||
{ //regular update
|
||||
client->pendingdeltabits[newnum] |= SVDP_CalcDelta(&cur->entities[curnum], NULL/*cur->bonedata*/, &to->entities[newindex], to->bonedata);
|
||||
if (client->pendingdeltabits[newnum] & E5_SERVERREMOVE)
|
||||
{ //if it got flagged for removal, but its actually a valid entity, then assume that its an outdated remove and just flag it for a full update in case stuff got lost.
|
||||
client->pendingdeltabits[newnum] &= ~E5_SERVERREMOVE;
|
||||
client->pendingdeltabits[newnum] |= E5_FULLUPDATE;
|
||||
}
|
||||
}
|
||||
oldindex++;
|
||||
else
|
||||
{ //this ent is new
|
||||
//dpp5+ does not use baselines. it just resets from default state.
|
||||
client->pendingdeltabits[newnum] = E5_FULLUPDATE | SVDP_CalcDelta(&nullentitystate, NULL, &to->entities[newindex], to->bonedata);
|
||||
}
|
||||
cur->entities[curnum] = to->entities[newindex];
|
||||
newindex++;
|
||||
}
|
||||
else if (cur->entities[curnum].number)
|
||||
{ //this entity was apparently removed since last time.
|
||||
cur->entities[curnum].number = 0;
|
||||
client->pendingdeltabits[curnum] = E5_SERVERREMOVE;
|
||||
}
|
||||
curnum++;
|
||||
}
|
||||
|
||||
to = cur;
|
||||
|
||||
//loop through all ents and send them as required
|
||||
|
||||
// Con_Printf ("frame %i\n", client->netchan.incoming_sequence);
|
||||
|
||||
MSG_WriteByte(msg, svcdp_entities);
|
||||
MSG_WriteLong(msg, client->netchan.incoming_sequence); //sequence for the client to ack (any bits sent in unacked frames will be re-queued)
|
||||
if (client->protocol == SCP_DARKPLACES7)
|
||||
MSG_WriteLong(msg, client->last_sequence); //movement sequence that we are acking.
|
||||
|
||||
client->netchan.incoming_sequence++;
|
||||
|
||||
//add in the bitmasks of dropped packets.
|
||||
|
||||
/* newindex = 0;
|
||||
oldindex = 0;
|
||||
//Con_Printf ("---%i to %i ----\n", client->delta_sequence & UPDATE_MASK
|
||||
// , client->netchan.outgoing_sequence & UPDATE_MASK);
|
||||
while (newindex < to->num_entities || oldindex < oldmax)
|
||||
{
|
||||
newnum = newindex >= to->num_entities ? 0x7fff : to->entities[newindex].number;
|
||||
oldnum = oldindex >= oldmax ? 0x7fff : from->entities[oldindex].number;
|
||||
unsigned int bits;
|
||||
int outno, outmax = frame->maxresend;
|
||||
qboolean overflow = false;
|
||||
struct resendinfo_s *resend = frame->resend;
|
||||
|
||||
if (newnum == oldnum)
|
||||
{ // delta update from old position
|
||||
//Con_Printf ("delta %i\n", newnum);
|
||||
SVDP_EmitEntityDelta (&from->entities[oldindex], &to->entities[newindex], msg, false, to->bonedata);
|
||||
oldindex++;
|
||||
newindex++;
|
||||
continue;
|
||||
}
|
||||
MSG_WriteByte(msg, svcdp_entities);
|
||||
MSG_WriteLong(msg, sequence); //sequence for the client to ack (any bits sent in unacked frames will be re-queued)
|
||||
if (client->protocol == SCP_DARKPLACES7)
|
||||
MSG_WriteLong(msg, client->last_sequence); //movement sequence that we are acking.
|
||||
|
||||
if (newnum < oldnum)
|
||||
{ // this is a new entity, send it from the baseline... as far as dp understands it...
|
||||
//Con_Printf ("baseline %i\n", newnum);
|
||||
SVDP_EmitEntityDelta (&nullentitystate, &to->entities[newindex], msg, true, to->bonedata);
|
||||
newindex++;
|
||||
continue;
|
||||
}
|
||||
client->netchan.incoming_sequence++;
|
||||
|
||||
if (newnum > oldnum)
|
||||
{ // the old entity isn't present in the new message
|
||||
// Con_Printf("sRemove %i\n", oldnum);
|
||||
MSG_WriteShort(msg, oldnum | 0x8000);
|
||||
oldindex++;
|
||||
continue;
|
||||
//add in the bitmasks of dropped packets.
|
||||
for(outno = 0, j = 1; j < to->num_entities; j++)
|
||||
{
|
||||
bits = client->pendingdeltabits[j];
|
||||
if (!bits)
|
||||
continue;
|
||||
if (msg->cursize + 50 > msg->maxsize)
|
||||
{
|
||||
overflow = true;
|
||||
break; /*give up if it gets full. FIXME: bone data is HUGE.*/
|
||||
}
|
||||
if (outno >= outmax)
|
||||
{ //expand the frames. may need some copying...
|
||||
SV_ExpandNackFrames(client, outno+1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (bits & E5_SERVERREMOVE)
|
||||
{ //if reset is set, then reset was set eroneously.
|
||||
MSG_WriteShort(msg, j | 0x8000);
|
||||
resend[outno].bits = E5_SERVERREMOVE;
|
||||
// Con_Printf("REMOVE %i @ %i\n", j, sequence);
|
||||
}
|
||||
else if (to->entities[j].number) /*only send a new copy of the ent if they actually have one already*/
|
||||
{
|
||||
//if we didn't reach the end in the last packet, start at that point to avoid spam
|
||||
//player slots are exempt from this, so they are in every packet (strictly speaking only the local player 'needs' this, but its nice to have it for high-priority targets too)
|
||||
if (j < client->nextdeltaindex && j > svs.allocated_client_slots)
|
||||
continue;
|
||||
|
||||
if (bits & E5_FULLUPDATE)
|
||||
{
|
||||
/*flag the entity for the next packet, so we always get two resets when it appears, to reduce the effects of packetloss on seeing rockets etc*/
|
||||
bits = E5_FULLUPDATE | SVDP_CalcDelta(&nullentitystate, NULL, &to->entities[j], to->bonedata);
|
||||
resend[outno].bits = E5_FULLUPDATE;
|
||||
// Con_Printf("RESET %i @ %i\n", j, sequence);
|
||||
}
|
||||
else
|
||||
resend[outno].bits = bits;
|
||||
|
||||
SVDP_EmitEntityDelta (bits, &to->entities[j], msg, to->bonedata);
|
||||
}
|
||||
|
||||
client->pendingdeltabits[j] = 0;
|
||||
|
||||
resend[outno].flags = 0;
|
||||
resend[outno++].entnum = j;
|
||||
}
|
||||
MSG_WriteShort(msg, 0x8000); //dp5+ uses 'remove world' as a terminator.
|
||||
frame->numresend = outno;
|
||||
frame->sequence = sequence;
|
||||
|
||||
if (j == to->num_entities) //looks like we sent them all
|
||||
client->nextdeltaindex = 0; //start afresh with the next packet.
|
||||
else
|
||||
client->nextdeltaindex = j; //we overflowed or something, start going round-robin
|
||||
}
|
||||
*/
|
||||
MSG_WriteShort(msg, 0x8000);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3965,7 +3991,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
|
|||
}
|
||||
|
||||
host_client = client;
|
||||
if ((client->fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS) || !frame->entities.entities)
|
||||
if ((client->fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS) || !frame->qwentities.entities || ISNQCLIENT(client))
|
||||
{
|
||||
pack = &svs.entstatebuffer;
|
||||
if (pack->max_entities < client->max_net_ents)
|
||||
|
@ -3976,7 +4002,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
|
|||
}
|
||||
}
|
||||
else
|
||||
pack = &frame->entities;
|
||||
pack = &frame->qwentities;
|
||||
SV_Snapshot_Clear(pack);
|
||||
|
||||
if (!pack->entities)
|
||||
|
@ -4024,7 +4050,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
|
|||
}
|
||||
}
|
||||
else if (client->protocol == SCP_DARKPLACES6 || client->protocol == SCP_DARKPLACES7)
|
||||
SVDP_EmitEntitiesUpdate(client, pack, msg);
|
||||
SVDP_EmitEntitiesUpdate(client, frame, pack, msg);
|
||||
else
|
||||
{
|
||||
for (e = 0; e < pack->num_entities; e++)
|
||||
|
|
|
@ -271,14 +271,40 @@ void SVQ1_CreateBaseline (void)
|
|||
}
|
||||
}
|
||||
|
||||
void SV_SpawnParmsToQC(client_t *client)
|
||||
{
|
||||
int i;
|
||||
// copy spawn parms out of the client_t
|
||||
for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
*pr_global_ptrs->spawnparamglobals[i] = client->spawn_parms[i];
|
||||
}
|
||||
if (pr_global_ptrs->parm_string)
|
||||
*pr_global_ptrs->parm_string = client->spawn_parmstring?PR_TempString(sv.world.progs, client->spawn_parmstring):0;
|
||||
}
|
||||
|
||||
void SV_SpawnParmsToClient(client_t *client)
|
||||
{
|
||||
int i;
|
||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
client->spawn_parms[i] = *pr_global_ptrs->spawnparamglobals[i];
|
||||
else
|
||||
client->spawn_parms[i] = 0;
|
||||
}
|
||||
Z_Free(client->spawn_parmstring);
|
||||
if (pr_global_ptrs->parm_string)
|
||||
client->spawn_parmstring = Z_StrDup(PR_GetString(sv.world.progs, *pr_global_ptrs->parm_string));
|
||||
else
|
||||
client->spawn_parmstring = NULL;
|
||||
}
|
||||
|
||||
void SV_SaveSpawnparmsClient(client_t *client, float *transferparms)
|
||||
{
|
||||
int j;
|
||||
for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[j])
|
||||
*pr_global_ptrs->spawnparamglobals[j] = client->spawn_parms[j];
|
||||
}
|
||||
SV_SpawnParmsToQC(client);
|
||||
|
||||
#ifdef VM_Q1
|
||||
if (svs.gametype == GT_Q1QVM)
|
||||
|
@ -314,11 +340,7 @@ void SV_SaveSpawnparmsClient(client_t *client, float *transferparms)
|
|||
}
|
||||
else
|
||||
{
|
||||
for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[j])
|
||||
client->spawn_parms[j] = *pr_global_ptrs->spawnparamglobals[j];
|
||||
}
|
||||
SV_SpawnParmsToClient(client);
|
||||
}
|
||||
|
||||
// call the progs to get default spawn parms for the new client
|
||||
|
@ -394,8 +416,6 @@ void SV_SaveSpawnparms (void)
|
|||
|
||||
void SV_GetNewSpawnParms(client_t *cl)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (svprogfuncs) //q2 dlls don't use parms in this manner. It's all internal to the dll.
|
||||
{
|
||||
// call the progs to get default spawn parms for the new client
|
||||
|
@ -408,13 +428,8 @@ void SV_GetNewSpawnParms(client_t *cl)
|
|||
if (pr_global_ptrs->SetNewParms)
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms);
|
||||
}
|
||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
cl->spawn_parms[i] = *pr_global_ptrs->spawnparamglobals[i];
|
||||
else
|
||||
cl->spawn_parms[i] = 0;
|
||||
}
|
||||
|
||||
SV_SpawnParmsToClient(cl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1645,14 +1660,7 @@ void SV_SpawnServer (const char *server, const char *startspot, qboolean noents,
|
|||
{
|
||||
sv_player = host_client->edict;
|
||||
SV_ExtractFromUserinfo(host_client, true);
|
||||
|
||||
// copy spawn parms out of the client_t
|
||||
for (j=0 ; j< NUM_SPAWN_PARMS ; j++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[j])
|
||||
*pr_global_ptrs->spawnparamglobals[j] = host_client->spawn_parms[j];
|
||||
}
|
||||
|
||||
SV_SpawnParmsToQC(host_client);
|
||||
SV_SetUpClientEdict(host_client, sv_player);
|
||||
#ifndef NOLEGACY
|
||||
sv_player->xv->clientcolors = atoi(Info_ValueForKey(host_client->userinfo, "topcolor"))*16 + atoi(Info_ValueForKey(host_client->userinfo, "bottomcolor"));
|
||||
|
|
|
@ -1968,7 +1968,7 @@ void SV_ClientProtocolExtensionsChanged(client_t *client)
|
|||
ptr += sizeof(*client->pendingcsqcbits)*client->max_net_ents;
|
||||
for (i = 0; i < UPDATE_BACKUP; i++)
|
||||
{
|
||||
client->frameunion.frames[i].entities.max_entities = maxents;
|
||||
client->frameunion.frames[i].maxresend = maxents;
|
||||
client->frameunion.frames[i].resend = (void*)ptr;
|
||||
ptr += sizeof(*client->frameunion.frames[i].resend)*maxents;
|
||||
client->frameunion.frames[i].senttime = realtime;
|
||||
|
@ -1982,8 +1982,8 @@ void SV_ClientProtocolExtensionsChanged(client_t *client)
|
|||
client->frameunion.frames = Z_Malloc((sizeof(client_frame_t))*UPDATE_BACKUP);
|
||||
for (i = 0; i < UPDATE_BACKUP; i++)
|
||||
{
|
||||
client->frameunion.frames[i].entities.max_entities = 0;
|
||||
client->frameunion.frames[i].entities.entities = NULL;
|
||||
client->frameunion.frames[i].qwentities.max_entities = 0;
|
||||
client->frameunion.frames[i].qwentities.entities = NULL;
|
||||
client->frameunion.frames[i].senttime = realtime;
|
||||
}
|
||||
}
|
||||
|
@ -1992,8 +1992,8 @@ void SV_ClientProtocolExtensionsChanged(client_t *client)
|
|||
client->frameunion.frames = Z_Malloc((sizeof(client_frame_t)+sizeof(entity_state_t)*maxpacketentities)*UPDATE_BACKUP);
|
||||
for (i = 0; i < UPDATE_BACKUP; i++)
|
||||
{
|
||||
client->frameunion.frames[i].entities.max_entities = maxpacketentities;
|
||||
client->frameunion.frames[i].entities.entities = (entity_state_t*)(client->frameunion.frames+UPDATE_BACKUP) + i*client->frameunion.frames[i].entities.max_entities;
|
||||
client->frameunion.frames[i].qwentities.max_entities = maxpacketentities;
|
||||
client->frameunion.frames[i].qwentities.entities = (entity_state_t*)(client->frameunion.frames+UPDATE_BACKUP) + i*client->frameunion.frames[i].qwentities.max_entities;
|
||||
client->frameunion.frames[i].senttime = realtime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1569,10 +1569,13 @@ void SV_WriteEntityDataToMessage (client_t *client, sizebuf_t *msg, int pnum)
|
|||
edict_t *ent;
|
||||
int i;
|
||||
float newa;
|
||||
client_t *controller;
|
||||
|
||||
ent = client->edict;
|
||||
if (client->controller)
|
||||
client = client->controller;
|
||||
controller = client->controller;
|
||||
else
|
||||
controller = client;
|
||||
|
||||
if (!ent)
|
||||
return;
|
||||
|
@ -1613,8 +1616,8 @@ void SV_WriteEntityDataToMessage (client_t *client, sizebuf_t *msg, int pnum)
|
|||
if (!client->lockangles)
|
||||
{
|
||||
//try to keep them vaugely reliable.
|
||||
if (client->netchan.message.cursize < client->netchan.message.maxsize/2)
|
||||
msg = &client->netchan.message;
|
||||
if (controller->netchan.message.cursize < controller->netchan.message.maxsize/2)
|
||||
msg = &controller->netchan.message;
|
||||
}
|
||||
|
||||
if (pnum)
|
||||
|
@ -1622,7 +1625,7 @@ void SV_WriteEntityDataToMessage (client_t *client, sizebuf_t *msg, int pnum)
|
|||
MSG_WriteByte(msg, svcfte_choosesplitclient);
|
||||
MSG_WriteByte(msg, pnum);
|
||||
}
|
||||
if (!client->lockangles && (client->fteprotocolextensions2 & PEXT2_SETANGLEDELTA) && client->delta_sequence != -1 && !client->viewent)
|
||||
if (!client->lockangles && (controller->fteprotocolextensions2 & PEXT2_SETANGLEDELTA) && controller->delta_sequence != -1 && !client->viewent)
|
||||
{
|
||||
MSG_WriteByte (msg, svcfte_setangledelta);
|
||||
for (i=0 ; i < 3 ; i++)
|
||||
|
|
|
@ -528,8 +528,8 @@ void SVNQ_New_f (void)
|
|||
qboolean big; //used as a filter to exclude protocols that don't match our coord+angles mode
|
||||
} preferedprot[] =
|
||||
{
|
||||
// {SCP_DARKPLACES7, true},
|
||||
// {SCP_DARKPLACES6, true},
|
||||
{SCP_DARKPLACES7, true},
|
||||
{SCP_DARKPLACES6, true},
|
||||
{SCP_FITZ666, true}, //actually 999... shh...
|
||||
{SCP_FITZ666, false},
|
||||
{SCP_BJP3, false}
|
||||
|
@ -604,7 +604,7 @@ void SVNQ_New_f (void)
|
|||
protoname = "NQ";
|
||||
}
|
||||
break;
|
||||
/*case SCP_DARKPLACES6:
|
||||
case SCP_DARKPLACES6:
|
||||
SV_LogPlayer(host_client, "new (DP6)");
|
||||
protmain = PROTOCOL_VERSION_DP6;
|
||||
protext1 &= ~PEXT_FLOATCOORDS; //always enabled, try not to break things
|
||||
|
@ -615,7 +615,7 @@ void SVNQ_New_f (void)
|
|||
protmain = PROTOCOL_VERSION_DP7;
|
||||
protext1 &= ~PEXT_FLOATCOORDS; //always enabled, try not to break things
|
||||
protoname = "DPP7";
|
||||
break;*/
|
||||
break;
|
||||
default:
|
||||
host_client->drop = true;
|
||||
protoname = "?""?""?";
|
||||
|
@ -1824,14 +1824,12 @@ void SV_SpawnSpectator (void)
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SV_Begin_Core(client_t *split)
|
||||
{ //this is the client-protocol-independant core, for q1/q2 gamecode
|
||||
|
||||
client_t *oh;
|
||||
int i;
|
||||
#ifdef HEXEN2
|
||||
if (progstype == PROG_H2 && split->playerclass)
|
||||
split->edict->xv->playerclass = split->playerclass; //make sure it's set the same as the userinfo
|
||||
|
@ -1878,11 +1876,7 @@ void SV_Begin_Core(client_t *split)
|
|||
|
||||
|
||||
// copy spawn parms out of the client_t
|
||||
for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
*pr_global_ptrs->spawnparamglobals[i] = split->spawn_parms[i];
|
||||
}
|
||||
SV_SpawnParmsToQC(split);
|
||||
|
||||
// call the spawn function
|
||||
pr_global_struct->time = sv.world.physicstime;
|
||||
|
@ -1912,11 +1906,7 @@ void SV_Begin_Core(client_t *split)
|
|||
eval2 = svprogfuncs->GetEdictFieldValue(svprogfuncs, ent, "stats_restored", ev_float, NULL);
|
||||
if (eval2)
|
||||
eval2->_float = 1;
|
||||
for (j=0 ; j< NUM_SPAWN_PARMS ; j++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[j])
|
||||
*pr_global_ptrs->spawnparamglobals[j] = split->spawn_parms[j];
|
||||
}
|
||||
SV_SpawnParmsToQC(split);
|
||||
pr_global_struct->time = sv.world.physicstime;
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
|
||||
G_FLOAT(OFS_PARM0) = sv.time - split->spawninfotime;
|
||||
|
@ -1925,11 +1915,7 @@ void SV_Begin_Core(client_t *split)
|
|||
else
|
||||
{
|
||||
// copy spawn parms out of the client_t
|
||||
for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
*pr_global_ptrs->spawnparamglobals[i] = split->spawn_parms[i];
|
||||
}
|
||||
SV_SpawnParmsToQC(split);
|
||||
|
||||
// call the spawn function
|
||||
#ifdef VM_Q1
|
||||
|
@ -4991,13 +4977,8 @@ void Cmd_Join_f (void)
|
|||
#endif
|
||||
if (pr_global_ptrs->SetNewParms)
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms);
|
||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
host_client->spawn_parms[i] = *pr_global_ptrs->spawnparamglobals[i];
|
||||
else
|
||||
host_client->spawn_parms[i] = 0;
|
||||
}
|
||||
|
||||
SV_SpawnParmsToClient(host_client);
|
||||
|
||||
#ifdef VM_Q1
|
||||
if (svs.gametype == GT_Q1QVM)
|
||||
|
@ -5131,14 +5112,8 @@ void Cmd_Observe_f (void)
|
|||
#endif
|
||||
if (pr_global_ptrs->SetNewParms)
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetNewParms);
|
||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
host_client->spawn_parms[i] = *pr_global_ptrs->spawnparamglobals[i];
|
||||
else
|
||||
host_client->spawn_parms[i] = 0;
|
||||
}
|
||||
|
||||
SV_SpawnParmsToClient(host_client);
|
||||
SV_SpawnSpectator ();
|
||||
|
||||
// call the spawn function
|
||||
|
@ -5372,7 +5347,6 @@ static void SVNQ_Spawn_f (void)
|
|||
static void SVNQ_Begin_f (void)
|
||||
{
|
||||
unsigned pmodel = 0, emodel = 0;
|
||||
int i;
|
||||
qboolean sendangles=false;
|
||||
|
||||
if (host_client->state == cs_spawned)
|
||||
|
@ -5394,11 +5368,7 @@ static void SVNQ_Begin_f (void)
|
|||
if (SpectatorConnect)
|
||||
{
|
||||
// copy spawn parms out of the client_t
|
||||
for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
*pr_global_ptrs->spawnparamglobals[i] = host_client->spawn_parms[i];
|
||||
}
|
||||
SV_SpawnParmsToQC(host_client);
|
||||
|
||||
// call the spawn function
|
||||
pr_global_struct->time = sv.world.physicstime;
|
||||
|
@ -5412,11 +5382,7 @@ static void SVNQ_Begin_f (void)
|
|||
sv.spawned_client_slots++;
|
||||
|
||||
// copy spawn parms out of the client_t
|
||||
for (i=0 ; i< NUM_SPAWN_PARMS ; i++)
|
||||
{
|
||||
if (pr_global_ptrs->spawnparamglobals[i])
|
||||
*pr_global_ptrs->spawnparamglobals[i] = host_client->spawn_parms[i];
|
||||
}
|
||||
SV_SpawnParmsToQC(host_client);
|
||||
|
||||
sv.skipbprintclient = host_client;
|
||||
#ifdef VM_Q1
|
||||
|
@ -5951,6 +5917,7 @@ ucmd_t nqucmds[] =
|
|||
{"playermodel", NULL},
|
||||
{"playerskin", NULL},
|
||||
{"rate", SV_Rate_f},
|
||||
{"rate_burstsize", NULL},
|
||||
|
||||
#ifdef SVRANKING
|
||||
{"topten", Rank_ListTop10_f},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue