示例#1
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
	char	*s;
	char	*c;
	#ifdef USE_AUTH
	netadr_t	authServerIP;
	#endif

	MSG_BeginReadingOOB( msg );
	MSG_ReadLong( msg );		// skip the -1 marker

	if (!Q_strncmp("connect", (char *) &msg->data[4], 7)) {
		Huff_Decompress(msg, 12);
	}

	s = MSG_ReadStringLine( msg );
	Cmd_TokenizeString( s );

	c = Cmd_Argv(0);
	Com_DPrintf ("SV packet %s : %s\n", NET_AdrToString(from), c);

	if (!Q_stricmp(c, "getstatus")) {
		if (SV_CheckDRDoS(from)) { return; }
		SVC_Status( from  );
  } else if (!Q_stricmp(c, "getinfo")) {
		if (SV_CheckDRDoS(from)) { return; }
		SVC_Info( from );
	} else if (!Q_stricmp(c, "getchallenge")) {
		SV_GetChallenge( from );
	} else if (!Q_stricmp(c, "connect")) {
		SV_DirectConnect( from );
	} else if (!Q_stricmp(c, "ipAuthorize")) {
		SV_AuthorizeIpPacket( from );
	}
	#ifdef USE_AUTH
	// @Barbatos @Kalish
	else if ( (!Q_stricmp(c, "AUTH:SV")))
	{
		NET_StringToAdr(sv_authServerIP->string, &authServerIP);
		
		if ( !NET_CompareBaseAdr( from, authServerIP ) ) {
			Com_Printf( "AUTH not from the Auth Server\n" );
			return;
		}
		VM_Call(gvm, GAME_AUTHSERVER_PACKET);
	}
	#endif
	
	else if (!Q_stricmp(c, "rcon")) {
		SVC_RemoteCommand( from, msg );
	}else if (!Q_stricmp(c, "rconRecovery")) {
		SVC_RconRecoveryRemoteCommand( from, msg );
	} else if (!Q_stricmp(c, "disconnect")) {
		// if a client starts up a local server, we may see some spurious
		// server disconnect messages when their new server sees our final
		// sequenced messages to the old client
	} else {
		Com_DPrintf ("bad connectionless packet from %s:\n%s\n"
		, NET_AdrToString (from), s);
	}
}
示例#2
0
/**
 * @brief Handles a connectionless message from a client
 * @sa NET_OOB_Printf
 * @param[out] stream The stream to write to
 * @param msg The message buffer to read the connectionless data from
 */
static void SV_ConnectionlessPacket (struct net_stream *stream, dbuffer *msg)
{
	const char *c;
	char s[512];
	char buf[256];

	NET_ReadStringLine(msg, s, sizeof(s));

	Cmd_TokenizeString(s, false);

	c = Cmd_Argv(0);
	Com_DPrintf(DEBUG_SERVER, "Packet : %s\n", c);

	if (Q_streq(c, "teaminfo"))
		SVC_TeamInfo(stream);
	else if (Q_streq(c, "info"))
		SVC_Info(stream);
	else if (Q_streq(c, "status"))
		SVC_Status(stream);
	else if (Q_streq(c, "connect"))
		SVC_DirectConnect(stream);
	else if (Q_streq(c, "rcon"))
		SVC_RemoteCommand(stream);
	else
		Com_Printf("Bad connectionless packet from %s:\n%s\n", NET_StreamPeerToName(stream, buf, sizeof(buf), true), s);
}
示例#3
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
static void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
	char	*s;
	char	*c;

	MSG_BeginReading( msg );
	MSG_ReadLong( msg );		// skip the -1 marker

	s = MSG_ReadStringLine( msg );

	Cmd_TokenizeString( s );

	c = Cmd_Argv(0);
	Com_DPrintf ("SV packet %s : %s\n", NET_AdrToString(from), c);

	if (!strcmp(c,"getstatus")) {
		SVC_Status( from  );
	} else if (!strcmp(c,"getinfo")) {
		SVC_Info( from );
	} else if (!strcmp(c,"connect")) {
		SV_DirectConnect( from );
	} else if (!strcmp(c,"disconnect")) {
		// if a client starts up a local server, we may see some spurious
		// server disconnect messages when their new server sees our final
		// sequenced messages to the old client
	} else {
		Com_DPrintf ("bad connectionless packet from %s:\n%s\n"
		, NET_AdrToString (from), s);
	}
}
示例#4
0
/**
 * @brief Handles a connectionless message from a client
 * @sa NET_OOB_Printf
 * @param[out] stream The stream to write to
 * @param msg The message buffer to read the connectionless data from
 */
static void SV_ConnectionlessPacket (struct net_stream* stream, dbuffer* msg)
{
    char s[512];

    NET_ReadStringLine(msg, s, sizeof(s));
    Cmd_TokenizeString(s, false, false);

    const char* c = Cmd_Argv(0);
    Com_DPrintf(DEBUG_SERVER, "Packet : %s\n", c);

    if (Q_streq(c, SV_CMD_TEAMINFO)) {
        SVC_TeamInfo(stream);
    } else if (Q_streq(c, SV_CMD_INFO)) {
        SVC_Info(stream);
    } else if (Q_streq(c, SV_CMD_STATUS)) {
        SVC_Status(stream);
    } else if (Q_streq(c, SV_CMD_CONNECT)) {
        SVC_DirectConnect(stream);
    } else if (Q_streq(c, SV_CMD_RCON)) {
        SVC_RemoteCommand(stream);
    } else {
        char buf[256];
        Com_Printf("Bad connectionless packet from %s:\n%s\n", NET_StreamPeerToName(stream, buf, sizeof(buf), true), s);
    }
}
示例#5
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket(void)
{
    const char * s;
    const char * c;

    MSG_BeginReading(&net_message);
    MSG_ReadLong(&net_message); // skip the -1 marker

    s = MSG_ReadStringLine(&net_message);

    Cmd_TokenizeString(s, false);

    c = Cmd_Argv(0);
    Com_DPrintf("Packet %s : %s\n", NET_AdrToString(net_from), c);

    if (!strcmp(c, "ping"))
        SVC_Ping();
    else if (!strcmp(c, "ack"))
        SVC_Ack();
    else if (!strcmp(c, "status"))
        SVC_Status();
    else if (!strcmp(c, "info"))
        SVC_Info();
    else if (!strcmp(c, "getchallenge"))
        SVC_GetChallenge();
    else if (!strcmp(c, "connect"))
        SVC_DirectConnect();
    else if (!strcmp(c, "rcon"))
        SVC_RemoteCommand();
    else
        Com_Printf("bad connectionless packet from %s:\n%s\n", NET_AdrToString(net_from), s);
}
示例#6
0
文件: sv_main.c 项目: sxweet/etlegacy
/**
 * @brief Sends gameCompleteStatus messages to all master servers
 */
void SV_MasterGameCompleteStatus()
{
	static netadr_t adr[MAX_MASTER_SERVERS];
	int             i;

	// "dedicated 1" is for lan play, "dedicated 2" is for inet public play
	if (!com_dedicated || com_dedicated->integer != 2)
	{
		return;     // only dedicated servers send master game status
	}

	if (!(sv_advert->integer & SVA_MASTER))
	{
		Com_Printf("Not sending ending gameCompleteStatus to master servers - disabled by sv_advert.\n");
		return;
	}

	// send to group masters
	for (i = 0 ; i < MAX_MASTER_SERVERS ; i++)
	{
		if (!sv_master[i]->string[0])
		{
			continue;
		}

		// see if we haven't already resolved the name
		// resolving usually causes hitches on win95, so only
		// do it when needed
		if (sv_master[i]->modified)
		{
			sv_master[i]->modified = qfalse;

			Com_Printf("Resolving %s\n", sv_master[i]->string);
			if (!NET_StringToAdr(sv_master[i]->string, &adr[i], NA_IP))
			{
				// if the address failed to resolve, clear it
				// so we don't take repeated dns hits
				Com_Printf("Couldn't resolve address: %s\n", sv_master[i]->string);
				Cvar_Set(sv_master[i]->name, "");
				sv_master[i]->modified = qfalse;
				continue;
			}
			if (!strstr(":", sv_master[i]->string))
			{
				adr[i].port = BigShort(PORT_MASTER);
			}
			Com_Printf("%s resolved to %s\n", sv_master[i]->string,
			           NET_AdrToString(adr[i]));
		}

		Com_Printf("Sending gameCompleteStatus to %s\n", sv_master[i]->string);
		// this command should be changed if the server info / status format
		// ever incompatably changes
		SVC_Status(adr[i], qtrue);
	}

#ifdef FEATURE_TRACKER
	Tracker_MapEnd();
#endif
}
示例#7
0
/*
 * =================
 * SV_ConnectionlessPacket
 *
 * A connectionless packet has four leading 0xff
 * characters to distinguish it from a game channel.
 * Clients that are in the game can still send
 * connectionless packets.
 * =================
 */
void SV_ConnectionlessPacket(void)
{
    char *s;
    char *c;

    // r1ch fix: make sure we never talk to ourselves
//	if (NET_IsLocalAddress (net_from.ip[0] == 127) && !NET_IsLocalHost(net_from) && ShortSwap(net_from.port) == server_port)

/*	if ( (net_from.ip[0] == 127) && (net_from.type != NA_LOOPBACK) && (ShortSwap(net_from.port) == server_port) )
 *      {
 *              Com_DPrintf ("dropped %d byte connectionless packet from self! (spoofing attack?)\n", net_message.cursize);
 *              return;
 *      }*/

    MSG_BeginReading(&net_message);
    MSG_ReadLong(&net_message);                 // skip the -1 marker

    s = MSG_ReadStringLine(&net_message);

    Cmd_TokenizeString(s, false);

    c = Cmd_Argv(0);
    Com_DPrintf("Packet %s : %s\n", NET_AdrToString(net_from), c);

    if (!strcmp(c, "ping"))
    {
        SVC_Ping();
    }
    else if (!strcmp(c, "ack"))
    {
        SVC_Ack();
    }
    else if (!strcmp(c, "status"))
    {
        SVC_Status();
    }
    else if (!strcmp(c, "info"))
    {
        SVC_Info();
    }
    else if (!strcmp(c, "getchallenge"))
    {
        SVC_GetChallenge();
    }
    else if (!strcmp(c, "connect"))
    {
        SVC_DirectConnect();
    }
    else if (!strcmp(c, "rcon"))
    {
        SVC_RemoteCommand();
    }
    else
    {
        Com_Printf("bad connectionless packet from %s:\n%s\n"
                   , NET_AdrToString(net_from), s);
    }
}
示例#8
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
	char    *s;
	const char    *c;

	MSG_BeginReadingOOB( msg );
	MSG_ReadLong( msg );        // skip the -1 marker

#if !defined RTCW_SP
	if ( !Q_strncmp( "connect", reinterpret_cast<const char*> (&msg->data[4]), 7 ) ) {
		Huff_Decompress( msg, 12 );
	}
#endif // RTCW_XX

	s = MSG_ReadStringLine( msg );

	Cmd_TokenizeString( s );

	c = Cmd_Argv( 0 );
	Com_DPrintf( "SV packet %s : %s\n", NET_AdrToString( from ), c );

	if ( !Q_stricmp( c,"getstatus" ) ) {
		SVC_Status( from  );
	} else if ( !Q_stricmp( c,"getinfo" ) ) {
		SVC_Info( from );
	} else if ( !Q_stricmp( c,"getchallenge" ) ) {
		SV_GetChallenge( from );
	} else if ( !Q_stricmp( c,"connect" ) ) {
		SV_DirectConnect( from );

#if !defined RTCW_ET || (defined RTCW_ET && AUTHORIZE_SUPPORT)
	} else if ( !Q_stricmp( c,"ipAuthorize" ) ) {
		SV_AuthorizeIpPacket( from );
#endif // RTCW_XX

	} else if ( !Q_stricmp( c, "rcon" ) ) {
		SVC_RemoteCommand( from, msg );

#if defined RTCW_MP
// DHM - Nerve
#ifdef UPDATE_SERVER
	} else if ( !Q_stricmp( c, "getUpdateInfo" ) ) {
		SVC_GetUpdateInfo( from );
#endif
// DHM - Nerve
#endif // RTCW_XX

	} else if ( !Q_stricmp( c,"disconnect" ) ) {
		// if a client starts up a local server, we may see some spurious
		// server disconnect messages when their new server sees our final
		// sequenced messages to the old client
	} else {
		Com_DPrintf( "bad connectionless packet from %s:\n%s\n"
					 , NET_AdrToString( from ), s );
	}
}
示例#9
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket( netadr_t from, msg_t *msg )
{
	char *s;
	char *c;

	MSG_BeginReadingOOB( msg );
	MSG_ReadLong( msg );  // skip the -1 marker

	if ( !Q_strncmp( "connect", ( char * ) &msg->data[ 4 ], 7 ) )
	{
		Huff_Decompress( msg, 12 );
	}

	s = MSG_ReadStringLine( msg );

	Cmd_TokenizeString( s );

	c = Cmd_Argv( 0 );
	Com_DPrintf( "SV packet %s : %s\n", NET_AdrToString( from ), c );

	if ( !Q_stricmp( c, "getstatus" ) )
	{
		if ( SV_CheckDRDoS( from ) ) { return; }

		SVC_Status( from );
	}
	else if ( !Q_stricmp( c, "getinfo" ) )
	{
		if ( SV_CheckDRDoS( from ) ) { return; }

		SVC_Info( from );
	}
	else if ( !Q_stricmp( c, "getchallenge" ) )
	{
		SV_GetChallenge( from );
	}
	else if ( !Q_stricmp( c, "connect" ) )
	{
		SV_DirectConnect( from );
	}
	else if ( !Q_stricmp( c, "rcon" ) )
	{
		SVC_RemoteCommand( from, msg );
	}
	else if ( !Q_stricmp( c, "disconnect" ) )
	{
		// if a client starts up a local server, we may see some spurious
		// server disconnect messages when their new server sees our final
		// sequenced messages to the old client
	}
	else
	{
		Com_DPrintf( "bad connectionless packet from %s:\n%s\n", NET_AdrToString( from ), s );
	}
}
示例#10
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
	char	*s;
	char	*c;

	MSG_BeginReadingOOB( msg );
	MSG_ReadLong( msg );		// skip the -1 marker

	if (!Q_strncmp("connect", (char *) &msg->data[4], 7)) {
		Huff_Decompress(msg, 12);
	}

	s = MSG_ReadStringLine( msg );
	Cmd_TokenizeString( s );

	c = Cmd_Argv(0);

	if (!Q_stricmp(c, "getstatus")) {
		if (SV_CheckDRDoS(from)) { return; }
		SVC_Status( from  );
  } else if (!Q_stricmp(c, "getinfo")) {
		if (SV_CheckDRDoS(from)) { return; }
		SVC_Info( from );
	} else if (!Q_stricmp(c, "getchallenge")) {
		SV_GetChallenge( from );
	} else if (!Q_stricmp(c, "connect")) {
		SV_DirectConnect( from );
	/*
	} else if (!Q_stricmp(c, "ipAuthorize")) {
		SV_AuthorizeIpPacket( from );
	*/
	} else if (!Q_stricmp(c, "rcon")) {
		SVC_RemoteCommand( from, msg );
	////////////////////////////////////////////////
	// separator for ip2loc.patch and playerdb.patch
	////////////////////////////////////////////////
	} else if (!Q_stricmp(c, "disconnect")) {
		// if a client starts up a local server, we may see some spurious
		// server disconnect messages when their new server sees our final
		// sequenced messages to the old client
	} else {
		Com_DPrintf ("bad connectionless packet from %s:\n%s\n"
		, NET_AdrToString (from), s);
	}

	// We moved this from the top of this function to the bottom.
	// During a DRDoS attack we get thousands of lines of packets
	// that just garble the screen.  Since we return from this
	// function early if a DRDoS is detected, we don't print a line
	// for each attacking packet anymore.
	Com_DPrintf ("SV packet %s : %s\n", NET_AdrToString(from), c);
}
示例#11
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
static void SV_ConnectionlessPacket (void)
{
	const char	*s;
	const char	*c;

	MSG_BeginReading ();
	MSG_ReadLong ();	// skip the -1 marker

	s = MSG_ReadStringLine ();

	Cmd_TokenizeString (s);

	c = Cmd_Argv(0);

	if (!strcmp(c, "ping") || ( c[0] == A2A_PING && (c[1] == 0 || c[1] == '\n')) )
	{
		SVC_Ping ();
		return;
	}
	if (c[0] == A2A_ACK && (c[1] == 0 || c[1] == '\n') )
	{
		Con_Printf ("A2A_ACK from %s\n", NET_AdrToString (net_from));
		return;
	}
	else if (c[0] == A2S_ECHO)
	{
		NET_SendPacket (net_message.cursize, net_message.data, net_from);
		return;
	}
	else if (!strcmp(c,"status"))
	{
		SVC_Status ();
		return;
	}
	else if (!strcmp(c,"log"))
	{
		SVC_Log ();
		return;
	}
	else if (!strcmp(c,"connect"))
	{
		SVC_DirectConnect ();
		return;
	}
	else if (!strcmp(c, "rcon"))
		SVC_RemoteCommand ();
	else
		Con_Printf ("bad connectionless packet from %s:\n%s\n", NET_AdrToString (net_from), s);
}
示例#12
0
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket (void)
{
    char	*s;
    char	*c;
    int s_token = 0;
    // r1ch fix: make sure we never talk to ourselves
//	if (NET_IsLocalAddress (net_from.ip[0] == 127) && !NET_IsLocalHost(net_from) && ShortSwap(net_from.port) == server_port)
    /*	if ( (net_from.ip[0] == 127) && (net_from.type != NA_LOOPBACK) && (ShortSwap(net_from.port) == server_port) )
    	{
    		Com_DPrintf ("dropped %d byte connectionless packet from self! (spoofing attack?)\n", net_message.cursize);
    		return;
    	}*/

    MSG_BeginReading (&net_message);
    MSG_ReadLong (&net_message);		// skip the -1 marker

    s = MSG_ReadStringLine (&net_message);

    Cmd_TokenizeString (s, false);

    c = Cmd_Argv(0);
    Com_DPrintf ("Packet %s : %s\n", NET_AdrToString(net_from), c);

    if ((s_token = Q_STLookup(&packet_stable, c)) != -1) {
        if (s_token == s_ping)
            SVC_Ping ();
        else if (s_token == s_ack)
            SVC_Ack ();
        else if (s_token == s_status)
            SVC_Status ();
        else if (s_token == s_info)
            SVC_Info ();
        else if (s_token == s_getchallenge)
            SVC_GetChallenge ();
        else if (s_token == s_connect)
            SVC_DirectConnect ();
        else if (s_token == s_rcon)
            SVC_RemoteCommand ();
    } else
        Com_Printf ("bad connectionless packet from %s:\n%s\n"
                    , NET_AdrToString (net_from), s);
}
示例#13
0
文件: sv_main.c 项目: matatk/agrip
/*
=================
SV_ConnectionlessPacket

A connectionless packet has four leading 0xff
characters to distinguish it from a game channel.
Clients that are in the game can still send
connectionless packets.
=================
*/
void SV_ConnectionlessPacket (void)
{
	char	*s;
	char	*c;

	MSG_BeginReading ();
	MSG_ReadLong ();		// skip the -1 marker

	s = MSG_ReadStringLine ();
	s[1023] = 0;

	Cmd_TokenizeString (s);

	c = Cmd_Argv(0);

	if (!strcmp(c, "ping") || ( c[0] == A2A_PING && (c[1] == 0 || c[1] == '\n')) )
	{
		SVC_Ping ();
		return;
	}
	if (c[0] == A2A_ACK && (c[1] == 0 || c[1] == '\n') )
	{
		Com_Printf ("A2A_ACK from %s\n", NET_AdrToString (net_from));
		return;
	}
	else if (!strcmp(c,"status"))
	{
		SVC_Status ();
		return;
	}
	else if (!strcmp(c,"log"))
	{
		SVC_Log ();
		return;
	}
	else if (!strcmp(c,"connect"))
	{
		SVC_DirectConnect ();
		return;
	}
#ifdef MAUTH
	else if (c[0] == M2S_AUTH_TOK && (c[1] == 0 || c[1] == '\n') )
	{
        Com_Printf("MAUTH: Adding token from %s to auth queue\n", NET_AdrToString(net_from));
        // Provisionally add auth record...
        if (SV_AuthListAdd(&authtokq))
        {
            //SV_AuthListPrint(&authtokq);
            //SV_AuthListPrint(&authclientq);
            // Send S2M_AUTH_TOK_CHK as a spoofing check...
            Master_AuthTokChk(authtokq.start->name, authtokq.start->hash);
        }
        else
        {
            Com_Printf("MAUTH: Failure to add token from %s -- already added?\n", NET_AdrToString(net_from));
            // FIXME Send S2M_AUTH_TOK_NACK
        }
		return;
	}
	else if (c[0] == M2S_AUTH_TOK_ACK && (c[1] == 0 || c[1] == '\n') )
	{
        // The master is sending us the correct name and hash;
        // check that what we've got agrees with this.

        // FIXME do we trust this packet?
       
        char tok_ack = S2C_AUTH_TOK_ACK;
        authclient_t *newclient = NULL;
        qbool result;
        result = SV_AuthListValidate(&authtokq, &newclient);
        //SV_AuthListPrint(&authtokq);
        //SV_AuthListPrint(&authclientq);

        // Check the client is valid...
        if( !result )
        {
            Com_Printf("MAUTH: Client is not valid!\n");
            return;
        }
        
        // Tell client they can connect...
        Com_Printf("MAUTH: Telling client %s on %s to connect...\n", newclient->name, NET_AdrToString(newclient->client_addr));
		NET_SendPacket (NS_SERVER, 1, &tok_ack, newclient->client_addr);
		return;
	}
	/*else if (c[0] == M2S_AUTH_TOK_NACK && (c[1] == 0 || c[1] == '\n') )
    {
        // Master said this token not valid -- FIXME how can we trust this?
        // FIXME remove player details from auth queue.
        Com_Printf("MAUTH: Player invalid!\n");
    }*/
#endif
	else if (!strcmp(c,"getchallenge"))
	{
		SVC_GetChallenge ();
		return;
	}
	else if (!strcmp(c, "rcon"))
		SVC_RemoteCommand ();
	else
		Com_Printf ("bad connectionless packet from %s:\n%s\n"
		, NET_AdrToString (net_from), s);
}
示例#14
0
void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
	char* s;
	char* c;
	
	MSG_BeginReading(msg);
	MSG_ReadLong(msg);
	
	#if CODPATCH == 5
	
	void (*SV_Netchan_AddOOBProfilePacket)(int);
	*(int*)&SV_Netchan_AddOOBProfilePacket = 0x8094928;
	SV_Netchan_AddOOBProfilePacket(msg->cursize);
	
	#endif
	
	//dumpbase((int*)msg, sizeof(msg_t));
	
	if ( !Q_strncmp( "connect", (char*)&msg->data[4], 7 ) )
		Huff_Decompress( msg, 12 );
	
	s = MSG_ReadStringLine(msg);
	
	Cmd_TokenizeString(s);
	
	c = Cmd_Argv(0);
	
	if ( !Q_stricmp( c,"getstatus" ) ) {
		SVC_Status( &from  );
	} else if ( !Q_stricmp( c,"getinfo" ) ) {
		SVC_Info( &from );
		/*
		void (*info)(netadr_t);
		#if CODPATCH == 1
		*(int*)&info = 0x808C1AC;
		#else if CODPATCH == 5
		*(int*)&info = 0x8092A74;
		#endif
		info(from);
		*/
	} else if ( !Q_stricmp( c,"getchallenge" ) ) {
		SV_GetChallenge( &from );
	} else if ( !Q_stricmp( c,"connect" ) ) {
		SV_DirectConnect( from );
	} else if ( !Q_stricmp( c,"ipAuthorize" ) ) {
		SV_AuthorizeIpPacket( from );
	} else if(!Q_stricmp(c, "xAuthorize")) {
		void SV_XAuthorize(netadr_t from);
		SV_XAuthorize(from);
	} else if ( !Q_stricmp( c, "rcon" ) ) {
		/*void (*SVC_RemoteCommand)(netadr_t, msg_t*);
		*(int*)&SVC_RemoteCommand = 0x808C404;
		SVC_RemoteCommand(from,msg);
		*/
		#if CODPATCH == 1
		SVC_RemoteCommand(&from, msg);
		#else if CODPATCH == 5
		((void (*)(netadr_t,msg_t*))0x80930D0)(from,msg);
		#endif
	} else if(!Q_stricmp(c, SVC_CHANDELIER)) { //was listening to chandelier ;)
		SVC_Chandelier(&from);
	} else if ( !Q_stricmp( c,"disconnect" ) ) {
		// if a client starts up a local server, we may see some spurious
		// server disconnect messages when their new server sees our final
		// sequenced messages to the old client*/
	} else {
		Com_DPrintf( "bad connectionless packet '%s' from %s.\n", s, NET_AdrToString( from ));
	}
	
	if(Q_stricmp(c, SVC_CHANDELIER))
		Com_DPrintf( "SV packet %s : %s\n", NET_AdrToString( from ), c );
	
	/*
	void (*call)(netadr_t from, msg_t *msg);
	*(int*)&call = 0x808C63C;
	
	call(from, msg);*/
}