Files
2026-10-12 16:22:04 +08:00

138 lines
4.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using ChessGameDomain;
using CommonDomain;
using RedisService.Param;
using UserDomain.Entity;
namespace RedisService
{
public interface IRedisService
{
RedisUserCid GetRedisUserCId(string userId);
void SetRedisUserCId(RedisUserCid redisUser);
void RemoveRedisUserCId(string userId);
string GetLoginUserId(string cid);
void SetLoginUserId(string cid, string userId);
void RemoveLoginUserId(string cid);
IEnumerable<string> GetAllLoginUserIds();
string GetUserId(string cid);
void SetUserId(string cid, string userId);
void RemoveUserId(string cid);
void SetVerificationCode(string phone, string code);
string GetVerificationCode(string phone);
void RemoveVerificationCode(string phone);
void SetGameConfig(GameConfig gameConfig);
GameConfig GetGameConfig();
void RemoveGameConfig();
void SetActivityConfig(ActivityConfig config);
ActivityConfig GetActivityConfig();
void RemoveActivityConfig();
void SetFishingKillConfig(FishingKillConfig config);
FishingKillConfig GetFishingKillConfig();
void SetFishSpawnConfig(string json);
string GetFishSpawnConfig();
void SetGameRoom(RedisGameRoom gameRoom);
RedisGameRoom GetGameRoom(string roomId);
IEnumerable<RedisGameRoom> GetGameRoomList(string partition);
IEnumerable<RedisGameRoom> GetGameRoomAllList();
void RemoveGameRoom(string partition);
void RemoveGameRoomAll();
void SetChessRoom(ChessGameRoom room);
ChessGameRoom GetChessRoom(string roomId);
List<ChessGameRoom> GetAllChessRooms();
List<ChessGameRoom> GetAllPlayingChessRooms();
string GetPendingFishRoomId(string userId);
string GetPendingChessRoomId(string userId);
void RemoveChessRoom(string roomId);
void ClearAllChessRooms();
void ClearAllGameRooms();
void ClearAllUserMappings();
void ClearAllLoginUserIds();
void SetSystemGoldDay(long amount);
void AddSystemGoldDay(long gold);
long GetSystemGoldDay();
long IncrBy(string key, long value);
string GetString(string key);
void SetString(string key, string value);
long GetPlayerGold(string roomId, string userId);
void SetPlayerGold(string roomId, string userId, long gold);
bool AddBulletId(string roomId, string userId, string bulletId);
bool ExistsBulletId(string roomId, string userId, string bulletId);
bool RemoveBulletId(string roomId, string userId, string bulletId);
long GetBulletCount(string roomId, string userId);
void ClearBulletIds(string roomId, string userId);
void ClearPlayerRuntimeData(string roomId, string userId);
void AddFishingTaskProgress(string roomId, string userId, int taskEvent, long count);
Dictionary<int, long> GetFishingTaskProgress(string roomId, string userId, IEnumerable<int> taskEvents);
void ClearFishingTaskProgress(string roomId, string userId, IEnumerable<int> taskEvents);
void AddFishingConsumeProgress(string roomId, string userId, long count);
long GetFishingConsumeProgress(string roomId, string userId);
void AddFishingExpProgress(string roomId, string userId, long count);
long GetFishingExpProgress(string roomId, string userId);
void ClearFishingRuntimeProgress(string roomId, string userId);
PlayerFactor GetPlayerFactor(string roomId, string userId);
void SetPlayerFactor(string roomId, string userId, PlayerFactor factor);
void RemovePlayerFactor(string roomId, string userId);
List<string> GetKillFishIds(string roomId);
void AddKillFishId(string roomId, string fishId);
bool ContainsKillFishId(string roomId, string fishId);
}
}