コード例 #1
0
ファイル: AccountMapping.cs プロジェクト: whensummit/kailsdf
        /// <summary>
        /// 客户端注销
        /// </summary>
        /// <param name="session"></param>
        /// <param name="oldUserName"></param>
        public static void RemoveClients(Session session, string oldUserName = null)
        {
            string betServerId = session.BetServerId;

            if (string.IsNullOrEmpty(betServerId) || SessionPool.GetByClientId(betServerId, ClientTypeEnum.Bet) == null)
            {
                return;
            }

            //// 通知投注端清理投注账号的资源
            //List<WebsiteAccountDetail> websiteAccounts =
            //    WebsiteAccountService.Instance.GetAccountListByMemberId(session);
            //if (websiteAccounts != null && websiteAccounts.Count > 0)
            //{
            //    foreach (var account in websiteAccounts)
            //    {
            //        MQRouterSendQueue.QuitOut(betServerId, new WebsiteAccountContract()
            //        {
            //            WebsiteEnum = account.WebsiteEnum,
            //            UserName = account.UserName
            //        });
            //    }
            //}

            // 释放一个控盘端可用额
            if (AvailableBetServers.ContainsKey(betServerId))
            {
                AvailableBetServers[betServerId] -= 1;
            }
        }
コード例 #2
0
        // 各个服务端发送心跳数据
        public static MQActionVoidResult Heartbeat(string sessionId, HeartbeatParam param)
        {
            Session session = SessionPool.GetByClientId(sessionId, param.ClientType);

            if (session != null)
            {
                session.Heartbeat = DateTime.Now;
                if (param.platform.HasValue)
                {
                    session.platform = param.platform;
                }
                return(MQActionVoidResult.Ok());
            }
            else
            {
                return(MQActionVoidResult.Error($"{param.ClientType.ToClientTypeString()}连接中心服务器超时,请关闭重启"));
            }
        }
コード例 #3
0
        public static MQActionVoidResult ChangePassword(string sessionId, ChangePasswordParam param)
        {
            Session session = SessionPool.GetByClientId(sessionId, ClientTypeEnum.Client);

            if (session == null)
            {
                return(MQActionVoidResult.Error(CommonErrors.NotConnectingCenterServer));
            }

            string result = SysMemberService.Instance.ChangePassword(session.SysmemberId, param);

            if (result == "1")
            {
                return(MQActionVoidResult.Ok());
            }
            else
            {
                return(MQActionVoidResult.Error(result));
            }
        }