Files
BuYuHouDuan/ChessGameSrc/ChessGameDomain/ChessGameRoom.cs
T
2026-10-12 16:22:04 +08:00

45 lines
1.3 KiB
C#

using System.ComponentModel.DataAnnotations.Schema;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace ChessGameDomain
{
[BsonCollection("game_room", ServiceDatabases.Chess)]
[BsonIgnoreExtraElements]
public class ChessGameRoom : MongoBaseEntity
{
[Column(TypeName = "jsonb")]
public List<RedisChessGameUser> users { get; set; } = new List<RedisChessGameUser>();
public string RoomId { get; set; }
public DateTime CreateTime { get; set; }
public int gameType { get; set; }
public string password { get; set; }
public string createUserId { get; set; }
public int state { get; set; } = 1;
public long gold { get; set; } = 1000;
public int robotCount { get; set; } = 0;
public Dictionary<string, long> EndGameRequests { get; set; } = new Dictionary<string, long>();
public long LastActiveTime { get; set; } = 0;
public int TimeoutSeconds { get; set; } = 60;
public int AfkTimeoutSeconds { get; set; } = 120;
public string TimeoutLoserUserId { get; set; } = "";
public string PendingWinUserId { get; set; } = "";
public bool IsGameEnded { get; set; } = false;
}
}