示例#1
0
        public void ProcessRequest(HttpContext context)
        {
            LanguageMgr.Setup(ConfigurationManager.AppSettings["ReqPath"]);
            bool   value   = false;
            string message = LanguageMgr.GetTranslation("Tank.Request.RenameConsortiaName.Fail1");// "Login Fail!";

            XElement result = new XElement("Result");

            try
            {
                BaseInterface inter = BaseInterface.CreateInterface();
                string        p     = context.Request["p"];
                string        site  = context.Request["site"] == null ? "" : HttpUtility.UrlDecode(context.Request["site"]);
                //string nickname = context.Request["nickname"] == null ? "" : HttpUtility.UrlDecode(context.Request["nickname"]);
                //string newNickname = context.Request["consortiaName"] == null ? "" : HttpUtility.UrlDecode(context.Request["consortiaName"]);
                string IP = context.Request.UserHostAddress;
                if (!string.IsNullOrEmpty(p))
                {
                    //解密
                    byte[]   src     = CryptoHelper.RsaDecryt2(StaticFunction.RsaCryptor, p);
                    string[] strList = Encoding.UTF8.GetString(src, 7, src.Length - 7).Split(',');
                    if (strList.Length == 5)
                    {
                        string name          = strList[0];
                        string pwd           = strList[1];
                        string newPwd        = strList[2];
                        string nickname      = strList[3];
                        string consortiaName = strList[4];

                        if (PlayerManager.Login(name, pwd))
                        {
                            using (PlayerBussiness db = new PlayerBussiness())
                            {
                                if (db.RenameConsortiaName(name, nickname, consortiaName, ref message))
                                {
                                    PlayerManager.Update(name, newPwd);
                                    value   = true;
                                    message = LanguageMgr.GetTranslation("Tank.Request.RenameConsortiaName.Success");
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error("RenameConsortiaName", ex);
                value   = false;
                message = LanguageMgr.GetTranslation("Tank.Request.RenameConsortiaName.Fail2");
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
        }
示例#2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            try
            {
                //param格式://int templateID, int count, int validDate, int StrengthenLevel, int AttackCompose, int DefendCompose, int AgilityCompose, int LuckCompose, bool isBinds
                //result:0:成功 1:失败 2:没有该账号 3:ip无效  4:param不合法 5:key错误 6:content内参数列不正确 7:超时
                int result = 1;

                //判断IP是否合法
                if (ValidSentRewardIP(context.Request.UserHostAddress))
                {
                    string content = HttpUtility.UrlDecode(context.Request["content"]);


                    string key = GetSentRewardKey;

                    BaseInterface inter     = BaseInterface.CreateInterface();
                    string[]      str_param = inter.UnEncryptSentReward(content, ref result, key);

                    if (str_param.Length == 8 && result != 5 && result != 6 && result != 7)
                    {
                        string mailTitle   = str_param[0];
                        string mailContent = str_param[1];
                        string username    = str_param[2];
                        int    gold        = Int32.Parse(str_param[3]);
                        int    money       = Int32.Parse(str_param[4]);
                        string param       = str_param[5];

                        //判断para是否合法,并将不合法的数值设为默认合法值
                        if (checkParam(ref param))
                        {
                            PlayerBussiness pb = new PlayerBussiness();
                            result = pb.SendMailAndItemByUserName(mailTitle, mailContent, username, gold, money, param);
                        }
                        else
                        {
                            result = 4;
                        }
                    }
                }
                else
                {
                    result = 3;
                }

                context.Response.Write(result);
            }
            catch (Exception ex)
            {
                log.Error("SentReward", ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int result = 1;

            try
            {
                if (ValidLoginIP(Context.Request.UserHostAddress))
                {
                    string        content = HttpUtility.UrlDecode(Request["content"]);
                    string        site    = Request["site"] == null ? "" : HttpUtility.UrlDecode(Request["site"]).ToLower();
                    BaseInterface inter   = BaseInterface.CreateInterface();
                    string[]      str     = inter.UnEncryptLogin(content, ref result, site);
                    if (str.Length > 3)
                    {
                        string name     = str[0].Trim();
                        string password = str[1].Trim();
                        if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(password))
                        {
                            name = BaseInterface.GetNameBySite(name, site);
                            PlayerManager.Add(name, password);

                            result = 0;
                        }
                    }
                }
                else
                {
                    result = 3;
                }
            }
            catch (Exception ex)
            {
                log.Error("CreateLogin:", ex);
            }
            Response.Write(result);
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int result = 1;

            try
            {
                string IP = Context.Request.UserHostAddress;
                if (ValidLoginIP(IP))
                {
                    string content  = HttpUtility.UrlDecode(Request["content"]);
                    string site     = Request["site"] == null ? "" : HttpUtility.UrlDecode(Request["site"]).ToLower();
                    string nickname = Request["nickname"] == null ? "" : HttpUtility.UrlDecode(Request["nickname"]);

                    BaseInterface inter = BaseInterface.CreateInterface();
                    string[]      str   = inter.UnEncryptCharge(content, ref result, site);
                    if (str.Length > 5)
                    {
                        string  chargeID  = str[0];
                        string  userName  = str[1].Trim();
                        int     money     = int.Parse(str[2]);
                        string  payWay    = str[3];
                        decimal needMoney = decimal.Parse(str[4]);

                        if (!string.IsNullOrEmpty(userName))
                        {
                            userName = BaseInterface.GetNameBySite(userName, site);
                            if (money > 0)
                            {
                                using (PlayerBussiness db = new PlayerBussiness())
                                {
                                    int      userID;
                                    DateTime date = DateTime.Now;
                                    if (db.AddChargeMoney(chargeID, userName, money, payWay, needMoney, out userID, ref result, date, IP, nickname))
                                    {
                                        result = 0;
                                        using (CenterServiceClient temp = new CenterServiceClient())
                                        {
                                            temp.ChargeMoney(userID, chargeID);
                                            using (PlayerBussiness pb = new PlayerBussiness())
                                            {
                                                PlayerInfo player = pb.GetUserSingleByUserID(userID);
                                                if (player != null)
                                                {
                                                    StaticsMgr.Log(date, userName, player.Sex, money, payWay, needMoney);
                                                }
                                                else
                                                {
                                                    StaticsMgr.Log(date, userName, true, money, payWay, needMoney);
                                                    log.Error("ChargeMoney_StaticsMgr:Player is null!");
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                result = 3;
                            }
                        }
                        else
                        {
                            result = 2;
                        }
                    }
                }
                else
                {
                    result = 5;
                }
            }
            catch (Exception ex)
            {
                log.Error("ChargeMoney:", ex);
            }
            Response.Write(result);
        }
示例#5
0
        public void ProcessRequest(HttpContext context)
        {
            LanguageMgr.Setup(ConfigurationManager.AppSettings["ReqPath"]);
            bool   value   = false;
            string message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail1");// "Login Fail!";
            string style   = "";
            bool   isError = false;

            XElement result = new XElement("Result");

            try
            {
                BaseInterface inter = BaseInterface.CreateInterface();
                string        p     = context.Request["p"];//?
                string        site  = context.Request["site"] == null ? "" : HttpUtility.UrlDecode(context.Request["site"]);
                //string nickname = context.Request["nickname"] == null ? "" : HttpUtility.UrlDecode(context.Request["nickname"]);
                string IP = context.Request.UserHostAddress;
                if (!string.IsNullOrEmpty(p))
                {
                    //解密
                    byte[]   src     = CryptoHelper.RsaDecryt2(StaticFunction.RsaCryptor, p);
                    string[] strList = Encoding.UTF8.GetString(src, 7, src.Length - 7).Split(',');
                    if (strList.Length == 4)
                    {
                        string name     = strList[0];
                        string pwd      = strList[1];
                        string newPwd   = strList[2];
                        string nickname = strList[3];

                        if (true)    //(PlayerManager.Login(name, pwd))
                        {
                            int  isFirst       = 0;
                            bool isActive      = false;
                            bool firstValidate = PlayerManager.GetByUserIsFirst(name);
                            //using (PlayerBussiness db = new PlayerBussiness())
                            //{
                            //    PlayerInfo[] infos = db.GetUserLoginList(name);

                            //    if (infos.Length <= 0)
                            //    {
                            //        throw new Exception();
                            //    }
                            //}
                            PlayerInfo player = inter.CreateLogin(name, newPwd, ref message, ref isFirst, IP, ref isError, firstValidate, ref isActive, site, nickname);

                            if (player != null && !isError)
                            {
                                if (isFirst == 0)
                                {
                                    PlayerManager.Update(name, newPwd);
                                }
                                else
                                {
                                    PlayerManager.Remove(name);
                                }
                                style         = string.IsNullOrEmpty(player.Style) ? ",,,,,,,," : player.Style;
                                player.Colors = string.IsNullOrEmpty(player.Colors) ? ",,,,,,,," : player.Colors;

                                XElement node = new XElement("Item",
                                                             new XAttribute("ID", player.ID),
                                                             new XAttribute("IsFirst", isFirst),
                                                             new XAttribute("NickName", player.NickName),
                                                             new XAttribute("Date", ""),
                                                             new XAttribute("IsConsortia", 0),
                                                             new XAttribute("ConsortiaID", player.ConsortiaID),
                                                             new XAttribute("Sex", player.Sex),
                                                             new XAttribute("WinCount", player.Win),
                                                             new XAttribute("TotalCount", player.Total),
                                                             new XAttribute("EscapeCount", player.Escape),
                                                             new XAttribute("DutyName", player.DutyName == null ? "" : player.DutyName),
                                                             new XAttribute("GP", player.GP),
                                                             new XAttribute("Honor", ""),
                                                             new XAttribute("Style", player.Style == null ? style : player.Style),
                                                             new XAttribute("Gold", player.Gold),
                                                             new XAttribute("Colors", player.Colors == null ? "" : player.Colors),
                                                             new XAttribute("Attack", player.Attack),
                                                             new XAttribute("Defence", player.Defence),
                                                             new XAttribute("Agility", player.Agility),
                                                             new XAttribute("Luck", player.Luck),
                                                             new XAttribute("Grade", player.Grade),
                                                             new XAttribute("Hide", player.Hide),
                                                             new XAttribute("Repute", player.Repute),
                                                             new XAttribute("ConsortiaName", player.ConsortiaName == null ? "" : player.ConsortiaName),
                                                             new XAttribute("Offer", player.Offer),
                                                             new XAttribute("Skin", player.Skin == null ? "" : player.Skin),
                                                             new XAttribute("ReputeOffer", player.ReputeOffer),
                                                             new XAttribute("ConsortiaHonor", player.ConsortiaHonor),
                                                             new XAttribute("ConsortiaLevel", player.ConsortiaLevel),
                                                             new XAttribute("ConsortiaRepute", player.ConsortiaRepute),
                                                             new XAttribute("Money", player.Money),
                                                             new XAttribute("AntiAddiction", player.AntiAddiction),
                                                             new XAttribute("IsMarried", player.IsMarried),
                                                             new XAttribute("SpouseID", player.SpouseID),
                                                             new XAttribute("SpouseName", player.SpouseName == null ? "" : player.SpouseName),
                                                             new XAttribute("MarryInfoID", player.MarryInfoID),
                                                             new XAttribute("IsCreatedMarryRoom", player.IsCreatedMarryRoom),
                                                             new XAttribute("IsGotRing", player.IsGotRing),
                                                             new XAttribute("LoginName", player.UserName == null ? "" : player.UserName),
                                                             new XAttribute("Nimbus", player.Nimbus),
                                                             new XAttribute("FightPower", player.FightPower),
                                                             new XAttribute("AnswerSite", player.AnswerSite),
                                                             new XAttribute("WeaklessGuildProgressStr", player.WeaklessGuildProgressStr == null ? "" : player.WeaklessGuildProgressStr),
                                                             new XAttribute("IsOldPlayer", player.IsOldPlayer));

                                result.Add(node);
                                value   = true;
                                message = LanguageMgr.GetTranslation("Tank.Request.Login.Success");;
                            }
                            else
                            {
                                PlayerManager.Remove(name);
                            }
                        }
                        else
                        {
                            message = LanguageMgr.GetTranslation("BaseInterface.LoginAndUpdate.Try");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error("User Login error", ex);
                value   = false;
                message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail2");
            }
            finally
            {
                result.Add(new XAttribute("value", value));
                result.Add(new XAttribute("message", message));
                context.Response.ContentType = "text/plain";
                context.Response.Write(result.ToString(false));
            }
        }
示例#6
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            try
            {
                GSPacketIn pkg = new GSPacketIn((byte)ePackageType.LOGIN);
                pkg.ClientID = packet.ClientID;
                if (client.Player == null)
                {
                    int    version    = packet.ReadInt();
                    int    clientType = packet.ReadInt();
                    byte[] src        = packet.ReadBytes();
                    //解密
                    try
                    {
                        src = WorldMgr.RsaCryptor.Decrypt(src, false);
                    }
                    catch (ExecutionEngineException e)
                    {
                        client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.RsaCryptorError"));
                        client.Disconnect();
                        GameServer.log.Error("ExecutionEngineException", e);
                        return(0);
                    }
                    catch (Exception ex)
                    {
                        //防止攻击,如果解密出错,直接断开连接
                        client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.RsaCryptorError"));
                        client.Disconnect();
                        GameServer.log.Error("RsaCryptor", ex);
                        return(0);
                    }
                    //DateTime date = new DateTime(src[0] * 256 + src[1], src[2], src[3], src[4], src[5], src[6]);
                    int fms_key = (src[7] << 8) + src[8];
                    client.SetFsm(fms_key, version);

                    //string edition = GameServer.Instance.Configuration.Edition;
                    string edition = GameServer.Edition;
                    //if (version.ToString() != edition && edition != "0")
                    //{
                    //    client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.EditionError"));
                    //    //client.Out.SendEditionError(LanguageMgr.GetTranslation("UserLoginHandler.EditionError"));
                    //    client.Disconnect();
                    //    return 0;
                    //}

                    string[] temp = Encoding.UTF8.GetString(src, 9, src.Length - 9).Split(',');
                    if (temp.Length == 2)
                    {
                        string user = temp[0];
                        string pass = temp[1];

                        //TimeSpan span = date - DateTime.UtcNow;
                        //if (Math.Abs(span.TotalMinutes) < 5)
                        //{
                        if (!LoginMgr.ContainsUser(user))
                        {
                            bool          isFirst = false;
                            BaseInterface inter   = BaseInterface.CreateInterface();
                            PlayerInfo    cha     = inter.LoginGame(user, pass, ref isFirst);

                            if (cha != null && cha.ID != 0)
                            {
                                if (cha.ID == -2)
                                {
                                    //帐号被禁用
                                    client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Forbid"));
                                    client.Disconnect();
                                    return(0);
                                }

                                if (!isFirst)
                                {
                                    client.Player = new GamePlayer(cha.ID, user, client, cha);
                                    LoginMgr.Add(cha.ID, client);
                                    client.Server.LoginServer.SendAllowUserLogin(cha.ID);
                                    client.Out.SendLoginSuccess2();
                                    client.Version = version;
                                }
                                else
                                {
                                    client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Register"));
                                    client.Disconnect();
                                }
                            }
                            else
                            {
                                //client.Out.SendLoginFailed("用户名密码错误");
                                client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.OverTime"));
                                client.Disconnect();
                            }
                        }
                        else
                        {
                            //避免攻击,有另外的客户端在登陆,则断掉次客户端。
                            client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.LoginError"));
                            client.Disconnect();
                        }
                    }
                    else
                    {
                        client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.LengthError"));
                        //验证格式错误,端口连接
                        client.Disconnect();
                    }
                }
            }
            catch (Exception ex)
            {
                client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.ServerError"));
                client.Disconnect();
                GameServer.log.Error(LanguageMgr.GetTranslation("UserLoginHandler.ServerError"), ex);
            }

            return(1);
        }
 public int HandlePacket(GameClient client, GSPacketIn packet)
 {
     try
     {
         if (client.Player == null)
         {
             int version = packet.ReadInt();
             packet.ReadInt();
             byte[] array  = new byte[8];
             byte[] array2 = packet.ReadBytes();
             try
             {
                 array2 = WorldMgr.RsaCryptor.Decrypt(array2, false);
             }
             catch (ExecutionEngineException exception)
             {
                 client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.RsaCryptorError", new object[0]));
                 client.Disconnect();
                 GameServer.log.Error("ExecutionEngineException", exception);
                 int result = 0;
                 return(result);
             }
             catch (Exception exception2)
             {
                 client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.RsaCryptorError", new object[0]));
                 client.Disconnect();
                 GameServer.log.Error("RsaCryptor", exception2);
                 int result = 0;
                 return(result);
             }
             string arg_B1_0 = GameServer.Edition;
             for (int i = 0; i < 8; i++)
             {
                 array[i] = array2[i + 7];
             }
             client.setKey(array);
             string[] array3 = Encoding.UTF8.GetString(array2, 15, array2.Length - 15).Split(new char[]
             {
                 ','
             });
             if (array3.Length == 2)
             {
                 string text = array3[0];
                 string pass = array3[1];
                 if (!LoginMgr.ContainsUser(text))
                 {
                     bool          flag          = false;
                     BaseInterface baseInterface = BaseInterface.CreateInterface();
                     PlayerInfo    playerInfo    = baseInterface.LoginGame(text, pass, ref flag);
                     if (playerInfo != null && playerInfo.ID != 0)
                     {
                         if (playerInfo.ID == -2)
                         {
                             client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Forbid", new object[0]));
                             client.Disconnect();
                             int result = 0;
                             return(result);
                         }
                         if (!flag)
                         {
                             client.Player = new GamePlayer(playerInfo.ID, text, client, playerInfo);
                             LoginMgr.Add(playerInfo.ID, client);
                             client.Server.LoginServer.SendAllowUserLogin(playerInfo.ID);
                             client.Version = version;
                         }
                         else
                         {
                             client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Register", new object[0]));
                             client.Disconnect();
                         }
                     }
                     else
                     {
                         client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.OverTime", new object[0]));
                         client.Disconnect();
                     }
                 }
                 else
                 {
                     client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.LoginError", new object[0]));
                     client.Disconnect();
                 }
             }
             else
             {
                 client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.LengthError", new object[0]));
                 client.Disconnect();
             }
         }
     }
     catch (Exception exception3)
     {
         client.Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.ServerError", new object[0]));
         client.Disconnect();
         GameServer.log.Error(LanguageMgr.GetTranslation("UserLoginHandler.ServerError", new object[0]), exception3);
     }
     return(1);
 }
示例#8
0
        public HttpResponse Process(Lsj.Util.Net.Web.HttpRequest request)
        {
            var      response = new HttpResponse();
            bool     value    = false;
            string   message  = LanguageMgr.GetTranslation("Tank.Request.Login.Fail1", new object[0]);
            bool     isError  = false;
            XElement result   = new XElement("Result");
            string   rsa      = "<RSAKeyValue><Modulus>zRSdzFcnZjOCxDMkWUbuRgiOZIQlk7frZMhElQ0a7VqZI9VgU3+lwo0ghZLU3Gg63kOY2UyJ5vFpQdwJUQydsF337ZAUJz4rwGRt/MNL70wm71nGfmdPv4ING+DyJ3ZxFawwE1zSMjMOqQtY4IV8his/HlgXuUfIHVDK87nMNLc=</Modulus><Exponent>AQAB</Exponent><P>7lzjJCmL0/unituEcjoJsZhUDYajgiiIwWwuh0NlCZElmfa5M6l8H+Ahd9yo7ruT6Hrwr4DAdrIKP6LDmFhBdw==</P><Q>3EFKHt4FcDiZXRBLqYZaNSmM1KDrrU97N3CtEDCYS4GimmFOGJhmuK3yGfp/nYLcL2BTKyOZLSQO+/nAjRp2wQ==</Q><DP>SFdkkGsThuiPdrMcxVYb7wxeJiTApxYKOznL/T1VAsxMbyfUGXvMshfh0HDlzF6diycUuQ8IWn26YonRdwECDQ==</DP><DQ>xR9x1NpkB6HAMHhLHzftODMtpYc4Jm5CGsYvPZQgWUN2YbDAkmajWJnlWbbFzBS4N3aAONWtW6cv+ff2itKqgQ==</DQ><InverseQ>oyJzP0Sn+NgdNRRc7/cUKkbbbYaNxkDLDvKLDYMKV6+gcDce85t/FGfaTwkuYQNFqkrRBtDYjtfGsPRTGS6Mow==</InverseQ><D>wM33JNtzUSRwdmDWdZC4BuOYa2vJoD0zc0bNI4x0ml2oyAWdUCMcBfKEds/6i1T6s2e91d2dcJ/aI27o22gO/sfNg3tsr7uYMiUuhSjniqBDB/zyUVig29E4qdfuY1GHxTE8zurroY8mgGEB0aLj+gE0yX9T7sDFkY0QYRqJnwE=</D></RSAKeyValue>";

            try
            {
                BaseInterface inter = BaseInterface.CreateInterface();
                string        p     = System.Web.HttpUtility.UrlDecode(request.QueryString["p"]);
                string        site  = (request.QueryString["site"] == null) ? "" : System.Web.HttpUtility.UrlDecode(request.QueryString["site"]);
                string        IP    = request.QueryString["IP"];
                if (!string.IsNullOrEmpty(p))
                {
                    byte[]   src     = RsaDecryt2(GetRSACrypto(rsa), p);
                    string[] strList = Encoding.UTF8.GetString(src, 7, src.Length - 7).Split(new char[]
                    {
                        ','
                    });
                    if (strList.Length == 4)
                    {
                        message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail100", new object[0]);
                        string name     = strList[0];
                        string pwd      = strList[1];
                        string newPwd   = strList[2];
                        string nickname = strList[3];
                        if (PlayerManager.Login(name, pwd))
                        {
                            message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail1000", new object[0]);
                            int        isFirst       = 0;
                            bool       isActive      = false;
                            bool       firstValidate = PlayerManager.GetByUserIsFirst(name);
                            PlayerInfo player        = inter.CreateLogin(name, newPwd, ref message, ref isFirst, IP, ref isError, firstValidate, ref isActive, site, nickname);
                            //message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail10", new object[0]);
                            if (player != null && !isError)
                            {
                                message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail10000", new object[0]);
                                if (isFirst == 0)
                                {
                                    PlayerManager.Update(name, newPwd);
                                }
                                else
                                {
                                    PlayerManager.Remove(name);
                                }
                                string style = string.IsNullOrEmpty(player.Style) ? ",,,,,,,," : player.Style;
                                player.Colors = (string.IsNullOrEmpty(player.Colors) ? ",,,,,,,," : player.Colors);
                                XElement node = new XElement("Item", new object[]
                                {
                                    new XAttribute("ID", player.ID),
                                    new XAttribute("IsFirst", isFirst),
                                    new XAttribute("NickName", player.NickName),
                                    new XAttribute("Date", ""),
                                    new XAttribute("IsConsortia", 0),
                                    new XAttribute("ConsortiaID", player.ConsortiaID),
                                    new XAttribute("Sex", player.Sex),
                                    new XAttribute("WinCount", player.Win),
                                    new XAttribute("TotalCount", player.Total),
                                    new XAttribute("EscapeCount", player.Escape),
                                    new XAttribute("DutyName", (player.DutyName == null) ? "" : player.DutyName),
                                    new XAttribute("GP", player.GP),
                                    new XAttribute("Honor", ""),
                                    new XAttribute("Style", style),
                                    new XAttribute("Gold", player.Gold),
                                    new XAttribute("Colors", (player.Colors == null) ? "" : player.Colors),
                                    new XAttribute("Attack", player.Attack),
                                    new XAttribute("Defence", player.Defence),
                                    new XAttribute("Agility", player.Agility),
                                    new XAttribute("Luck", player.Luck),
                                    new XAttribute("Grade", player.Grade),
                                    new XAttribute("Hide", player.Hide),
                                    new XAttribute("Repute", player.Repute),
                                    new XAttribute("ConsortiaName", (player.ConsortiaName == null) ? "" : player.ConsortiaName),
                                    new XAttribute("Offer", player.Offer),
                                    new XAttribute("Skin", (player.Skin == null) ? "" : player.Skin),
                                    new XAttribute("ReputeOffer", player.ReputeOffer),
                                    new XAttribute("ConsortiaHonor", player.ConsortiaHonor),
                                    new XAttribute("ConsortiaLevel", player.ConsortiaLevel),
                                    new XAttribute("ConsortiaRepute", player.ConsortiaRepute),
                                    new XAttribute("Money", player.Money),
                                    new XAttribute("AntiAddiction", player.AntiAddiction),
                                    new XAttribute("IsMarried", player.IsMarried),
                                    new XAttribute("SpouseID", player.SpouseID),
                                    new XAttribute("SpouseName", (player.SpouseName == null) ? "" : player.SpouseName),
                                    new XAttribute("MarryInfoID", player.MarryInfoID),
                                    new XAttribute("IsCreatedMarryRoom", player.IsCreatedMarryRoom),
                                    new XAttribute("IsGotRing", player.IsGotRing),
                                    new XAttribute("LoginName", (player.UserName == null) ? "" : player.UserName),
                                    new XAttribute("Nimbus", player.Nimbus),
                                    new XAttribute("FightPower", player.FightPower),
                                    new XAttribute("AnswerSite", player.AnswerSite),
                                    new XAttribute("VIPLevel", player.VipLevel),
                                    new XAttribute("ChargedMoney", player.ChargedMoney)
                                });
                                result.Add(node);
                                value   = true;
                                message = LanguageMgr.GetTranslation("Tank.Request.Login.Success", new object[0]);
                            }
                            else
                            {
                                PlayerManager.Remove(name);
                            }
                        }
                        else
                        {
                            message = LanguageMgr.GetTranslation("登录已失效,请重新登录", new object[0]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LoginCheck.log.Error("User Login error", ex);
                value   = false;
                message = LanguageMgr.GetTranslation("Tank.Request.Login.Fail", new object[0]);
            }
            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));
            response.ContentType = "text/plain";
            response.Write(result.ToString(false));


            return(response);
        }