mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 12:31:10 +00:00
packet entities seem to work. players are a bit borked, though. not sure if
it's in the server or the proxy, yet
This commit is contained in:
parent
4f9c31595d
commit
07cd150677
3 changed files with 20 additions and 14 deletions
|
@ -94,6 +94,7 @@ typedef struct server_s {
|
|||
|
||||
frame_t frames[UPDATE_BACKUP];
|
||||
entity_state_t entities[MAX_SV_ENTITIES];
|
||||
byte ent_valid[MAX_SV_ENTITIES];
|
||||
entity_state_t baselines[MAX_SV_ENTITIES];
|
||||
player_t players[MAX_SV_PLAYERS];
|
||||
player_t *player_list; // list of players for multicast
|
||||
|
|
|
@ -513,7 +513,7 @@ client_parse_message (client_t *cl)
|
|||
qboolean move_issued = false;
|
||||
|
||||
seq_hash = cl->netchan.incoming_sequence;
|
||||
|
||||
cl->delta_sequence = -1;
|
||||
while (1) {
|
||||
if (net_message->badread) {
|
||||
qtv_printf ("SV_ReadClientMessage: badread\n");
|
||||
|
@ -533,7 +533,7 @@ client_parse_message (client_t *cl)
|
|||
case clc_nop:
|
||||
break;
|
||||
case clc_delta:
|
||||
/*cl->delta_sequence = */MSG_ReadByte (net_message);
|
||||
cl->delta_sequence = MSG_ReadByte (net_message);
|
||||
break;
|
||||
case clc_move:
|
||||
checksumIndex = MSG_GetReadCount (net_message);
|
||||
|
@ -981,12 +981,10 @@ write_entities (client_t *client, sizebuf_t *msg)
|
|||
|
||||
for (e = MAX_CLIENTS + 1, ent = sv->entities + e; e < MAX_SV_ENTITIES;
|
||||
e++, ent++) {
|
||||
// if (ent->free)
|
||||
// continue;
|
||||
|
||||
// ignore ents without visible models
|
||||
if (!ent->modelindex)
|
||||
if (!sv->ent_valid[e])
|
||||
continue;
|
||||
if (ent->number && ent->number != e)
|
||||
qtv_printf ("%d %d\n", e, ent->number);
|
||||
#if 0
|
||||
if (pvs) {
|
||||
// ignore if not touching a PV leaf
|
||||
|
@ -1002,8 +1000,10 @@ write_entities (client_t *client, sizebuf_t *msg)
|
|||
// continue; // added to the special update list
|
||||
|
||||
// add to the packetentities
|
||||
if (pack->num_entities == MAX_PACKET_ENTITIES)
|
||||
if (pack->num_entities == MAX_PACKET_ENTITIES) {
|
||||
qtv_printf ("mpe overflow\n");
|
||||
continue; // all full
|
||||
}
|
||||
|
||||
state = &pack->entities[pack->num_entities];
|
||||
pack->num_entities++;
|
||||
|
|
|
@ -306,7 +306,7 @@ static void
|
|||
sv_packetentities (server_t *sv, qmsg_t *msg, int delta)
|
||||
{
|
||||
unsigned short word;
|
||||
int newnum, oldnum, from;
|
||||
int newnum, oldnum, from, num;
|
||||
int newindex, oldindex;
|
||||
int newpacket, oldpacket;
|
||||
int full;
|
||||
|
@ -335,6 +335,7 @@ sv_packetentities (server_t *sv, qmsg_t *msg, int delta)
|
|||
oldp = &dummy;
|
||||
dummy.num_entities = 0;
|
||||
full = 1;
|
||||
memset (sv->ent_valid, 0, sizeof (sv->ent_valid));
|
||||
}
|
||||
//qtv_printf ("newp = %-5d oldp = %d\n", newpacket, oldpacket & UPDATE_MASK);
|
||||
sv->delta = sv->netchan.incoming_sequence;
|
||||
|
@ -357,8 +358,9 @@ sv_packetentities (server_t *sv, qmsg_t *msg, int delta)
|
|||
return;
|
||||
}
|
||||
newp->entities[newindex] = oldp->entities[oldindex];
|
||||
newnum = newp->entities[newindex].number;
|
||||
sv->entities[newnum] = newp->entities[newindex];
|
||||
num = newp->entities[newindex].number;
|
||||
sv->entities[num] = newp->entities[newindex];
|
||||
sv->ent_valid[num] = 1;
|
||||
newindex++;
|
||||
oldindex++;
|
||||
}
|
||||
|
@ -383,7 +385,9 @@ sv_packetentities (server_t *sv, qmsg_t *msg, int delta)
|
|||
return;
|
||||
}
|
||||
newp->entities[newindex] = oldp->entities[oldindex];
|
||||
sv->entities[newnum] = newp->entities[newindex];
|
||||
num = newp->entities[newindex].number;
|
||||
sv->entities[num] = newp->entities[newindex];
|
||||
sv->ent_valid[num] = 1;
|
||||
newindex++;
|
||||
oldindex++;
|
||||
oldnum = 9999;
|
||||
|
@ -420,13 +424,14 @@ sv_packetentities (server_t *sv, qmsg_t *msg, int delta)
|
|||
qtv_printf ("WARNING: delta on full update\n");
|
||||
}
|
||||
if (word & U_REMOVE) {
|
||||
memset (&sv->entities[newnum], 0, sizeof (entity_state_t));
|
||||
sv->ent_valid[newnum] = 0;
|
||||
oldindex++;
|
||||
continue;
|
||||
}
|
||||
newp->entities[newindex] = oldp->entities[oldindex];
|
||||
sv_parse_delta (msg, word, &sv->entities[newindex]);
|
||||
sv_parse_delta (msg, word, &newp->entities[newindex]);
|
||||
sv->entities[newnum] = newp->entities[newindex];
|
||||
sv->ent_valid[newnum] = 1;
|
||||
newindex++;
|
||||
oldindex++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue