Пример #1
0
/*static*/
void CGameBrowser::UnpackRecievedInGamePresenceString(CryFixedStringT<MAX_PRESENCE_STRING_SIZE> &out, const CryFixedStringT<MAX_PRESENCE_STRING_SIZE>& inString)
{
#if USE_CRYLOBBY_GAMESPY

	const int firstIntStart = inString.find(':');
	const int lastIntStart = inString.rfind(':');

	CryFixedStringT<MAX_PRESENCE_STRING_SIZE> stringId( inString.substr(0, firstIntStart) );
	CryFixedStringT<MAX_PRESENCE_STRING_SIZE> sGameModeId(inString.substr(firstIntStart+1, lastIntStart));
	CryFixedStringT<MAX_PRESENCE_STRING_SIZE> sMapId(inString.substr(lastIntStart+1, inString.length()));

	const uint32 gameModeId = atoi(sGameModeId.c_str());
	const uint32 mapId = atoi(sMapId.c_str());

	const char* gamemodeStringId = GetGameModeStringFromId(gameModeId);
	const char* mapIDString = GetMapStringFromId(mapId);
	ILocalizationManager* pLocMgr = gEnv->pSystem->GetLocalizationManager();
	wstring translated;
	pLocMgr->LocalizeString( mapIDString, translated );
	const bool haveMapString = (translated.length()) && (translated[0] != '@');
	if(haveMapString)
	{
		out = inString;//CHUDUtils::LocalizeString(stringId.c_str(), gamemodeStringId, mapIDString);
	}
	else
	{
		out = inString;//CHUDUtils::LocalizeString("@mp_rp_gameplay_unknownmap", gamemodeStringId);
	}

#else
	out = inString;
#endif
}
void CCheckpointSystem::RepairLevelName(CryFixedStringT<32> &levelName)
{
	if(levelName.empty())
		return;
	int posSlash = levelName.rfind('/');
	if(posSlash != levelName.npos)	//This is a work-around for the editor/fullgame incompatible level name convention
		levelName = levelName.substr(posSlash+1, levelName.size() - posSlash);
}