Пример #1
0
 public bool SetPlayerTurn(string gameId, Player player)
 {
     if (string.IsNullOrWhiteSpace(player.GameConnectionid))
     {
         var gameConnection = Connections.GetAsync(Relations.GamePlayer, gameId, player.Id).Result;
         player.GameConnectionid = gameConnection.Id;
     }
     Connection conn = new Connection(Relations.GamePlayer, player.GameConnectionid);
     conn.Set("isactive", player.IsActive);
     conn.SaveAsync();
     return true;
 }
Пример #2
0
 public bool SaveGamePlayerStatus(string gameId, Player player)
 {
     if (string.IsNullOrWhiteSpace(player.GameConnectionid))
     {
         var gameConnection = Connections.GetAsync(Relations.GamePlayer, gameId, player.Id).Result;
         player.GameConnectionid = gameConnection.Id;
     }
     Connection conn = new Connection(Relations.GamePlayer, player.GameConnectionid);
     conn.Set("points", player.Points);
     conn.Set("tiles", string.Join("|", player.Tiles));
     conn.Set("isactive", player.IsActive);
     conn.Set("tiles_remaining", player.TilesRemaining);
     conn.SaveAsync();
     return true;
 }