public static void AddLine(string path, string key, string val) { if (SaveFiles_Mapped.SearchValue(path, key) != null) { return; } File.AppendAllLines(path, new string[] { key + ":" + val }); return; }
internal static bool HasUserHitDailyLimit(ulong id, string gameName) { int limit = GetDailyLimit(gameName); if (limit == 0) { throw new Exception("Non-existing game sought for in Daily Limit search."); } gameName = gameName.ToUpper().Trim(); string playsTodayStr = SaveFiles_Mapped.SearchValue(USER_SAVE_DIRECTORY + "\\" + id + "\\" + UNO_SAVE_FILE_NAME, "PLAYSTODAY-" + gameName) ?? ""; if (!Int32.TryParse(playsTodayStr, out int ignore)) { throw new Exception("Daily limiit string was not a number"); } int playsToday = Int32.Parse(playsTodayStr); if (playsToday >= limit) { return(true); } return(false); }