/*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 }
/*static*/ void CGameBrowser::LocaliseInGamePresenceString(CryFixedStringT<MAX_PRESENCE_STRING_SIZE> &out, const char* stringId, const int32 gameModeId, const int32 mapId) { #if USE_CRYLOBBY_GAMESPY out.Format("%s:%d:%d", stringId, gameModeId, mapId); #else out = CHUDUtils::LocalizeString("@mp_rp_gameplay", GetGameModeStringFromId(gameModeId), GetMapStringFromId(mapId)); #endif }
/*static*/ void CGameBrowser::LocaliseInGamePresenceString(CryFixedStringT<MAX_PRESENCE_STRING_SIZE> &out, const char* stringId, const int32 gameModeId, const int32 mapId) { out = CHUDUtils::LocalizeString("@mp_rp_gameplay", GetGameModeStringFromId(gameModeId), GetMapStringFromId(mapId)); }