Beispiel #1
0
        // 断开连接(Session/Disconnect)
        public static MQActionVoidResult Disconnect(string sessionId, ValueTypeParam <ClientTypeEnum> param)
        {
            Session session = SessionPool.RemoveByClientId(sessionId, param.Value);

            if (session != null && param.Value == ClientTypeEnum.Bet)
            {
                AccountMapping.RemoveBetServer(session);
            }
            else if (session != null && param.Value == ClientTypeEnum.Client)
            {
                AccountMapping.RemoveClients(session);
            }
            return(MQActionVoidResult.Ok());
        }
Beispiel #2
0
        /// <summary>
        /// 某个端建立连接, 并由中心服务器返回分配的SessionId
        /// </summary>
        /// <param name="sessionId">空字符串</param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static MQActionResult <string> Connect(string sessionId, ValueTypeParam <ClientTypeEnum> param)
        {
            if (param.Value == ClientTypeEnum.Client)
            {
                return(MQActionResult <string> .Error("控盘端只能在登陆成功逻辑中创建Session."));
            }

            sessionId = Guid.NewGuid().ToString();
            Session session = new Session(sessionId, param.Value);

            session.platform = param.Platform;

            SessionPool.SetNew(sessionId, session);

            // 投注端建立链接,初始化可投注缓存数据
            if (param.Value == ClientTypeEnum.Bet)
            {
                AccountMapping.AddAvailableBetServer(sessionId);
            }

            return(MQActionResult <string> .Ok(sessionId));
        }
 public void Get_ValueTypeUrlParam(ValueTypeParam urlParam)
 {
 }