/// <summary>Stores a mod's statistics in the cache.</summary> public static bool SaveModStatistics(ModStatistics stats) { Debug.Assert(stats != null); string statsFilePath = GenerateModStatisticsFilePath(stats.modId); return(IOUtilities.WriteJsonObjectFile(statsFilePath, stats)); }
/// <summary>Stores a user's profile in the cache.</summary> public static bool SaveUserProfile(UserProfile userProfile) { Debug.Assert(userProfile != null); string filePath = CacheClient.GenerateUserProfileFilePath(userProfile.id); return(IOUtilities.WriteJsonObjectFile(filePath, userProfile)); }
/// <summary>Stores a mod team's data in the cache.</summary> public static bool SaveModTeam(int modId, List <ModTeamMember> modTeam) { Debug.Assert(modTeam != null); string filePath = CacheClient.GenerateModTeamFilePath(modId); return(IOUtilities.WriteJsonObjectFile(filePath, modTeam)); }
/// <summary>Stores a mod logo in the cache with the given fileName.</summary> public static bool SaveModLogo(int modId, string fileName, LogoSize size, Texture2D logoTexture) { Debug.Assert(!String.IsNullOrEmpty(fileName)); Debug.Assert(logoTexture != null); string logoFilePath = CacheClient.GenerateModLogoFilePath(modId, size); bool isSuccessful = IOUtilities.WritePNGFile(logoFilePath, logoTexture); // - Update the versioning info - var versionInfo = CacheClient.GetModLogoVersionFileNames(modId); if (versionInfo == null) { versionInfo = new Dictionary <LogoSize, string>(); } versionInfo[size] = fileName; isSuccessful = (IOUtilities.WriteJsonObjectFile(GenerateModLogoVersionInfoFilePath(modId), versionInfo) && isSuccessful); return(isSuccessful); }
// ---------[ SAVE/LOAD ]--------- /// <summary>Writes the UserAuthenticationData to disk.</summary> private static void SaveInstance() { IOUtilities.WriteJsonObjectFile(FILE_LOCATION, UserAuthenticationData.m_instance); }
/// <summary>Stores a mod's profile in the cache.</summary> public static bool SaveModProfile(ModProfile profile) { Debug.Assert(profile != null); return(IOUtilities.WriteJsonObjectFile(GenerateModProfileFilePath(profile.id), profile)); }
/// <summary>Stores the game's profile in the cache.</summary> public static bool SaveGameProfile(GameProfile profile) { Debug.Assert(profile != null); return(IOUtilities.WriteJsonObjectFile(gameProfileFilePath, profile)); }
/// <summary>Stores a modfile in the cache.</summary> public static bool SaveModfile(Modfile modfile) { Debug.Assert(modfile != null); return(IOUtilities.WriteJsonObjectFile(GenerateModfileFilePath(modfile.modId, modfile.id), modfile)); }