Files
BuYuHouDuan/ChessGameSrc/ChessGameService/IChessGameService.cs
T

56 lines
2.0 KiB
C#
Raw Normal View History

2026-10-12 16:22:04 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ChessGameDomain;
using ChessGameService.Param;
namespace ChessGameService
{
public interface IChessGameService
{
Task<(bool isok, string msg, ChessGameRoom room)> CreateRoomAsync(CreateRoomParam param, string cid);
Task<(bool success, string message, ChessGameRoom room)> JoinGameAsync(string gameId, string pwd, string userId, string cid);
List<ChessGameRoom> GetRoomList(int partition, int maxRooms = 100);
(bool success, string message, ChessGameRoom room) StartGame(string gameId, string userId);
(bool success, string message, bool allReady) GameReady(string gameId, string userId);
Task<(bool success, string message, ChessGameRoom room)> EndGame(string gameId, string winUserId);
(bool success, string message, ChessGameRoom room) RestartGame(string gameId, string userId);
Task<(bool success, string message, ChessGameRoom room, bool allConfirmed)> RequestEndGame(string gameId, string userId, string endRequestId);
Task<(bool isTimeout, string loserUserId)> CheckRoomTimeout(string gameId);
Task<(bool isTimeout, string loserUserId)> CheckRoomAfkTimeout(string gameId);
Task UpdateUserActiveTime(string gameId, string userId);
Task SetPlayerAfk(string gameId, string userId);
Task CancelPlayerAfk(string gameId, string userId);
bool ExitRoom(ChessGameRoom room);
(bool isok, string msg, ChessGameRoom room) ExitRoom(string gameId, string userId);
(bool isok, string msg, ChessGameRoom room) AdminKickPlayer(string gameId, string userId);
(bool success, string message, ChessGameRoom room) GoldConfig(string gameId, long gold, string userId);
ChessGameRoom GetUserRoom(string cid);
ChessGameRoom GetRoom(string gameId);
List<ChessGameRoom> GetAllPlayingRooms();
Task UpdateUserGameType(string userId, int gameType, string roomNumber = "");
}
}