private bool doLoginNew(ref string cookie) { try { TxLogininfoEntity tLoginInfo = null; var platformId = GetParam("platform"); var userName = GetParam("openid"); if (ShareUtil.IsQunHei) { userName = GetParam("username"); } //if (userName.Length>0 && userName.Contains("h5_zhiqu")) // return false; var user = NbUserMgr.GetByAccount(userName, GetIp(), DateTime.Today.AddDays(-1), DateTime.Today, 0); var sessionId = ShareUtil.GenerateComb().ToString(); if (user != null) { UserAccountEntity userAccountEntity = new UserAccountEntity(user.Account, Guid.Empty, "", 1, platformId, sessionId); userAccountEntity.ExtraData = "d|pengyou|f"; var info = reader.GetManagerInfoByAccount(userAccountEntity.Account, GetIp(), UAFactory.Instance.IsTx); if (info.Code == (int)MessageCode.Success) { if (info.Data.NeedSelect == false) { if (ShareUtil.IsTx) { string openKey = GetParam("openkey"); string pf = GetParam("pf"); if (string.IsNullOrEmpty(pf)) { pf = "wanba_ts"; } string platform = GetParam("platform"); //userip //sig int appId = UAFactory.Instance.TxAppId; string appKey = UAFactory.Instance.TxAppKey; var result = WbUserInfo(userName, openKey, pf, platform, appId, appKey); if (result != 0) { OutputHelper.Output(result); } tLoginInfo = new TxLogininfoEntity(userName, openKey, pf, platform, "", "", DateTime.Now, DateTime.Now); } if (info.Data.ManagerInfo == null) { string playerName = ""; string logo = "1"; int templateId = 1; var createData = reader.CreateManager(UserAccount.Account, playerName, logo, templateId, UAHelper.GetRealIP()); if (createData.Code != (int)MessageCode.Success) { info.Code = createData.Code; OutputHelper.Output(info); } info = reader.GetManagerInfoByAccount(UserAccount.Account, GetIp(), UAFactory.Instance.IsTx);; } try { if (ShareUtil.IsH5A8) { UA_A8.UserAction("entergame", info.Data.ManagerInfo.Manager.Account, "", "", info.Data.ManagerInfo.Manager); } } catch (Exception) { } if (CheckLockState(info.Data.ManagerInfo.Manager.Idx)) { OutputHelper.Output(MessageCode.LoginOnlineLock); } //写入登录信息 cookie = UAHelper.SetFormsAuthentication(userAccountEntity.Account, info.Data.ManagerInfo.Manager.Idx, info.Data.ManagerInfo.Manager.Name, 1, sessionId); OnlineMgr.LoginSession(info.Data.ManagerInfo.Manager.Idx, sessionId); onlineClient.RiseOnlineTime(info.Data.ManagerInfo.Manager.Idx); info.Data.Cookie = cookie; Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, cookie)); var isSubscribe = GetParamBool("isSubscribe"); if (isSubscribe)//关注 { activityClient.DoShare(info.Data.ManagerInfo.Manager.Idx, 4); } if (ShareUtil.IsTx) { TxLogininfoMgr.InsertUpdate(tLoginInfo); } return(true); } return(true); } else { FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, user.Account, DateTime.Now, DateTime.Now.AddDays(10), false, userAccountEntity.ToString(), FormsAuthentication .FormsCookiePath); cookie = FormsAuthentication.Encrypt(ticket); Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, cookie)); return(false); } } return(false); } catch (Exception ex) { cookie = ex.ToString(); return(true); } }