Nano seems intent on having mvds with a few more twiddles in them - enable some of that stuff in qtv so as to not be caught out.
also fix a couple of bugs.
This commit is contained in:
parent
f101a82066
commit
12721c764b
4 changed files with 101 additions and 43 deletions
|
@ -437,7 +437,7 @@ void Prox_SendPlayerStats(sv_t *qtv, oproxy_t *prox)
|
|||
|
||||
if (msg.cursize)
|
||||
{
|
||||
// Prox_SendMessage(prox, msg.data, msg.cursize, dem_stats|(player<<3), (1<<player));
|
||||
Prox_SendMessage(qtv->cluster, prox, msg.data, msg.cursize, dem_stats|(player<<3), (1<<player));
|
||||
msg.cursize = 0;
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ void Prox_SendInitialPlayers(sv_t *qtv, oproxy_t *prox, netmsg_t *msg)
|
|||
|
||||
for (j = 0 ; j < 3 ; j++)
|
||||
if (flags & (DF_ANGLES << j))
|
||||
WriteShort (msg, qtv->map.players[i].current.angles[j]);
|
||||
WriteShort (msg, (qtv->map.players[i].current.angles[j]/360.0f)*0x10000);
|
||||
|
||||
if (flags & DF_MODEL) // generally, that why we wrote this function, so YES send this
|
||||
WriteByte (msg, qtv->map.players[i].current.modelindex);
|
||||
|
|
|
@ -149,7 +149,7 @@ static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playerma
|
|||
// supported |= PEXT_CHUNKEDDOWNLOADS; //shouldn't be relevant...
|
||||
supported |= PEXT_TRANS|PEXT_MODELDBL|PEXT_ENTITYDBL|PEXT_ENTITYDBL2|PEXT_SOUNDDBL;
|
||||
|
||||
//replaced by replacementdeltas. we parse these, but we don't actually forward the data right now
|
||||
//replaced by replacementdeltas.
|
||||
supported |= PEXT_SCALE|PEXT_TRANS|PEXT_FATNESS|PEXT_COLOURMOD|PEXT_HEXEN2|PEXT_SETATTACHMENT|PEXT_DPFLAGS;
|
||||
|
||||
//stuff that we ought to handle, but don't currently
|
||||
|
@ -163,7 +163,7 @@ static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playerma
|
|||
//totally optional... so will probably never be added...
|
||||
//PEXT_HULLSIZE - bigger players... maybe. like anyone can depend on this... not supported with mvd players so w/e
|
||||
//PEXT_CHUNKEDDOWNLOADS - not sure there's much point
|
||||
//PEXT_SPLITSCREEN - irrelevant for mvds. might be useful as a qw client, but who cares.
|
||||
//PEXT_SPLITSCREEN - irrelevant for mvds. might be useful as a qw client, but who cares. not enough servers have it active.
|
||||
//PEXT_SHOWPIC - rare, lame, limited. just yuck.
|
||||
|
||||
if (protocol & ~supported)
|
||||
|
@ -919,34 +919,34 @@ static void ParseEntityDelta(sv_t *tv, netmsg_t *m, const entity_state_t *old, e
|
|||
if (flags & UX_ALPHA)
|
||||
new->alpha = ReadByte(m);
|
||||
if (flags & UX_FATNESS)
|
||||
/*new->fatness = (signed char)*/ReadByte(m);
|
||||
new->fatness = (signed char)ReadByte(m);
|
||||
if (flags & UX_DRAWFLAGS)
|
||||
/*new->hexen2flags =*/ ReadByte(m);
|
||||
new->drawflags = ReadByte(m);
|
||||
if (flags & UX_ABSLIGHT)
|
||||
/*new->abslight =*/ ReadByte(m);
|
||||
new->abslight = ReadByte(m);
|
||||
if (flags & UX_COLOURMOD)
|
||||
{
|
||||
/*new->colormod[0] =*/ ReadByte(m);
|
||||
/*new->colormod[1] =*/ ReadByte(m);
|
||||
/*new->colormod[2] =*/ ReadByte(m);
|
||||
new->colormod[0] = ReadByte(m);
|
||||
new->colormod[1] = ReadByte(m);
|
||||
new->colormod[2] = ReadByte(m);
|
||||
}
|
||||
if (flags & UX_DPFLAGS)
|
||||
{ // these are bits for the 'flags' field of the entity_state_t
|
||||
/*new->dpflags =*/ ReadByte(m);
|
||||
new->dpflags = ReadByte(m);
|
||||
}
|
||||
if (flags & UX_TAGINFO)
|
||||
{
|
||||
/*new->tagentity =*/ ReadShort(m);
|
||||
/*new->tagindex =*/ ReadShort(m);
|
||||
new->tagentity = ReadShort(m);
|
||||
new->tagindex = ReadShort(m);
|
||||
}
|
||||
if (flags & UX_LIGHT)
|
||||
{
|
||||
/*new->light[0] =*/ ReadShort(m);
|
||||
/*new->light[1] =*/ ReadShort(m);
|
||||
/*new->light[2] =*/ ReadShort(m);
|
||||
/*new->light[3] =*/ ReadShort(m);
|
||||
/*new->lightstyle =*/ ReadByte(m);
|
||||
/*new->lightpflags =*/ ReadByte(m);
|
||||
new->light[0] = ReadShort(m);
|
||||
new->light[1] = ReadShort(m);
|
||||
new->light[2] = ReadShort(m);
|
||||
new->light[3] = ReadShort(m);
|
||||
new->lightstyle = ReadByte(m);
|
||||
new->lightpflags = ReadByte(m);
|
||||
}
|
||||
if (flags & UX_EFFECTS16)
|
||||
new->effects = (new->effects&0x00ff)|(ReadByte(m)<<8);
|
||||
|
|
29
fteqtv/qtv.h
29
fteqtv/qtv.h
|
@ -383,22 +383,29 @@ typedef struct {
|
|||
unsigned short modelindex;
|
||||
unsigned char colormap;
|
||||
unsigned char skinnum;
|
||||
|
||||
float origin[3];
|
||||
float angles[3];
|
||||
|
||||
unsigned short effects;
|
||||
unsigned char alpha;
|
||||
unsigned char scale;
|
||||
// unsigned char fatness;
|
||||
// unsigned char abslight;
|
||||
// unsigned char h2flags;
|
||||
// unsigned char colormod[3];
|
||||
// unsigned short light[4];
|
||||
// unsigned char lightstyle;
|
||||
// unsigned char lightpflags;
|
||||
// unsigned char tagentity;
|
||||
// unsigned char tagindex;
|
||||
unsigned char fatness;
|
||||
|
||||
unsigned char colormod[3];
|
||||
unsigned char alpha;
|
||||
|
||||
unsigned short light[4];
|
||||
|
||||
unsigned char lightstyle;
|
||||
unsigned char lightpflags;
|
||||
unsigned char abslight;
|
||||
unsigned char drawflags;
|
||||
|
||||
unsigned char dpflags;
|
||||
unsigned char tagindex; //networked as a short, should have been a byte to match dpp5+.
|
||||
unsigned short tagentity;
|
||||
} entity_state_t;
|
||||
typedef struct {
|
||||
typedef struct { //qw does players weirdly.
|
||||
unsigned char frame;
|
||||
unsigned char modelindex;
|
||||
//colormap
|
||||
|
|
77
fteqtv/qw.c
77
fteqtv/qw.c
|
@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
static const filename_t ConnectionlessModelList[] = {{""}, {"maps/start.bsp"}, {"progs/player.mdl"}, {""}};
|
||||
static const filename_t ConnectionlessSoundList[] = {{""}, {""}};
|
||||
const entity_state_t nullentstate = {0};
|
||||
void SV_WriteDelta(int entnum, const entity_state_t *from, const entity_state_t *to, netmsg_t *msg, qboolean force, unsigned int pext);
|
||||
|
||||
const intermission_t nullstreamspot = {{544, 288, 64}, {0, 90, 0}};
|
||||
|
||||
|
@ -536,9 +538,17 @@ int SendCurrentBaselines(sv_t *tv, int cursize, netmsg_t *msg, int maxbuffersize
|
|||
|
||||
if (tv->map.entity[i].baseline.modelindex)
|
||||
{
|
||||
WriteByte(msg, svc_spawnbaseline);
|
||||
WriteShort(msg, i);
|
||||
WriteEntityState(msg, &tv->map.entity[i].baseline, tv->pext1);
|
||||
if (tv->pext1 & PEXT_SPAWNSTATIC2)
|
||||
{
|
||||
WriteByte(msg, svcfte_spawnbaseline2);
|
||||
SV_WriteDelta(i, &nullentstate, &tv->map.entity[i].baseline, msg, true, tv->pext1);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteByte(msg, svc_spawnbaseline);
|
||||
WriteShort(msg, i);
|
||||
WriteEntityState(msg, &tv->map.entity[i].baseline, tv->pext1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,8 +610,16 @@ int SendStaticEntities(sv_t *tv, int cursize, netmsg_t *msg, int maxbuffersize,
|
|||
if (!tv->map.spawnstatic[i].modelindex)
|
||||
continue;
|
||||
|
||||
WriteByte(msg, svc_spawnstatic);
|
||||
WriteEntityState(msg, &tv->map.spawnstatic[i], tv->pext1);
|
||||
if (tv->pext1 & PEXT_SPAWNSTATIC2)
|
||||
{
|
||||
WriteByte(msg, svcfte_spawnstatic2);
|
||||
SV_WriteDelta(i, &nullentstate, &tv->map.spawnstatic[i], msg, true, tv->pext1);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteByte(msg, svc_spawnstatic);
|
||||
WriteEntityState(msg, &tv->map.spawnstatic[i], tv->pext1);
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
|
@ -892,7 +910,7 @@ void NewNQClient(cluster_t *cluster, netadr_t *addr)
|
|||
int len;
|
||||
int i;
|
||||
unsigned char buffer[64];
|
||||
viewer_t *viewer = NULL;;
|
||||
viewer_t *viewer = NULL;
|
||||
|
||||
|
||||
if (cluster->numviewers >= cluster->maxviewers && cluster->maxviewers)
|
||||
|
@ -1549,12 +1567,45 @@ void SV_WriteDelta(int entnum, const entity_state_t *from, const entity_state_t
|
|||
bits |= U_FRAME;
|
||||
if ((from->effects&0xff) != (to->effects&0xff))
|
||||
bits |= U_EFFECTS;
|
||||
if ((from->effects&0xff00) != (to->effects&0xff00))
|
||||
|
||||
if ((from->effects&0xff00) != (to->effects&0xff00) &&
|
||||
pext & PEXT_DPFLAGS)
|
||||
bits |= UX_EFFECTS16;
|
||||
if (from->alpha != to->alpha)
|
||||
if (from->alpha != to->alpha &&
|
||||
pext & PEXT_TRANS)
|
||||
bits |= UX_ALPHA;
|
||||
if (from->scale != to->scale)
|
||||
if (from->scale != to->scale &&
|
||||
pext & PEXT_SCALE)
|
||||
bits |= UX_SCALE;
|
||||
if (from->fatness != to->fatness &&
|
||||
pext & PEXT_FATNESS)
|
||||
bits |= UX_FATNESS;
|
||||
if (from->drawflags != to->drawflags &&
|
||||
pext & PEXT_HEXEN2)
|
||||
bits |= UX_DRAWFLAGS;
|
||||
if (from->abslight != to->abslight &&
|
||||
pext & PEXT_HEXEN2)
|
||||
bits |= UX_ABSLIGHT;
|
||||
if ((from->colormod[0]!= to->colormod[0] ||
|
||||
from->colormod[1] != to->colormod[1] ||
|
||||
from->colormod[2] != to->colormod[2]) &&
|
||||
pext & PEXT_COLOURMOD)
|
||||
bits |= UX_COLOURMOD;
|
||||
if (from->dpflags != to->dpflags &&
|
||||
pext & PEXT_DPFLAGS)
|
||||
bits |= UX_DPFLAGS;
|
||||
if ((from->tagentity != to->tagentity ||
|
||||
from->tagindex != to->tagindex) &&
|
||||
pext & PEXT_SETATTACHMENT)
|
||||
bits |= UX_TAGINFO;
|
||||
if ((from->light[0] != to->light[0] ||
|
||||
from->light[1] != to->light[1] ||
|
||||
from->light[2] != to->light[2] ||
|
||||
from->light[3] != to->light[3] ||
|
||||
from->lightstyle != to->lightstyle ||
|
||||
from->lightpflags != to->lightpflags) &&
|
||||
pext & PEXT_DPFLAGS)
|
||||
bits |= UX_LIGHT;
|
||||
|
||||
if (bits & 0xff000000)
|
||||
bits |= UX_YETMORE;
|
||||
|
@ -1608,10 +1659,10 @@ void SV_WriteDelta(int entnum, const entity_state_t *from, const entity_state_t
|
|||
WriteByte (msg, to->scale);
|
||||
if (bits & UX_ALPHA)
|
||||
WriteByte (msg, to->alpha);
|
||||
/* if (bits & UX_FATNESS)
|
||||
if (bits & UX_FATNESS)
|
||||
WriteByte (msg, to->fatness);
|
||||
if (bits & UX_DRAWFLAGS)
|
||||
WriteByte (msg, to->hexen2flags);
|
||||
WriteByte (msg, to->drawflags);
|
||||
if (bits & UX_ABSLIGHT)
|
||||
WriteByte (msg, to->abslight);
|
||||
if (bits & UX_COLOURMOD)
|
||||
|
@ -1637,12 +1688,11 @@ void SV_WriteDelta(int entnum, const entity_state_t *from, const entity_state_t
|
|||
WriteShort (msg, to->light[3]);
|
||||
WriteByte (msg, to->lightstyle);
|
||||
WriteByte (msg, to->lightpflags);
|
||||
}*/
|
||||
}
|
||||
if (bits & UX_EFFECTS16)
|
||||
WriteByte (msg, to->effects>>8);
|
||||
}
|
||||
|
||||
const entity_state_t nullentstate = {0};
|
||||
void SV_EmitPacketEntities (const sv_t *qtv, const viewer_t *v, const packet_entities_t *to, netmsg_t *msg)
|
||||
{
|
||||
const entity_state_t *baseline;
|
||||
|
@ -2607,6 +2657,7 @@ void UpdateStats(sv_t *qtv, viewer_t *v)
|
|||
}
|
||||
|
||||
//returns the next prespawn 'buffer' number to use, or -1 if no more
|
||||
//FIXME: viewer may support fewer/different extensions vs the the stream.
|
||||
int Prespawn(sv_t *qtv, int curmsgsize, netmsg_t *msg, int bufnum, int thisplayer)
|
||||
{
|
||||
int r, ni;
|
||||
|
|
Loading…
Reference in a new issue