public PlayerInfo CreateLogin(string name, string password, ref string message, ref int isFirst, string IP, ref bool isError, bool firstValidate, ref bool isActive, string site, string nickname, out bool needcreate) { PlayerInfo result; needcreate = false; try { using (PlayerBussiness db = new PlayerBussiness()) { bool isExist = true; DateTime forbidDate = DateTime.Now; PlayerInfo info = db.LoginGame(name, ref isFirst, ref isExist, ref isError, firstValidate, ref forbidDate, nickname); string debug = isError.ToString(); message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail8" + debug, new object[0]); if (info == null) { message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail99", new object[0]); if (!db.ActivePlayer(ref info, name, password, true, this.ActiveGold, this.ActiveMoney, this.ActiveGiftToken, IP, site)) { info = null; message = LanguageMgr.GetTranslation("BaseInterface.LoginAndUpdate.Fail", new object[0]); } else { message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail10", new object[0]); isActive = true; } } else { if (!isExist) { message = String.Format("您的账号已被封停,将于{0}年{1}月{2}日{3}时{4}分解封.\n", new object[] { forbidDate.Year, forbidDate.Month, forbidDate.Day, forbidDate.Hour, forbidDate.Minute }); result = null; return(result); } needcreate = true; } result = info; return(result); } } catch (Exception ex) { LSJInterface.log.Error("LoginAndUpdate", ex); } result = null; return(result); }
public virtual PlayerInfo CreateLogin(string name, string password, ref string message, ref int isFirst, string IP, ref bool isError, bool firstValidate, ref bool isActive, string site, string nickname) { try { using (PlayerBussiness playerBussiness = new PlayerBussiness()) { bool flag = true; DateTime now = DateTime.Now; PlayerInfo playerInfo = playerBussiness.LoginGame(name, ref isFirst, ref flag, ref isError, firstValidate, ref now, nickname, IP); if (playerInfo == null) { if (!playerBussiness.ActivePlayer(ref playerInfo, name, password, true, this.ActiveGold, this.ActiveMoney, IP, site)) { playerInfo = null; message = LanguageMgr.GetTranslation("BaseInterface.LoginAndUpdate.Fail", new object[0]); goto IL_11B; } isActive = true; using (CenterServiceClient centerServiceClient = new CenterServiceClient()) { centerServiceClient.ActivePlayer(true); goto IL_11B; } } if (flag) { using (CenterServiceClient centerServiceClient2 = new CenterServiceClient()) { centerServiceClient2.CreatePlayer(playerInfo.ID, name, password, isFirst == 0); goto IL_11B; } } message = LanguageMgr.GetTranslation("ManageBussiness.Forbid1", new object[] { now.Year, now.Month, now.Day, now.Hour, now.Minute }); PlayerInfo result = null; return(result); IL_11B: result = playerInfo; return(result); } } catch (Exception exception) { BaseInterface.log.Error("LoginAndUpdate", exception); } return(null); }
public virtual PlayerInfo CreateLogin(string name, string password, ref string message, ref int isFirst, string IP, ref bool isError, bool firstValidate, ref bool isActive, string site, string nickname) { try { using (PlayerBussiness db = new PlayerBussiness()) { bool isExist = true; DateTime forbidDate = DateTime.Now; PlayerInfo info = db.LoginGame(name, ref isFirst, ref isExist, ref isError, firstValidate, ref forbidDate, nickname); if (info == null) { if (!db.ActivePlayer(ref info, name, password, true, ActiveGold, ActiveMoney, IP, site)) { info = null; // message = "Active is fail!"; message = LanguageMgr.GetTranslation("BaseInterface.LoginAndUpdate.Fail"); } else { isActive = true; using (CenterServiceClient client = new CenterServiceClient()) { client.ActivePlayer(true); } } } else { if (isExist) { using (CenterServiceClient client = new CenterServiceClient()) { client.CreatePlayer(info.ID, name, password, isFirst == 0); } } else { message = LanguageMgr.GetTranslation("ManageBussiness.Forbid1", forbidDate.Year, forbidDate.Month, forbidDate.Day, forbidDate.Hour, forbidDate.Minute); return(null); } } return(info); } } catch (Exception ex) { log.Error("LoginAndUpdate", ex); } return(null); }
public virtual PlayerInfo CreateLogin(string name, string password, ref string message, ref int isFirst, string IP, ref bool isError, bool firstValidate, ref bool isActive, string site, string nickname) { try { using (PlayerBussiness playerBussiness = new PlayerBussiness()) { bool isExist = true; DateTime now = DateTime.Now; PlayerInfo player = playerBussiness.LoginGame(name, ref isFirst, ref isExist, ref isError, firstValidate, ref now, nickname, IP); if (player == null) { if (!playerBussiness.ActivePlayer(ref player, name, password, true, this.ActiveGold, this.ActiveMoney, IP, site)) { player = (PlayerInfo)null; message = LanguageMgr.GetTranslation("BaseInterface.LoginAndUpdate.Fail", new object[0]); } else { isActive = true; using (CenterServiceClient centerServiceClient = new CenterServiceClient()) centerServiceClient.ActivePlayer(true); } } else if (isExist) { using (CenterServiceClient centerServiceClient = new CenterServiceClient()) centerServiceClient.CreatePlayer(player.ID, name, password, isFirst == 0); } else { message = LanguageMgr.GetTranslation("ManageBussiness.Forbid1", (object)now.Year, (object)now.Month, (object)now.Day, (object)now.Hour, (object)now.Minute); return((PlayerInfo)null); } return(player); } } catch (Exception ex) { BaseInterface.log.Error((object)"LoginAndUpdate", ex); } return((PlayerInfo)null); }
public virtual PlayerInfo CreateLogin(string name, string password, ref string message, ref int isFirst, string IP, ref bool isError, bool firstValidate, ref bool isActive, string site, string nickname) { try { using (PlayerBussiness db = new PlayerBussiness()) { bool isExist = true; DateTime forbidDate = DateTime.Now; PlayerInfo info = db.LoginGame(name, ref isFirst, ref isExist, ref isError, firstValidate, ref forbidDate, nickname); if (info == null) { if (!db.ActivePlayer(ref info, name, password, true, ActiveGold, ActiveMoney, IP, site)) { info = null; // message = "Active is fail!"; message = LanguageMgr.GetTranslation("BaseInterface.LoginAndUpdate.Fail"); } else { isActive = true; using (CenterServiceClient client = new CenterServiceClient()) { client.ActivePlayer(true); } } } else { if (isExist) { using (CenterServiceClient client = new CenterServiceClient()) { client.CreatePlayer(info.ID, name, password, isFirst == 0); } } else { message = LanguageMgr.GetTranslation("ManageBussiness.Forbid1", forbidDate.Year, forbidDate.Month, forbidDate.Day, forbidDate.Hour, forbidDate.Minute); return null; } } return info; } } catch (Exception ex) { log.Error("LoginAndUpdate", ex); } return null; }