Beispiel #1
0
        public bool SaveGameAccessToken(IDbConnection db, GameAccessToken gat)
        {
            gat.saved_at = DateTime.UtcNow;
            return 1 == db.Execute("UPDATE game_access_token SET data=@data, meta=@meta, saved_at=@saved_at WHERE token=@token", gat);

        }
Beispiel #2
0
        public bool SaveProgress(string gameUuid, string token, string data, string meta)
        {
            var repo = Repo.Instance;
            using (var db = repo.OpenConnectionFromPool())
            {
                var game = repo.GetGame(db, gameUuid);
                if (!game.Succeeded)
                {
                    return false;
                }

                var gat = new GameAccessToken
                {
                    game_id = game.Data.id,
                    token = token,
                    data = data,
                    meta = meta
                };

                repo.SaveGameAccessToken(db, gat);
            }
            return true;
        }