ignore challanges from differing protocols (happens with a client connecting to an sv_listen 2 server)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2367 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-07-29 21:38:05 +00:00
parent 0d6e663d60
commit fc3af4e938

View file

@ -1919,9 +1919,17 @@ void CL_ConnectionlessPacket (void)
if (!strcmp(com_token, "hallengeResponse")) if (!strcmp(com_token, "hallengeResponse"))
{ {
#ifdef Q3CLIENT #ifdef Q3CLIENT
if (cls.protocol == CP_QUAKE3 || cls.protocol == CP_UNKNOWN)
{
cls.protocol = CP_QUAKE3; cls.protocol = CP_QUAKE3;
cls.challenge = atoi(s+17); cls.challenge = atoi(s+17);
CL_SendConnectPacket (0, 0/*, ...*/); CL_SendConnectPacket (0, 0/*, ...*/);
}
else
{
Con_Printf("\nChallange from another protocol, ignoring Q3 challange\n");
return;
}
return; return;
#else #else
Con_Printf("\nUnable to connect to Quake3\n"); Con_Printf("\nUnable to connect to Quake3\n");
@ -1939,8 +1947,13 @@ void CL_ConnectionlessPacket (void)
if (*s2) if (*s2)
{//and if it's not, we're unlikly to be compatable with whatever it is that's talking at us. {//and if it's not, we're unlikly to be compatable with whatever it is that's talking at us.
#ifdef NQPROT #ifdef NQPROT
if (cls.protocol == CP_NETQUAKE || cls.protocol == CP_UNKNOWN)
{
cls.protocol = CP_NETQUAKE; cls.protocol = CP_NETQUAKE;
CL_ConnectToDarkPlaces(s+9, net_from); CL_ConnectToDarkPlaces(s+9, net_from);
}
else
Con_Printf("\nChallange from another protocol, ignoring DP challange\n");
#else #else
Con_Printf("\nUnable connect to DarkPlaces\n"); Con_Printf("\nUnable connect to DarkPlaces\n");
#endif #endif
@ -1948,7 +1961,13 @@ void CL_ConnectionlessPacket (void)
} }
#ifdef Q2CLIENT #ifdef Q2CLIENT
if (cls.protocol == CP_QUAKE2 || cls.protocol == CP_UNKNOWN)
cls.protocol = CP_QUAKE2; cls.protocol = CP_QUAKE2;
else
{
Con_Printf("\nChallange from another protocol, ignoring Q2 challange\n");
return;
}
#else #else
Con_Printf("\nUnable to connect to Quake2\n"); Con_Printf("\nUnable to connect to Quake2\n");
#endif #endif
@ -1966,8 +1985,13 @@ void CL_ConnectionlessPacket (void)
goto client_connect; goto client_connect;
} }
#endif #endif
else else if (cls.protocol == CP_QUAKEWORLD || cls.protocol == CP_UNKNOWN)
cls.protocol = CP_QUAKEWORLD; cls.protocol = CP_QUAKEWORLD;
else
{
Con_Printf("\nChallange from another protocol, ignoring QW challange\n");
return;
}
cls.challenge = atoi(s); cls.challenge = atoi(s);
for(;;) for(;;)