public bool Set(string key, object value, Type type, DateTime absoluteExpiration)
 {
     if (string.IsNullOrWhiteSpace(key) || value == null)
     {
         return(false);
     }
     return(RedisHelper.Set(key, SerializerHandler.ToBytes(value, type), absoluteExpiration - DateTime.Now));
 }
Ejemplo n.º 2
0
 public static string ToJson(Stat item) => SerializerHandler.SerializeString(item);
Ejemplo n.º 3
0
 public static Stat FromJson(string json) => SerializerHandler.DeserializeObj <Stat>(json);
 public object Get(string key, Type type)
 {
     return(string.IsNullOrWhiteSpace(key) ? null : SerializerHandler.BytesToObject(RedisHelper.Get <byte[]>(key), type));
 }
Ejemplo n.º 5
0
 public void OnGameOverActive()
 {
     CheckBestScore();
     //serialization call
     SerializerHandler.Save(SerializerHandler.DefaultDirectory, "Score.json", JsonUtility.ToJson(this));
 }