Files
hjha-server/GameDAL/ServerInfo/GameSeridDic.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) +
game logic (GameFix/GameDAL/ServerData) +
network layer (NetWorkMessage) +
data layer (ObjectModel) +
utilities (MrWu/Core/Config/CloudAPI/dll) +
adapters (zyxAdapter/base)

.NET 8.0 C# solution, 16 projects, 958 source files
2026-07-07 12:02:15 +08:00

48 lines
1.0 KiB
C#

/*
* 作者:吴隆健
* 日期: 2019-04-18
* 时间: 15:48
*
*/
using System;
using System.Collections.Concurrent;
using Server.DB.Redis;
using MrWu.Debug;
namespace GameDAL.ServerInfo
{
/// <summary>
/// 游戏模块id 与其对应的serid 字典
/// </summary>
public class GameSeridDic
{
private GameSeridDic(){}
static GameSeridDic(){
instance = new GameSeridDic();
}
public static GameSeridDic instance{
get;
private set;
}
private const string headKey = "Game:NodeInfo:GameSerId";
/// <summary>
/// 游戏服务器对应的id key 为 模块id value 为gameid
/// </summary>
private ConcurrentDictionary<int,int> GameSers = new ConcurrentDictionary<int, int>();
/// <summary>
/// 添加
/// </summary>
/// <param name="moduleId"></param>
/// <param name="serverId"></param>
public void Add(int moduleId,int serverId){
redisManager.db.HashSet(headKey,moduleId.ToString(),serverId.ToString());
}
}
}