Пример #1
0
void CL_ParseSetGame( msg_t *msg )
{
	char newGameDir[MAX_QPATH];
	int i = 0;
	char next;

	while (i < MAX_QPATH)
	{
		next = MSG_ReadByte( msg );

		if (next)
		{ //if next is 0 then we have finished reading to the end of the message
			newGameDir[i] = next;
		}
		else
		{
			break;
		}
		i++;
	}
	newGameDir[i] = 0;

	if(FS_CheckDirTraversal(newGameDir))
	{
		Com_Printf(S_COLOR_YELLOW "WARNING: Server sent invalid fs_game value %s\n", newGameDir);
		return;
	}

	Cvar_Set("fs_game", newGameDir);

	//Update the search path for the mod dir
	FS_UpdateGamedir();
}
Пример #2
0
void CL_ParseSetGame( msg_t *msg )
{
	char newGameDir[MAX_QPATH];
	int i = 0;
	char next;

	while (i < MAX_QPATH)
	{
		next = MSG_ReadByte( msg );

		if (next)
		{ //if next is 0 then we have finished reading to the end of the message
			newGameDir[i] = next;
		}
		else
		{
			break;
		}
		i++;
	}
	newGameDir[i] = 0;

	if(FS_CheckDirTraversal(newGameDir))
	{
		Com_Printf(S_COLOR_YELLOW "WARNING: Server sent invalid fs_game value %s\n", newGameDir);
		return;
	}

	if(!FS_FilenameCompare(newGameDir, BASEGAME))
		Cvar_Set("fs_game", "");
	else
		Cvar_Set("fs_game", newGameDir);

	if(!(Cvar_Flags("fs_game") & CVAR_MODIFIED))
		return;

	//Update the search path for the mod dir
	FS_UpdateGamedir();

	//Now update the overrides manually
	MSG_CheckNETFPSFOverrides(qfalse);
	MSG_CheckNETFPSFOverrides(qtrue);
}