using System.Collections.Concurrent; namespace ArmaRAMDb { internal class KeyValueStore { private static readonly ConcurrentDictionary _keyValues = RAMDb._keyValues; public static string GetValue(string key) { string value = _keyValues.TryGetValue(key, out string data) ? data : string.Empty; Main.Log($"GetValue: {key} - Value: {value}", "debug"); return value; } public static bool DeleteValue(string key) { var result = _keyValues.TryRemove(key, out _); Main.Log($"DeleteValue: {key} - Success: {result}", "debug"); return result; } public static bool SetValue(string key, string value) { _keyValues.AddOrUpdate(key, value, (_, _) => value); Main.Log($"SetValue: {key} - Value: {value}", "debug"); return true; } } }