/*
 * 作者:吴隆健
 * 日期: 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());
		}
	}
}
