Example #1
0
 public static XElement CreateConsortiaIMInfo(ConsortiaUserInfo info)
 {
     return(new XElement("Item", new object[]
     {
         new XAttribute("ID", info.ID),
         new XAttribute("ConsortiaID", info.ConsortiaID),
         new XAttribute("DutyID", info.DutyID),
         new XAttribute("DutyName", (info.DutyName == null) ? "" : info.DutyName),
         new XAttribute("GP", info.GP),
         new XAttribute("Grade", info.Grade),
         new XAttribute("Level", info.Level),
         new XAttribute("Offer", info.Offer),
         new XAttribute("Remark", (info.Remark == null) ? "" : info.Remark),
         new XAttribute("Repute", info.Repute),
         new XAttribute("State", (info.State == 1) ? 1 : 0),
         new XAttribute("UserID", info.UserID),
         new XAttribute("Hide", info.Hide),
         new XAttribute("Colors", (info.Colors == null) ? "" : info.Colors),
         new XAttribute("Skin", (info.Skin == null) ? "" : info.Skin),
         new XAttribute("Style", info.Style),
         new XAttribute("LastDate", info.LastDate.ToString("yyyy-MM-dd HH:mm:ss")),
         new XAttribute("Sex", info.Sex),
         new XAttribute("LoginName", info.LoginName),
         new XAttribute("NickName", (info.UserName == null) ? "" : info.UserName)
     }));
 }
Example #2
0
        public void SendConsortiaUserPass(int playerid, string playerName, ConsortiaUserInfo info, bool isInvite, int consortiaRepute, string loginName, int fightpower)
        {
            GSPacketIn pkg = new GSPacketIn((byte)eChatServerPacket.CONSORTIA_RESPONSE, playerid);

            pkg.WriteByte(1);
            pkg.WriteInt(info.ID);
            pkg.WriteBoolean(isInvite);
            pkg.WriteInt(info.ConsortiaID);
            pkg.WriteString(info.ConsortiaName);
            pkg.WriteInt(info.UserID);
            pkg.WriteString(info.UserName);
            pkg.WriteInt(playerid);
            pkg.WriteString(playerName);
            pkg.WriteInt(info.DutyID);
            pkg.WriteString(info.DutyName);
            pkg.WriteInt(info.Offer);
            pkg.WriteInt(info.RichesOffer);
            pkg.WriteInt(info.RichesRob);
            pkg.WriteDateTime(info.LastDate);
            pkg.WriteInt(info.Grade);
            pkg.WriteInt(info.Level);
            pkg.WriteInt(info.State);
            pkg.WriteBoolean(info.Sex);
            pkg.WriteInt(info.Right);
            pkg.WriteInt(info.Win);
            pkg.WriteInt(info.Total);
            pkg.WriteInt(info.Escape);
            pkg.WriteInt(consortiaRepute);
            pkg.WriteString(loginName);
            pkg.WriteInt(fightpower);
            pkg.WriteInt(500);
            //New
            pkg.WriteString("Honor");
            SendTCP(pkg);
        }
Example #3
0
        public void SendConsortiaUserPass(int playerid, string playerName, ConsortiaUserInfo info, bool isInvite, int consortiaRepute, string loginName, int fightpower, int achievementpoint, string honor)
        {
            GSPacketIn pkg = new GSPacketIn(128, playerid);

            pkg.WriteByte(1);
            pkg.WriteInt(info.ID);
            pkg.WriteBoolean(isInvite);
            pkg.WriteInt(info.ConsortiaID);
            pkg.WriteString(info.ConsortiaName);
            pkg.WriteInt(info.UserID);
            pkg.WriteString(info.UserName);
            pkg.WriteInt(playerid);
            pkg.WriteString(playerName);
            pkg.WriteInt(info.DutyID);
            pkg.WriteString(info.DutyName);
            pkg.WriteInt(info.Offer);
            pkg.WriteInt(info.RichesOffer);
            pkg.WriteInt(info.RichesRob);
            pkg.WriteDateTime(info.LastDate);
            pkg.WriteInt(info.Grade);
            pkg.WriteInt(info.Level);
            pkg.WriteInt(info.State);
            pkg.WriteBoolean(info.Sex);
            pkg.WriteInt(info.Right);
            pkg.WriteInt(info.Win);
            pkg.WriteInt(info.Total);
            pkg.WriteInt(info.Escape);
            pkg.WriteInt(consortiaRepute);
            pkg.WriteString(loginName);
            pkg.WriteInt(fightpower);
            pkg.WriteInt(achievementpoint);
            pkg.WriteString(honor);

            this.SendTCP(pkg);
        }
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.ConsortiaID == 0)
            {
                return(0);
            }

            int    id     = packet.ReadInt();
            bool   result = false;
            string msg    = "ConsortiaApplyLoginPassHandler.Failed";

            using (ConsortiaBussiness db = new ConsortiaBussiness())
            {
                int consortiaRepute    = 0;
                ConsortiaUserInfo info = new ConsortiaUserInfo();
                if (db.PassConsortiaApplyUsers(id, client.Player.PlayerCharacter.ID, client.Player.PlayerCharacter.NickName, client.Player.PlayerCharacter.ConsortiaID, ref msg, info, ref consortiaRepute))
                {
                    msg    = "ConsortiaApplyLoginPassHandler.Success";
                    result = true;
                    if (info.UserID != 0)
                    {
                        info.ConsortiaID   = client.Player.PlayerCharacter.ConsortiaID;
                        info.ConsortiaName = client.Player.PlayerCharacter.ConsortiaName;
                        GameServer.Instance.LoginServer.SendConsortiaUserPass(client.Player.PlayerCharacter.ID, client.Player.PlayerCharacter.NickName, info, false, consortiaRepute, info.LoginName, client.Player.PlayerCharacter.FightPower);
                    }
                }
            }

            packet.WriteBoolean(result);
            packet.WriteString(LanguageMgr.GetTranslation(msg));
            client.Out.SendTCP(packet);

            return(0);
        }
Example #5
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result2;

            if (player.PlayerCharacter.ConsortiaID != 0)
            {
                result2 = 0;
            }
            else
            {
                int    id            = packet.ReadInt();
                bool   result        = false;
                int    consortiaID   = 0;
                string consortiaName = "";
                string msg           = "ConsortiaInvitePassHandler.Failed";
                int    tempID        = 0;
                string tempName      = "";
                using (ConsortiaBussiness db = new ConsortiaBussiness())
                {
                    int consortiaRepute    = 0;
                    ConsortiaUserInfo info = new ConsortiaUserInfo();
                    if (db.PassConsortiaInviteUsers(id, player.PlayerCharacter.ID, player.PlayerCharacter.NickName, ref consortiaID, ref consortiaName, ref msg, info, ref tempID, ref tempName, ref consortiaRepute))
                    {
                        player.PlayerCharacter.ConsortiaID   = consortiaID;
                        player.PlayerCharacter.ConsortiaName = consortiaName;
                        player.PlayerCharacter.DutyLevel     = info.Level;
                        player.PlayerCharacter.DutyName      = info.DutyName;
                        player.PlayerCharacter.Right         = info.Right;
                        ConsortiaInfo consotia = ConsortiaMgr.FindConsortiaInfo(consortiaID);
                        if (consotia != null)
                        {
                            player.PlayerCharacter.ConsortiaLevel = consotia.Level;
                        }
                        msg                = "ConsortiaInvitePassHandler.Success";
                        result             = true;
                        info.UserID        = player.PlayerCharacter.ID;
                        info.UserName      = player.PlayerCharacter.NickName;
                        info.Grade         = player.PlayerCharacter.Grade;
                        info.Offer         = player.PlayerCharacter.Offer;
                        info.RichesOffer   = player.PlayerCharacter.RichesOffer;
                        info.RichesRob     = player.PlayerCharacter.RichesRob;
                        info.Win           = player.PlayerCharacter.Win;
                        info.Total         = player.PlayerCharacter.Total;
                        info.Escape        = player.PlayerCharacter.Escape;
                        info.ConsortiaID   = consortiaID;
                        info.ConsortiaName = consortiaName;
                        GameServer.Instance.LoginServer.SendConsortiaUserPass(tempID, tempName, info, true, consortiaRepute, player.PlayerCharacter.UserName, player.PlayerCharacter.FightPower, player.PlayerCharacter.AchievementPoint, player.PlayerCharacter.Honor);
                    }
                }
                packet.WriteBoolean(result);
                packet.WriteInt(consortiaID);
                packet.WriteString(consortiaName);
                packet.WriteString(LanguageMgr.GetTranslation(msg, new object[0]));
                player.Out.SendTCP(packet);
                result2 = 0;
            }
            return(result2);
        }
Example #6
0
        public static XElement CreateConsortiaUserInfo(ConsortiaUserInfo info)
        {
            return(new XElement("Item", new XAttribute("ID", info.ID),
                                new XAttribute("ConsortiaID", info.ConsortiaID),
                                new XAttribute("DutyID", info.DutyID),
                                new XAttribute("DutyName", info.DutyName == null ? "" : info.DutyName),
                                new XAttribute("GP", info.GP),
                                new XAttribute("Level", info.Level),
                                new XAttribute("Grade", info.Grade),
                                new XAttribute("Right", info.Right),
                                new XAttribute("DutyLevel", info.Level),
                                new XAttribute("Offer", info.Offer),
                                new XAttribute("RatifierID", info.RatifierID),
                                new XAttribute("RatifierName", info.RatifierName == null ? "" : info.RatifierName),
                                new XAttribute("Remark", info.Remark == null ? "" : info.Remark),
                                new XAttribute("Repute", info.Repute),
                                new XAttribute("State", info.State == 1 ? 1 : 0),
                                new XAttribute("UserID", info.UserID),
                                new XAttribute("Hide", info.Hide),
                                new XAttribute("Colors", info.Colors == null ? "" : info.Colors),
                                new XAttribute("Skin", info.Skin == null ? "" : info.Skin),
                                new XAttribute("Style", info.Style),
                                new XAttribute("LastDate", info.LastDate.ToString("yyyy-MM-dd HH:mm:ss")),
                                new XAttribute("Sex", info.Sex),
                                new XAttribute("IsBanChat", info.IsBanChat),
                                new XAttribute("WinCount", info.Win),
                                new XAttribute("TotalCount", info.Total),
                                new XAttribute("EscapeCount", info.Escape),
                                new XAttribute("RichesOffer", info.RichesOffer),
                                new XAttribute("RichesRob", info.RichesRob),
                                new XAttribute("Nimbus", info.Nimbus),
                                new XAttribute("LoginName", info.LoginName == null ? "" : info.LoginName),
                                new XAttribute("UserName", info.UserName == null ? "" : info.UserName),
                                new XAttribute("FightPower", info.FightPower),
                                new XAttribute("Rank", "honor"),
                                new XAttribute("AchievementPoint", 1),
                                new XAttribute("IsDiplomatism", true),
                                new XAttribute("IsDownGrade", true),
                                new XAttribute("IsEditorPlacard", true),
                                new XAttribute("IsEditorDescription", true),
                                new XAttribute("IsExpel", true),
                                new XAttribute("IsEditorUser", true),
                                new XAttribute("IsInvite", false),
                                new XAttribute("IsManageDuty", true),
                                new XAttribute("IsUpGrade", false),
                                new XAttribute("IsVIP", true),
                                new XAttribute("VIPLevel", 5),
                                new XAttribute("IsRatify", true),
                                new XAttribute("IsChat", true)



                                ));
        }
        public static void Process(IHttpRequest Request, IHttpResponse Response)
        {
            bool     value   = false;
            string   message = "Fail!";
            XElement result  = new XElement("Result");
            int      total   = 0;

            try
            {
                int page        = int.Parse(Request.Uri.QueryString["page"]);
                int size        = int.Parse(Request.Uri.QueryString["size"]);
                int order       = int.Parse(Request.Uri.QueryString["order"]);
                int consortiaID = int.Parse(Request.Uri.QueryString["consortiaID"]);
                int userID      = int.Parse(Request.Uri.QueryString["userID"]);
                int state       = int.Parse(Request.Uri.QueryString["state"]);
                using (ConsortiaBussiness db = new ConsortiaBussiness())
                {
                    ConsortiaUserInfo[] infos = db.GetConsortiaUsersPage(page, size, ref total, order, consortiaID, userID, state);
                    ConsortiaUserInfo[] array = infos;
                    for (int i = 0; i < array.Length; i++)
                    {
                        ConsortiaUserInfo info = array[i];
                        result.Add(FlashUtils.CreateConsortiaUserInfo(info));
                    }
                    value   = true;
                    message = "Success!";
                }
            }
            catch (Exception ex)
            {
            }
            result.Add(new XAttribute("total", total));
            result.Add(new XAttribute("vaule", value));
            result.Add(new XAttribute("message", message));
            result.Add(new XAttribute("currentDate", DateTime.Now.ToString()));
            Response.Write(result.ToString(false));
        }
Example #8
0
 public static XElement CreateConsortiaUserInfo(ConsortiaUserInfo info)
 {
     return(new XElement("Item", new object[]
     {
         new XAttribute("ID", info.ID),
         new XAttribute("ConsortiaID", info.ConsortiaID),
         new XAttribute("DutyID", info.DutyID),
         new XAttribute("DutyName", (info.DutyName == null) ? "" : info.DutyName),
         new XAttribute("GP", info.GP),
         new XAttribute("Grade", info.Grade),
         new XAttribute("Right", info.Right),
         new XAttribute("DutyLevel", info.Level),
         new XAttribute("Offer", info.Offer),
         new XAttribute("RatifierID", info.RatifierID),
         new XAttribute("RatifierName", (info.RatifierName == null) ? "" : info.RatifierName),
         new XAttribute("Remark", (info.Remark == null) ? "" : info.Remark),
         new XAttribute("Repute", info.Repute),
         new XAttribute("State", (info.State == 1) ? 1 : 0),
         new XAttribute("UserID", info.UserID),
         new XAttribute("Hide", info.Hide),
         new XAttribute("Colors", (info.Colors == null) ? "" : info.Colors),
         new XAttribute("Skin", (info.Skin == null) ? "" : info.Skin),
         new XAttribute("Style", info.Style),
         new XAttribute("LastDate", info.LastDate.ToString("yyyy-MM-dd HH:mm:ss")),
         new XAttribute("Sex", info.Sex),
         new XAttribute("IsBanChat", info.IsBanChat),
         new XAttribute("WinCount", info.Win),
         new XAttribute("TotalCount", info.Total),
         new XAttribute("EscapeCount", info.Escape),
         new XAttribute("RichesOffer", info.RichesOffer),
         new XAttribute("RichesRob", info.RichesRob),
         new XAttribute("Nimbus", info.Nimbus),
         new XAttribute("LoginName", (info.LoginName == null) ? "" : info.LoginName),
         new XAttribute("UserName", (info.UserName == null) ? "" : info.UserName),
         new XAttribute("FightPower", info.FightPower)
     }));
 }
Example #9
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result2;

            if (player.PlayerCharacter.ConsortiaID == 0)
            {
                result2 = 0;
            }
            else
            {
                int    id     = packet.ReadInt();
                bool   result = false;
                string msg    = "ConsortiaApplyLoginPassHandler.Failed";
                using (ConsortiaBussiness db = new ConsortiaBussiness())
                {
                    int consortiaRepute    = 0;
                    ConsortiaUserInfo info = new ConsortiaUserInfo();
                    if (db.PassConsortiaApplyUsers(id, player.PlayerCharacter.ID, player.PlayerCharacter.NickName, player.PlayerCharacter.ConsortiaID, ref msg, info, ref consortiaRepute))
                    {
                        msg    = "ConsortiaApplyLoginPassHandler.Success";
                        result = true;
                        if (info.UserID != 0)
                        {
                            info.ConsortiaID   = player.PlayerCharacter.ConsortiaID;
                            info.ConsortiaName = player.PlayerCharacter.ConsortiaName;
                            GameServer.Instance.LoginServer.SendConsortiaUserPass(player.PlayerCharacter.ID, player.PlayerCharacter.NickName, info, false, consortiaRepute, info.LoginName, info.FightPower, player.PlayerCharacter.AchievementPoint, player.PlayerCharacter.Honor);
                        }
                    }
                }
                packet.WriteBoolean(result);
                packet.WriteString(LanguageMgr.GetTranslation(msg, new object[0]));
                player.Out.SendTCP(packet);
                result2 = 0;
            }
            return(result2);
        }