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
48 lines
1.0 KiB
C#
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());
|
|
}
|
|
}
|
|
}
|