Compile without warnings in cygwin's gcc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2403 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-10-07 22:37:40 +00:00
parent 300f84b8c1
commit 7e9852451c
3 changed files with 96 additions and 94 deletions

View file

@ -819,7 +819,7 @@ qboolean SV_ReadPendingProxy(cluster_t *cluster, oproxy_t *pend)
pend->flushing = true; pend->flushing = true;
return false; return false;
} }
len = s - pend->inbuffer + len; len = s - (char*)pend->inbuffer + len;
if (len > pend->inbuffersize) if (len > pend->inbuffersize)
return false; //still need the body return false; //still need the body
@ -913,107 +913,109 @@ qboolean SV_ReadPendingProxy(cluster_t *cluster, oproxy_t *pend)
*e = '\0'; *e = '\0';
colon = strchr(s, ':'); colon = strchr(s, ':');
if (*s) if (*s)
if (!colon)
{ {
if (!strcmp(s, "QTV")) if (!colon)
{ {
//just a qtv request if (!strcmp(s, "QTV"))
}
else if (!strcmp(s, "SOURCELIST"))
{ //lists sources that are currently playing
s = "QTVSV 1\n";
Net_ProxySend(cluster, pend, s, strlen(s));
if (!cluster->servers)
{ {
s = "PERROR: No sources currently available\n"; //just a qtv request
Net_ProxySend(cluster, pend, s, strlen(s));
} }
else else if (!strcmp(s, "SOURCELIST"))
{ { //lists sources that are currently playing
for (qtv = cluster->servers; qtv; qtv = qtv->next) s = "QTVSV 1\n";
Net_ProxySend(cluster, pend, s, strlen(s));
if (!cluster->servers)
{ {
sprintf(tempbuf, "ASOURCE: %i: %15s: %15s\n", qtv->streamid, qtv->server, qtv->hostname); s = "PERROR: No sources currently available\n";
s = tempbuf; Net_ProxySend(cluster, pend, s, strlen(s));
Net_ProxySend(cluster, pend, s, strlen(s));
} }
qtv = NULL; else
{
for (qtv = cluster->servers; qtv; qtv = qtv->next)
{
sprintf(tempbuf, "ASOURCE: %i: %15s: %15s\n", qtv->streamid, qtv->server, qtv->hostname);
s = tempbuf;
Net_ProxySend(cluster, pend, s, strlen(s));
}
qtv = NULL;
}
s = "\n";
Net_ProxySend(cluster, pend, s, strlen(s));
pend->flushing = true;
} }
s = "\n"; else if (!strcmp(s, "DEMOLIST"))
Net_ProxySend(cluster, pend, s, strlen(s)); { //lists the demos available on this proxy
pend->flushing = true; s = "QTVSV 1\n";
} Net_ProxySend(cluster, pend, s, strlen(s));
else if (!strcmp(s, "DEMOLIST")) s = "PERROR: DEMOLIST command not yet implemented\n";
{ //lists the demos available on this proxy Net_ProxySend(cluster, pend, s, strlen(s));
s = "QTVSV 1\n"; s = "\n";
Net_ProxySend(cluster, pend, s, strlen(s)); Net_ProxySend(cluster, pend, s, strlen(s));
s = "PERROR: DEMOLIST command not yet implemented\n"; pend->flushing = true;
Net_ProxySend(cluster, pend, s, strlen(s));
s = "\n";
Net_ProxySend(cluster, pend, s, strlen(s));
pend->flushing = true;
}
else
printf("Unrecognised token in QTV connection request (%s)\n", s);
}
else
{
*colon++ = '\0';
if (!strcmp(s, "VERSION"))
{
switch(atoi(colon))
{
case 1:
//got a usable version
usableversion = 1;
break;
default:
//not recognised.
break;
} }
}
else if (!strcmp(s, "RAW"))
raw = atoi(colon);
/*else if (!strcmp(s, "ROUTE"))
{ //pure rewroute...
//is this safe? probably not.
s = "QTVSV 1\n"
"PERROR: ROUTE command not yet implemented\n"
"\n";
Net_ProxySend(cluster, pend, s, strlen(s));
pend->flushing = true;
}
*/
else if (!strcmp(s, "SOURCE"))
{ //connects, creating a new source
while (*colon == ' ')
colon++;
for (s = colon; *s; s++)
if (*s < '0' || *s > '9')
break;
if (*s)
qtv = QTV_NewServerConnection(cluster, colon, "", false, true, true);
else else
{ printf("Unrecognised token in QTV connection request (%s)\n", s);
//numerical source, use a stream id.
for (qtv = cluster->servers; qtv; qtv = qtv->next)
if (qtv->streamid == atoi(colon))
break;
}
// s = "QTVSV 1\n"
// "PERROR: SOURCE command not yet implemented\n"
// "\n";
// Net_ProxySend(cluster, pend, s, strlen(s));
}
else if (!strcmp(s, "DEMO"))
{ //starts a demo off the server... source does the same thing though...
s = "QTVSV 1\n"
"PERROR: DEMO command not yet implemented\n"
"\n";
Net_ProxySend(cluster, pend, s, strlen(s));
pend->flushing = true;
} }
else else
printf("Unrecognised token in QTV connection request (%s)\n", s); {
*colon++ = '\0';
if (!strcmp(s, "VERSION"))
{
switch(atoi(colon))
{
case 1:
//got a usable version
usableversion = 1;
break;
default:
//not recognised.
break;
}
}
else if (!strcmp(s, "RAW"))
raw = atoi(colon);
/*else if (!strcmp(s, "ROUTE"))
{ //pure rewroute...
//is this safe? probably not.
s = "QTVSV 1\n"
"PERROR: ROUTE command not yet implemented\n"
"\n";
Net_ProxySend(cluster, pend, s, strlen(s));
pend->flushing = true;
}
*/
else if (!strcmp(s, "SOURCE"))
{ //connects, creating a new source
while (*colon == ' ')
colon++;
for (s = colon; *s; s++)
if (*s < '0' || *s > '9')
break;
if (*s)
qtv = QTV_NewServerConnection(cluster, colon, "", false, true, true);
else
{
//numerical source, use a stream id.
for (qtv = cluster->servers; qtv; qtv = qtv->next)
if (qtv->streamid == atoi(colon))
break;
}
// s = "QTVSV 1\n"
// "PERROR: SOURCE command not yet implemented\n"
// "\n";
// Net_ProxySend(cluster, pend, s, strlen(s));
}
else if (!strcmp(s, "DEMO"))
{ //starts a demo off the server... source does the same thing though...
s = "QTVSV 1\n"
"PERROR: DEMO command not yet implemented\n"
"\n";
Net_ProxySend(cluster, pend, s, strlen(s));
pend->flushing = true;
}
else
printf("Unrecognised token in QTV connection request (%s)\n", s);
}
} }
s = e+1; s = e+1;
} }

View file

@ -845,6 +845,7 @@ void WriteDeltaUsercmd (netmsg_t *m, const usercmd_t *from, usercmd_t *move);
void SendClientCommand(sv_t *qtv, char *fmt, ...); void SendClientCommand(sv_t *qtv, char *fmt, ...);
void QTV_Run(sv_t *qtv); void QTV_Run(sv_t *qtv);
void QW_FreeViewer(cluster_t *cluster, viewer_t *viewer); void QW_FreeViewer(cluster_t *cluster, viewer_t *viewer);
void QW_SetMenu(viewer_t *v, int menunum);
char *Rcon_Command(cluster_t *cluster, sv_t *qtv, char *command, char *buffer, int sizeofbuffer, qboolean localcommand); char *Rcon_Command(cluster_t *cluster, sv_t *qtv, char *command, char *buffer, int sizeofbuffer, qboolean localcommand);
char *COM_ParseToken (char *data, char *out, int outsize, const char *punctuation); char *COM_ParseToken (char *data, char *out, int outsize, const char *punctuation);

View file

@ -26,7 +26,6 @@ static const filename_t ConnectionlessSoundList[] = {{""}, {""}};
void Menu_Enter(cluster_t *cluster, viewer_t *viewer, int buttonnum); void Menu_Enter(cluster_t *cluster, viewer_t *viewer, int buttonnum);
void QW_SetMenu(viewer_t *v, int menunum);
#if defined(_WIN32) && !defined(__MINGW32_VERSION) #if defined(_WIN32) && !defined(__MINGW32_VERSION)
int snprintf(char *buffer, int buffersize, char *format, ...) int snprintf(char *buffer, int buffersize, char *format, ...)
@ -207,7 +206,7 @@ void BuildServerData(sv_t *tv, netmsg_t *msg, qboolean mvd, int servercount, qbo
if (mvd) if (mvd)
WriteFloat(msg, 0); WriteFloat(msg, 0);
else else
WriteByte(msg, MAX_CLIENTS-1 | (spectatorflag?128:0)); WriteByte(msg, (MAX_CLIENTS-1) | (spectatorflag?128:0));
WriteString(msg, "FTEQTV Proxy"); WriteString(msg, "FTEQTV Proxy");
@ -1565,7 +1564,7 @@ void SendNQPlayerStates(cluster_t *cluster, sv_t *tv, viewer_t *v, netmsg_t *msg
// send an update // send an update
bits = 0; bits = 0;
if (tv->entity[i].updatetime == tv->oldpackettime) if (ent->updatetime == tv->oldpackettime)
{ {
for (i=0 ; i<3 ; i++) for (i=0 ; i<3 ; i++)
{ {