Some changes to the way the proxy works, now the player will get the aliases
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2641 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
ee24c17cce
commit
5a16c2f01d
4 changed files with 131 additions and 59 deletions
|
@ -103,6 +103,11 @@ void ConnectionData(sv_t *tv, void *buffer, int length, int to, unsigned int pla
|
||||||
{
|
{
|
||||||
if (!tv->parsingconnectiondata)
|
if (!tv->parsingconnectiondata)
|
||||||
Multicast(tv, buffer, length, to, playermask, suitablefor);
|
Multicast(tv, buffer, length, to, playermask, suitablefor);
|
||||||
|
else if (tv->controller)
|
||||||
|
{
|
||||||
|
if (suitablefor&(tv->controller->netchan.isnqprotocol?NQ:QW))
|
||||||
|
SendBufferToViewer(tv->controller, buffer, length, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playermask)
|
static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playermask)
|
||||||
|
@ -133,6 +138,8 @@ static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playerma
|
||||||
tv->thisplayer = MAX_CLIENTS-1;
|
tv->thisplayer = MAX_CLIENTS-1;
|
||||||
/*tv->servertime =*/ ReadFloat(m);
|
/*tv->servertime =*/ ReadFloat(m);
|
||||||
}
|
}
|
||||||
|
if (tv->controller)
|
||||||
|
tv->controller->thisplayer = tv->thisplayer;
|
||||||
ReadString(m, tv->mapname, sizeof(tv->mapname));
|
ReadString(m, tv->mapname, sizeof(tv->mapname));
|
||||||
|
|
||||||
QTV_Printf(tv, "Gamedir: %s\n", tv->gamedir);
|
QTV_Printf(tv, "Gamedir: %s\n", tv->gamedir);
|
||||||
|
@ -174,11 +181,13 @@ static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playerma
|
||||||
tv->frame[i].numents = 0;
|
tv->frame[i].numents = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tv->usequakeworldprotocols)
|
if (!tv->controller && tv->usequakeworldprotocols)
|
||||||
{
|
{
|
||||||
tv->netchan.message.cursize = 0; //mvdsv sucks
|
tv->netchan.message.cursize = 0; //mvdsv sucks
|
||||||
SendClientCommand(tv, "soundlist %i 0\n", tv->clservercount);
|
SendClientCommand(tv, "soundlist %i 0\n", tv->clservercount);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ConnectionData(tv, (void*)((char*)m->data+m->startpos), m->readpos - m->startpos, to, dem_read, QW);
|
||||||
strcpy(tv->status, "Receiving soundlist\n");
|
strcpy(tv->status, "Receiving soundlist\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,14 +241,16 @@ static void ParseStufftext(sv_t *tv, netmsg_t *m, int to, unsigned int mask)
|
||||||
|
|
||||||
for (v = tv->cluster->viewers; v; v = v->next)
|
for (v = tv->cluster->viewers; v; v = v->next)
|
||||||
{
|
{
|
||||||
if (v->server == tv)
|
if (v->server == tv && v != tv->controller)
|
||||||
{
|
{
|
||||||
v->servercount++;
|
v->servercount++;
|
||||||
SendBufferToViewer(v, newcmd, sizeof(newcmd), true);
|
SendBufferToViewer(v, newcmd, sizeof(newcmd), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tv->usequakeworldprotocols)
|
if (tv->controller)
|
||||||
|
SendBufferToViewer(tv->controller, (char*)m->data+m->startpos, m->readpos - m->startpos, true);
|
||||||
|
else if (tv->usequakeworldprotocols)
|
||||||
SendClientCommand(tv, "begin %i\n", tv->clservercount);
|
SendClientCommand(tv, "begin %i\n", tv->clservercount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -286,13 +297,17 @@ static void ParseStufftext(sv_t *tv, netmsg_t *m, int to, unsigned int mask)
|
||||||
}
|
}
|
||||||
else if (!strncmp(text, "cmd ", 4))
|
else if (!strncmp(text, "cmd ", 4))
|
||||||
{
|
{
|
||||||
if (tv->usequakeworldprotocols)
|
if (tv->controller)
|
||||||
|
SendBufferToViewer(tv->controller, (char*)m->data+m->startpos, m->readpos - m->startpos, true);
|
||||||
|
else if (tv->usequakeworldprotocols)
|
||||||
SendClientCommand(tv, "%s", text+4);
|
SendClientCommand(tv, "%s", text+4);
|
||||||
return; //commands the game server asked for are pointless.
|
return; //commands the game server asked for are pointless.
|
||||||
}
|
}
|
||||||
else if (!strncmp(text, "reconnect", 9))
|
else if (!strncmp(text, "reconnect", 9))
|
||||||
{
|
{
|
||||||
if (tv->usequakeworldprotocols)
|
if (tv->controller)
|
||||||
|
SendBufferToViewer(tv->controller, (char*)m->data+m->startpos, m->readpos - m->startpos, true);
|
||||||
|
else if (tv->usequakeworldprotocols)
|
||||||
SendClientCommand(tv, "new\n");
|
SendClientCommand(tv, "new\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -325,6 +340,7 @@ static void ParseStufftext(sv_t *tv, netmsg_t *m, int to, unsigned int mask)
|
||||||
else if (tv->usequakeworldprotocols && !strncmp(text, "setinfo ", 8))
|
else if (tv->usequakeworldprotocols && !strncmp(text, "setinfo ", 8))
|
||||||
{
|
{
|
||||||
Multicast(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, Q1);
|
Multicast(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, Q1);
|
||||||
|
if (!tv->controller)
|
||||||
SendClientCommand(tv, text);
|
SendClientCommand(tv, text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -473,6 +489,8 @@ static void ParseBaseline(sv_t *tv, netmsg_t *m, int to, unsigned int mask)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ParseEntityState(&tv->entity[entnum].baseline, m);
|
ParseEntityState(&tv->entity[entnum].baseline, m);
|
||||||
|
|
||||||
|
ConnectionData(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, Q1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ParseStaticSound(sv_t *tv, netmsg_t *m, int to, unsigned int mask)
|
static void ParseStaticSound(sv_t *tv, netmsg_t *m, int to, unsigned int mask)
|
||||||
|
@ -1644,7 +1662,8 @@ void ParseMessage(sv_t *tv, void *buffer, int length, int to, int mask)
|
||||||
}
|
}
|
||||||
strcpy(tv->status, "Prespawning\n");
|
strcpy(tv->status, "Prespawning\n");
|
||||||
}
|
}
|
||||||
if (tv->usequakeworldprotocols)
|
ConnectionData(tv, (void*)((char*)buf.data+buf.startpos), buf.readpos - buf.startpos, to, mask, QW);
|
||||||
|
if (tv->usequakeworldprotocols && !tv->controller)
|
||||||
{
|
{
|
||||||
if (i)
|
if (i)
|
||||||
SendClientCommand(tv, "modellist %i %i\n", tv->clservercount, i);
|
SendClientCommand(tv, "modellist %i %i\n", tv->clservercount, i);
|
||||||
|
@ -1682,7 +1701,8 @@ void ParseMessage(sv_t *tv, void *buffer, int length, int to, int mask)
|
||||||
i = ParseList(tv, &buf, tv->soundlist, to, mask);
|
i = ParseList(tv, &buf, tv->soundlist, to, mask);
|
||||||
if (!i)
|
if (!i)
|
||||||
strcpy(tv->status, "Receiving modellist\n");
|
strcpy(tv->status, "Receiving modellist\n");
|
||||||
if (tv->usequakeworldprotocols)
|
ConnectionData(tv, (void*)((char*)buf.data+buf.startpos), buf.readpos - buf.startpos, to, mask, QW);
|
||||||
|
if (tv->usequakeworldprotocols && !tv->controller)
|
||||||
{
|
{
|
||||||
if (i)
|
if (i)
|
||||||
SendClientCommand(tv, "soundlist %i %i\n", tv->clservercount, i);
|
SendClientCommand(tv, "soundlist %i %i\n", tv->clservercount, i);
|
||||||
|
|
|
@ -347,7 +347,6 @@ typedef struct viewer_s {
|
||||||
qboolean thinksitsconnected;
|
qboolean thinksitsconnected;
|
||||||
qboolean conmenussupported;
|
qboolean conmenussupported;
|
||||||
qboolean isproxy;
|
qboolean isproxy;
|
||||||
int delta_frame;
|
|
||||||
|
|
||||||
int servercount;
|
int servercount;
|
||||||
|
|
||||||
|
@ -360,6 +359,7 @@ typedef struct viewer_s {
|
||||||
int userid;
|
int userid;
|
||||||
|
|
||||||
packet_entities_t frame[ENTITY_FRAMES];
|
packet_entities_t frame[ENTITY_FRAMES];
|
||||||
|
int delta_frames[ENTITY_FRAMES];
|
||||||
|
|
||||||
struct viewer_s *next;
|
struct viewer_s *next;
|
||||||
struct viewer_s *commentator;
|
struct viewer_s *commentator;
|
||||||
|
@ -776,6 +776,7 @@ qboolean Net_StopFileProxy(sv_t *qtv);
|
||||||
void SV_FindProxies(SOCKET sock, cluster_t *cluster, sv_t *defaultqtv);
|
void SV_FindProxies(SOCKET sock, cluster_t *cluster, sv_t *defaultqtv);
|
||||||
qboolean SV_ReadPendingProxy(cluster_t *cluster, oproxy_t *pend);
|
qboolean SV_ReadPendingProxy(cluster_t *cluster, oproxy_t *pend);
|
||||||
void SV_ForwardStream(sv_t *qtv, void *buffer, int length);
|
void SV_ForwardStream(sv_t *qtv, void *buffer, int length);
|
||||||
|
int SV_SayToUpstream(sv_t *qtv, char *message);
|
||||||
|
|
||||||
unsigned char *FS_ReadFile(char *gamedir, char *filename, unsigned int *size);
|
unsigned char *FS_ReadFile(char *gamedir, char *filename, unsigned int *size);
|
||||||
|
|
||||||
|
|
92
fteqtv/qw.c
92
fteqtv/qw.c
|
@ -378,6 +378,8 @@ void SendServerData(sv_t *tv, viewer_t *viewer)
|
||||||
SendBufferToViewer(viewer, msg.data, msg.cursize, true);
|
SendBufferToViewer(viewer, msg.data, msg.cursize, true);
|
||||||
|
|
||||||
viewer->thinksitsconnected = false;
|
viewer->thinksitsconnected = false;
|
||||||
|
if (tv && (tv->controller == viewer))
|
||||||
|
viewer->thinksitsconnected = true;
|
||||||
|
|
||||||
memset(viewer->currentstats, 0, sizeof(viewer->currentstats));
|
memset(viewer->currentstats, 0, sizeof(viewer->currentstats));
|
||||||
}
|
}
|
||||||
|
@ -829,6 +831,7 @@ void NewNQClient(cluster_t *cluster, netadr_t *addr)
|
||||||
sv_t *initialserver;
|
sv_t *initialserver;
|
||||||
int header;
|
int header;
|
||||||
int len;
|
int len;
|
||||||
|
int i;
|
||||||
unsigned char buffer[64];
|
unsigned char buffer[64];
|
||||||
viewer_t *viewer = NULL;;
|
viewer_t *viewer = NULL;;
|
||||||
|
|
||||||
|
@ -879,7 +882,8 @@ void NewNQClient(cluster_t *cluster, netadr_t *addr)
|
||||||
|
|
||||||
viewer->next = cluster->viewers;
|
viewer->next = cluster->viewers;
|
||||||
cluster->viewers = viewer;
|
cluster->viewers = viewer;
|
||||||
viewer->delta_frame = -1;
|
for (i = 0; i < ENTITY_FRAMES; i++)
|
||||||
|
viewer->delta_frames[i] = -1;
|
||||||
|
|
||||||
initialserver = NULL;
|
initialserver = NULL;
|
||||||
if (cluster->numservers == 1)
|
if (cluster->numservers == 1)
|
||||||
|
@ -914,6 +918,7 @@ void NewQWClient(cluster_t *cluster, netadr_t *addr, char *connectmessage)
|
||||||
char qport[32];
|
char qport[32];
|
||||||
char challenge[32];
|
char challenge[32];
|
||||||
char infostring[256];
|
char infostring[256];
|
||||||
|
int i;
|
||||||
|
|
||||||
connectmessage+=11;
|
connectmessage+=11;
|
||||||
|
|
||||||
|
@ -941,7 +946,8 @@ void NewQWClient(cluster_t *cluster, netadr_t *addr, char *connectmessage)
|
||||||
|
|
||||||
viewer->next = cluster->viewers;
|
viewer->next = cluster->viewers;
|
||||||
cluster->viewers = viewer;
|
cluster->viewers = viewer;
|
||||||
viewer->delta_frame = -1;
|
for (i = 0; i < ENTITY_FRAMES; i++)
|
||||||
|
viewer->delta_frames[i] = -1;
|
||||||
|
|
||||||
initialserver = NULL;
|
initialserver = NULL;
|
||||||
if (cluster->nouserconnects && cluster->numservers == 1)
|
if (cluster->nouserconnects && cluster->numservers == 1)
|
||||||
|
@ -1283,15 +1289,18 @@ void SV_EmitPacketEntities (const sv_t *qtv, const viewer_t *v, const packet_ent
|
||||||
int oldindex, newindex;
|
int oldindex, newindex;
|
||||||
int oldnum, newnum;
|
int oldnum, newnum;
|
||||||
int oldmax;
|
int oldmax;
|
||||||
|
int delta_frame;
|
||||||
|
|
||||||
|
delta_frame = v->delta_frames[v->netchan.outgoing_sequence&(ENTITY_FRAMES-1)];
|
||||||
|
|
||||||
// this is the frame that we are going to delta update from
|
// this is the frame that we are going to delta update from
|
||||||
if (v->delta_frame != -1)
|
if (delta_frame != -1)
|
||||||
{
|
{
|
||||||
from = &v->frame[v->delta_frame & (ENTITY_FRAMES-1)];
|
from = &v->frame[delta_frame & (ENTITY_FRAMES-1)];
|
||||||
oldmax = from->numents;
|
oldmax = from->numents;
|
||||||
|
|
||||||
WriteByte (msg, svc_deltapacketentities);
|
WriteByte (msg, svc_deltapacketentities);
|
||||||
WriteByte (msg, v->delta_frame);
|
WriteByte (msg, delta_frame);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1934,8 +1943,13 @@ void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
|
||||||
lerp = 1;
|
lerp = 1;
|
||||||
|
|
||||||
if (tv->controller == v)
|
if (tv->controller == v)
|
||||||
|
{
|
||||||
lerp = 1;
|
lerp = 1;
|
||||||
|
track = tv->thisplayer;
|
||||||
|
v->trackplayer = tv->thisplayer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
cv = GetCommentator(v);
|
cv = GetCommentator(v);
|
||||||
track = cv->trackplayer;
|
track = cv->trackplayer;
|
||||||
|
|
||||||
|
@ -1955,6 +1969,7 @@ void SendPlayerStates(sv_t *tv, viewer_t *v, netmsg_t *msg)
|
||||||
QW_StuffcmdToViewer (v, "track %i\n", tv->trackplayer);
|
QW_StuffcmdToViewer (v, "track %i\n", tv->trackplayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_CLIENTS; i++)
|
for (i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
|
@ -3095,6 +3110,7 @@ void QTV_Say(cluster_t *cluster, sv_t *qtv, viewer_t *v, char *message, qboolean
|
||||||
if (cluster->notalking)
|
if (cluster->notalking)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (v->server)
|
||||||
SV_SayToUpstream(v->server, message);
|
SV_SayToUpstream(v->server, message);
|
||||||
|
|
||||||
for (ov = cluster->viewers; ov; ov = ov->next)
|
for (ov = cluster->viewers; ov; ov = ov->next)
|
||||||
|
@ -3112,8 +3128,11 @@ void QTV_Say(cluster_t *cluster, sv_t *qtv, viewer_t *v, char *message, qboolean
|
||||||
{
|
{
|
||||||
if (ov->conmenussupported)
|
if (ov->conmenussupported)
|
||||||
{
|
{
|
||||||
WriteByte(&msg, 3); //PRINT_CHAT
|
WriteByte(&msg, 2); //PRINT_HIGH
|
||||||
WriteString2(&msg, "[^sQTV^s]^s^5");
|
WriteByte(&msg, 91+128);
|
||||||
|
WriteString2(&msg, "QTV");
|
||||||
|
WriteByte(&msg, 93+128);
|
||||||
|
WriteString2(&msg, "^5");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3132,6 +3151,8 @@ void QTV_Say(cluster_t *cluster, sv_t *qtv, viewer_t *v, char *message, qboolean
|
||||||
WriteString2(&msg, v->name);
|
WriteString2(&msg, v->name);
|
||||||
WriteString2(&msg, ": ");
|
WriteString2(&msg, ": ");
|
||||||
// WriteString2(&msg, "\x8d ");
|
// WriteString2(&msg, "\x8d ");
|
||||||
|
if (ov->conmenussupported)
|
||||||
|
WriteString2(&msg, "^s");
|
||||||
WriteString2(&msg, message);
|
WriteString2(&msg, message);
|
||||||
WriteString(&msg, "\n");
|
WriteString(&msg, "\n");
|
||||||
|
|
||||||
|
@ -3459,8 +3480,9 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
netmsg_t msg;
|
netmsg_t msg;
|
||||||
int i;
|
int i;
|
||||||
|
int iscont;
|
||||||
|
|
||||||
v->delta_frame = -1;
|
v->delta_frames[v->netchan.incoming_sequence & (ENTITY_FRAMES-1)] = -1;
|
||||||
|
|
||||||
while (m->readpos < m->cursize)
|
while (m->readpos < m->cursize)
|
||||||
{
|
{
|
||||||
|
@ -3470,18 +3492,19 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
case clc_nop:
|
case clc_nop:
|
||||||
return;
|
return;
|
||||||
case clc_delta:
|
case clc_delta:
|
||||||
v->delta_frame = ReadByte(m);
|
v->delta_frames[v->netchan.incoming_sequence & (ENTITY_FRAMES-1)] = ReadByte(m);
|
||||||
break;
|
break;
|
||||||
case clc_stringcmd:
|
case clc_stringcmd:
|
||||||
ReadString (m, buf, sizeof(buf));
|
ReadString (m, buf, sizeof(buf));
|
||||||
// printf("stringcmd: %s\n", buf);
|
|
||||||
|
iscont = v->server && v->server->controller == v;
|
||||||
|
|
||||||
if (!strncmp(buf, "cmd ", 4))
|
if (!strncmp(buf, "cmd ", 4))
|
||||||
{
|
{
|
||||||
if (v->server && v->server->controller == v)
|
if (v->server && v->server->controller == v)
|
||||||
SendClientCommand(v->server, "%s", buf+4);
|
SendClientCommand(v->server, "%s", buf+4);
|
||||||
}
|
}
|
||||||
else if (!strcmp(buf, "new"))
|
else if (!iscont && !strcmp(buf, "new"))
|
||||||
{
|
{
|
||||||
if (qtv && qtv->parsingconnectiondata)
|
if (qtv && qtv->parsingconnectiondata)
|
||||||
QW_StuffcmdToViewer(v, "cmd new\n");
|
QW_StuffcmdToViewer(v, "cmd new\n");
|
||||||
|
@ -3491,7 +3514,7 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
SendServerData(qtv, v);
|
SendServerData(qtv, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "modellist ", 10))
|
else if (!iscont && !strncmp(buf, "modellist ", 10))
|
||||||
{
|
{
|
||||||
char *cmd = buf+10;
|
char *cmd = buf+10;
|
||||||
int svcount = atoi(cmd);
|
int svcount = atoi(cmd);
|
||||||
|
@ -3515,7 +3538,7 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
SendList(qtv, first, qtv->modellist, svc_modellist, &msg);
|
SendList(qtv, first, qtv->modellist, svc_modellist, &msg);
|
||||||
SendBufferToViewer(v, msg.data, msg.cursize, true);
|
SendBufferToViewer(v, msg.data, msg.cursize, true);
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "soundlist ", 10))
|
else if (!iscont && !strncmp(buf, "soundlist ", 10))
|
||||||
{
|
{
|
||||||
char *cmd = buf+10;
|
char *cmd = buf+10;
|
||||||
int svcount = atoi(cmd);
|
int svcount = atoi(cmd);
|
||||||
|
@ -3539,7 +3562,7 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
SendList(qtv, first, qtv->soundlist, svc_soundlist, &msg);
|
SendList(qtv, first, qtv->soundlist, svc_soundlist, &msg);
|
||||||
SendBufferToViewer(v, msg.data, msg.cursize, true);
|
SendBufferToViewer(v, msg.data, msg.cursize, true);
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "prespawn", 8))
|
else if (!iscont && !strncmp(buf, "prespawn", 8))
|
||||||
{
|
{
|
||||||
char skin[128];
|
char skin[128];
|
||||||
|
|
||||||
|
@ -3605,7 +3628,7 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
SendBufferToViewer(v, skin, strlen(skin)+1, true);
|
SendBufferToViewer(v, skin, strlen(skin)+1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "spawn", 5))
|
else if (!iscont && !strncmp(buf, "spawn", 5))
|
||||||
{
|
{
|
||||||
char skin[64];
|
char skin[64];
|
||||||
sprintf(skin, "%cskins\n", svc_stufftext);
|
sprintf(skin, "%cskins\n", svc_stufftext);
|
||||||
|
@ -3613,7 +3636,13 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
|
|
||||||
QW_PositionAtIntermission(qtv, v);
|
QW_PositionAtIntermission(qtv, v);
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "begin", 5))
|
else if (iscont && !strncmp(buf, "begin", 5))
|
||||||
|
{ //the client made it!
|
||||||
|
v->thinksitsconnected = true;
|
||||||
|
qtv->parsingconnectiondata = false;
|
||||||
|
SendClientCommand(v->server, "%s", buf);
|
||||||
|
}
|
||||||
|
else if (!iscont && !strncmp(buf, "begin", 5))
|
||||||
{
|
{
|
||||||
int oldmenu;
|
int oldmenu;
|
||||||
viewer_t *com;
|
viewer_t *com;
|
||||||
|
@ -3681,7 +3710,7 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
v->trackplayer = -1;
|
v->trackplayer = -1;
|
||||||
QW_SetCommentator(cluster, v, NULL); //clicking out will stop the client from tracking thier commentator
|
QW_SetCommentator(cluster, v, NULL); //clicking out will stop the client from tracking thier commentator
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "pings", 5))
|
else if (!iscont && !strncmp(buf, "pings", 5))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else if (!strncmp(buf, "say \"", 5))
|
else if (!strncmp(buf, "say \"", 5))
|
||||||
|
@ -3774,7 +3803,9 @@ void ParseQWC(cluster_t *cluster, sv_t *qtv, viewer_t *v, netmsg_t *m)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (v->server && v->server->controller == v)
|
if (v->server && v->server->controller == v)
|
||||||
|
{
|
||||||
SendClientCommand(v->server, "%s", buf);
|
SendClientCommand(v->server, "%s", buf);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Sys_Printf(cluster, "Client sent unknown string command: %s\n", buf);
|
Sys_Printf(cluster, "Client sent unknown string command: %s\n", buf);
|
||||||
}
|
}
|
||||||
|
@ -4454,8 +4485,13 @@ void SendViewerPackets(cluster_t *cluster, viewer_t *v)
|
||||||
v->nextpacket = cluster->curtime+1000/NQ_PACKETS_PER_SECOND;
|
v->nextpacket = cluster->curtime+1000/NQ_PACKETS_PER_SECOND;
|
||||||
|
|
||||||
useserver = v->server;
|
useserver = v->server;
|
||||||
|
if (useserver && useserver->controller == v)
|
||||||
|
v->netchan.outgoing_sequence = useserver->netchan.incoming_sequence;
|
||||||
|
else
|
||||||
|
{
|
||||||
if (useserver && useserver->parsingconnectiondata)
|
if (useserver && useserver->parsingconnectiondata)
|
||||||
useserver = NULL;
|
useserver = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
v->maysend = false;
|
v->maysend = false;
|
||||||
InitNetMsg(&m, buffer, MAX_MSGLEN);
|
InitNetMsg(&m, buffer, MAX_MSGLEN);
|
||||||
|
@ -4470,15 +4506,24 @@ void SendViewerPackets(cluster_t *cluster, viewer_t *v)
|
||||||
}
|
}
|
||||||
if (v->menunum)
|
if (v->menunum)
|
||||||
Menu_Draw(cluster, v);
|
Menu_Draw(cluster, v);
|
||||||
else if (v->server && v->server->parsingconnectiondata)
|
else if (v->server && v->server->parsingconnectiondata && v->server->controller != v)
|
||||||
{
|
{
|
||||||
WriteByte(&m, svc_centerprint);
|
WriteByte(&m, svc_centerprint);
|
||||||
WriteString(&m, v->server->status);
|
WriteString(&m, v->server->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("in %i, out %i, ", v->netchan.incoming_sequence, v->netchan.outgoing_sequence);
|
//printf("in %i, out %i\n", v->netchan.incoming_sequence, v->netchan.outgoing_sequence);
|
||||||
//if (v->netchan.incoming_sequence != v->netchan.outgoing_sequence)
|
//if (v->netchan.incoming_sequence != v->netchan.outgoing_sequence)
|
||||||
//printf("%s: in %i, out %i\n", v->name, v->netchan.incoming_sequence, v->netchan.outgoing_sequence);
|
printf("%s: in %i, out %i\n", v->name, v->netchan.incoming_sequence, v->netchan.outgoing_sequence);
|
||||||
|
if (v->server && v->server->controller == v)
|
||||||
|
{
|
||||||
|
int saved;
|
||||||
|
saved = v->netchan.incoming_sequence;
|
||||||
|
v->netchan.incoming_sequence = v->server->netchan.incoming_sequence;
|
||||||
|
Netchan_Transmit(cluster, &v->netchan, m.cursize, m.data);
|
||||||
|
v->netchan.incoming_sequence = saved;
|
||||||
|
}
|
||||||
|
else
|
||||||
Netchan_Transmit(cluster, &v->netchan, m.cursize, m.data);
|
Netchan_Transmit(cluster, &v->netchan, m.cursize, m.data);
|
||||||
|
|
||||||
if (!v->netchan.message.cursize && v->backbuffered)
|
if (!v->netchan.message.cursize && v->backbuffered)
|
||||||
|
@ -4600,20 +4645,19 @@ void QW_UpdateUDPStuff(cluster_t *cluster)
|
||||||
if (Netchan_Process(&v->netchan, &m))
|
if (Netchan_Process(&v->netchan, &m))
|
||||||
{
|
{
|
||||||
useserver = v->server;
|
useserver = v->server;
|
||||||
if (useserver && useserver->parsingconnectiondata)
|
if (useserver && useserver->parsingconnectiondata && useserver->controller != v)
|
||||||
useserver = NULL;
|
useserver = NULL;
|
||||||
|
|
||||||
v->timeout = cluster->curtime + 15*1000;
|
v->timeout = cluster->curtime + 15*1000;
|
||||||
|
|
||||||
v->netchan.outgoing_sequence = v->netchan.incoming_sequence; //compensate for client->server packetloss.
|
|
||||||
if (v->server && v->server->controller == v)
|
if (v->server && v->server->controller == v)
|
||||||
{
|
{
|
||||||
// v->maysend = true;
|
// v->maysend = true;
|
||||||
v->server->maysend = true;
|
v->server->maysend = true;
|
||||||
v->server->netchan.outgoing_sequence = v->netchan.incoming_sequence + v->server->controllersquencebias;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
v->netchan.outgoing_sequence = v->netchan.incoming_sequence; //compensate for client->server packetloss.
|
||||||
if (!v->server)
|
if (!v->server)
|
||||||
v->maysend = true;
|
v->maysend = true;
|
||||||
else if (!v->chokeme || !cluster->chokeonnotupdated)
|
else if (!v->chokeme || !cluster->chokeonnotupdated)
|
||||||
|
|
|
@ -667,6 +667,7 @@ int SV_SayToUpstream(sv_t *qtv, char *message)
|
||||||
{
|
{
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
netmsg_t nm;
|
netmsg_t nm;
|
||||||
|
|
||||||
if (!qtv->upstreamacceptschat)
|
if (!qtv->upstreamacceptschat)
|
||||||
{
|
{
|
||||||
Sys_Printf(qtv->cluster, "not forwarding say\n");
|
Sys_Printf(qtv->cluster, "not forwarding say\n");
|
||||||
|
@ -1035,6 +1036,7 @@ void QTV_Shutdown(sv_t *qtv)
|
||||||
viewer_t *v;
|
viewer_t *v;
|
||||||
sv_t *peer;
|
sv_t *peer;
|
||||||
cluster_t *cluster;
|
cluster_t *cluster;
|
||||||
|
int i;
|
||||||
Sys_Printf(qtv->cluster, "Closing source %s\n", qtv->server);
|
Sys_Printf(qtv->cluster, "Closing source %s\n", qtv->server);
|
||||||
|
|
||||||
if (qtv->sourcesock != INVALID_SOCKET)
|
if (qtv->sourcesock != INVALID_SOCKET)
|
||||||
|
@ -1087,6 +1089,14 @@ void QTV_Shutdown(sv_t *qtv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ENTITY_FRAMES; i++)
|
||||||
|
{
|
||||||
|
if (qtv->frame[i].ents)
|
||||||
|
free(qtv->frame[i].ents);
|
||||||
|
if (qtv->frame[i].entnums)
|
||||||
|
free(qtv->frame[i].entnums);
|
||||||
|
}
|
||||||
|
|
||||||
for (prox = qtv->proxies; prox; )
|
for (prox = qtv->proxies; prox; )
|
||||||
{
|
{
|
||||||
if (prox->file)
|
if (prox->file)
|
||||||
|
@ -1325,8 +1335,6 @@ void QTV_ParseQWStream(sv_t *qtv)
|
||||||
qtv->controller->maysend = true;
|
qtv->controller->maysend = true;
|
||||||
//if (qtv->controller->netchan.outgoing_sequence != qtv->controller->netchan.incoming_sequence)
|
//if (qtv->controller->netchan.outgoing_sequence != qtv->controller->netchan.incoming_sequence)
|
||||||
//printf("bug is here\n");
|
//printf("bug is here\n");
|
||||||
qtv->controller->netchan.outgoing_sequence = qtv->controller->netchan.incoming_sequence;
|
|
||||||
// qtv->controller->netchan.incoming_sequence = qtv->netchan.incoming_acknowledged;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1502,8 +1510,7 @@ void QTV_Run(sv_t *qtv)
|
||||||
|
|
||||||
if (qtv->controller && !qtv->controller->netchan.isnqprotocol)
|
if (qtv->controller && !qtv->controller->netchan.isnqprotocol)
|
||||||
{
|
{
|
||||||
// qtv->netchan.outgoing_sequence = qtv->controller->netchan.incoming_sequence;
|
qtv->netchan.outgoing_sequence = qtv->controller->netchan.incoming_sequence;
|
||||||
// qtv->netchan.incoming_sequence = qtv->controller->netchan.incoming_acknowledged;
|
|
||||||
if (qtv->maysend)
|
if (qtv->maysend)
|
||||||
{
|
{
|
||||||
qtv->maysend = false;
|
qtv->maysend = false;
|
||||||
|
|
Loading…
Reference in a new issue