示例#1
0
        public void HandleGameRoomCreate(GSPacketIn pkg)
        {
            int roomId = pkg.ReadInt();
            int gameType = pkg.ReadInt();
            int count = pkg.ReadInt();

            IGamePlayer[] players = new IGamePlayer[count];
            for (int i = 0; i < count; i++)
            {
                PlayerInfo info = new PlayerInfo();
                info.ID = pkg.ReadInt();
                info.Attack = pkg.ReadInt();
                info.Defence = pkg.ReadInt();
                info.Agility = pkg.ReadInt();
                info.Luck = pkg.ReadInt();

                double baseAttack = pkg.ReadDouble();
                double baseDefence = pkg.ReadDouble();
                double baseAgility = pkg.ReadDouble();
                double baseBlood = pkg.ReadDouble();
                int templateId = pkg.ReadInt();

                ItemTemplateInfo itemTemplate = ItemMgr.FindItemTemplate(templateId);
                ItemInfo item = new ItemInfo(itemTemplate);

                players[i] = new ProxyPlayer(info, item, baseAttack, baseDefence, baseAgility, baseBlood);
            }

            ProxyRoomMgr.CreateRoom(players, roomId, this);
        }
示例#2
0
        public bool ActivePlayer(ref PlayerInfo player, string userName, string passWord, bool sex, int gold, int money, string IP, string site)
        {
            bool result = false;
            try
            {
                player = new PlayerInfo();
                player.Agility = 0;
                player.Attack = 0;
                player.Colors = ",,,,,,";
                player.Skin = "";
                player.ConsortiaID = 0;
                player.Defence = 0;
                player.Gold = gold;
                player.GP = 1;
                player.Grade = 1;
                player.ID = 0;
                player.Luck = 0;
                player.Money = money;
                player.NickName = "";
                player.Sex = sex;
                player.State = 0;
                player.Style = ",,,,,,";
                player.Hide = 1111111111;
                //isFirst = true;

                SqlParameter[] para = new SqlParameter[21];
                para[0] = new SqlParameter("@UserID", System.Data.SqlDbType.Int);
                para[0].Direction = ParameterDirection.Output;
                para[1] = new SqlParameter("@Attack", player.Attack);
                para[2] = new SqlParameter("@Colors", player.Colors == null ? "" : player.Colors);
                para[3] = new SqlParameter("@ConsortiaID", player.ConsortiaID);
                para[4] = new SqlParameter("@Defence", player.Defence);
                para[5] = new SqlParameter("@Gold", player.Gold);
                para[6] = new SqlParameter("@GP", player.GP);
                para[7] = new SqlParameter("@Grade", player.Grade);
                para[8] = new SqlParameter("@Luck", player.Luck);
                para[9] = new SqlParameter("@Money", player.Money);
                para[10] = new SqlParameter("@Style", player.Style == null ? "" : player.Style);
                para[11] = new SqlParameter("@Agility", player.Agility);
                para[12] = new SqlParameter("@State", player.State);
                para[13] = new SqlParameter("@UserName", userName);
                para[14] = new SqlParameter("@PassWord", passWord);
                para[15] = new SqlParameter("@Sex", sex);
                para[16] = new SqlParameter("@Hide", player.Hide);
                para[17] = new SqlParameter("@ActiveIP", IP);
                para[18] = new SqlParameter("@Skin", player.Skin == null ? "" : player.Skin);
                para[19] = new SqlParameter("@Result", System.Data.SqlDbType.Int);
                para[19].Direction = ParameterDirection.ReturnValue;
                para[20] = new SqlParameter("@Site", site);
                result = db.RunProcedure("SP_Users_Active", para);
                player.ID = (int)para[0].Value;
                result = (int)para[19].Value == 0;
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("Init", e);
            }
            return result;
        }
示例#3
0
        public GamePlayer(int playerId, string account, GameClient client, PlayerInfo info)
            : base()
        {
            m_playerId = playerId;
            m_account = account;
            m_client = client;
            m_character = info;
            LastChatTime = DateTime.Today;
            m_mainBag = new PlayerEquipInventory(this);
            m_propBag = new PlayerInventory(this, true, 49, 1, 0, true);
            m_storeBag = new PlayerInventory(this, true, 100, 11, 0, true);
            m_storeBag2 = new PlayerInventory(this, true, 20, 12, 0, true);
            m_fightBag = new PlayerInventory(this, false, 3, 3, 0, false);
            m_tempBag = new PlayerInventory(this, false, 60, 4, 0, true);
            m_caddyBag = new PlayerInventory(this, false, 20, 5, 0, true);
            m_cardBag = new PlayerInventory(this, true, 20, 15, 0, true);
            m_questInventory = new QuestInventory(this);
            m_bufferList = new BufferList(this);
            m_equipEffect = new List<int>();

            //双倍经验卡初始化
            GPAddPlus = 1;

            X = 646;
            Y = 1241;
            MarryMap = 0;
            m_converter = new System.Text.UTF8Encoding();
        }
示例#4
0
 public bool ActivePlayer(ref PlayerInfo player, string userName, string passWord, bool sex, int gold, int money, string IP, string site)
 {
     bool flag = false;
     try
     {
         player = new PlayerInfo();
         player.Agility = 0;
         player.Attack = 0;
         player.Colors = ",,,,,,";
         player.Skin = "";
         player.ConsortiaID = 0;
         player.Defence = 0;
         player.Gold = 0;
         player.GP = 1;
         player.Grade = 1;
         player.ID = 0;
         player.Luck = 0;
         player.Money = 0;
         player.NickName = "";
         player.Sex = sex;
         player.State = 0;
         player.Style = ",,,,,,";
         player.Hide = 1111111111;
         SqlParameter[] SqlParameters = new SqlParameter[21];
         SqlParameters[0] = new SqlParameter("@UserID", SqlDbType.Int);
         SqlParameters[0].Direction = ParameterDirection.Output;
         SqlParameters[1] = new SqlParameter("@Attack", (object)player.Attack);
         SqlParameters[2] = new SqlParameter("@Colors", player.Colors == null ? (object)"" : (object)player.Colors);
         SqlParameters[3] = new SqlParameter("@ConsortiaID", (object)player.ConsortiaID);
         SqlParameters[4] = new SqlParameter("@Defence", (object)player.Defence);
         SqlParameters[5] = new SqlParameter("@Gold", (object)player.Gold);
         SqlParameters[6] = new SqlParameter("@GP", (object)player.GP);
         SqlParameters[7] = new SqlParameter("@Grade", (object)player.Grade);
         SqlParameters[8] = new SqlParameter("@Luck", (object)player.Luck);
         SqlParameters[9] = new SqlParameter("@Money", (object)player.Money);
         SqlParameters[10] = new SqlParameter("@Style", player.Style == null ? (object)"" : (object)player.Style);
         SqlParameters[11] = new SqlParameter("@Agility", (object)player.Agility);
         SqlParameters[12] = new SqlParameter("@State", (object)player.State);
         SqlParameters[13] = new SqlParameter("@UserName", (object)userName);
         SqlParameters[14] = new SqlParameter("@PassWord", (object)passWord);
         SqlParameters[15] = new SqlParameter("@Sex", (object)(int)(sex ? 1 : 0));
         SqlParameters[16] = new SqlParameter("@Hide", (object)player.Hide);
         SqlParameters[17] = new SqlParameter("@ActiveIP", (object)IP);
         SqlParameters[18] = new SqlParameter("@Skin", player.Skin == null ? (object)"" : (object)player.Skin);
         SqlParameters[19] = new SqlParameter("@Result", SqlDbType.Int);
         SqlParameters[19].Direction = ParameterDirection.ReturnValue;
         SqlParameters[20] = new SqlParameter("@Site", (object)site);
         flag = this.db.RunProcedure("SP_Users_Active", SqlParameters);
         player.ID = (int)SqlParameters[0].Value;
         flag = (int)SqlParameters[19].Value == 0;
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"Init", ex);
     }
     return flag;
 }
示例#5
0
 public ProxyPlayer(ServerClient client, PlayerInfo character, ItemTemplateInfo currentWeapon, ItemInfo secondweapon, double baseAttack, double baseDefence, double baseAglilty, double baseBoold, double gprate, double offerrate, double rate, List<BufferInfo> infos, int serverid)
 {
     m_client = client;
     m_character = character;
     m_baseAttack = baseAttack;
     m_baseDefence = baseDefence;
     m_baseAglilty = baseAglilty;
     m_baseBlood = baseBoold;
     m_currentWeapon = currentWeapon;
     m_secondWeapon = secondweapon;
     m_equipEffect = new List<int>();
     GPRate = gprate;
     OfferRate = offerrate;
     Rate = rate;
     Buffers = infos;
     m_serverid = serverid;
 }
        public void SendSYSMessages(GamePlayer player, PlayerInfo spouse)
        {
            string name1 = player.PlayerCharacter.Sex ? player.PlayerCharacter.NickName : spouse.NickName;
            string name2 = player.PlayerCharacter.Sex ? spouse.NickName : player.PlayerCharacter.NickName;

            string msg = LanguageMgr.GetTranslation("MarryApplyReplyHandler.Msg1", name1, name2);

            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.SYS_NOTICE);
            pkg.WriteInt(2);
            pkg.WriteString(msg);

            GameServer.Instance.LoginServer.SendPacket(pkg);

            GamePlayer[] players = Game.Server.Managers.WorldMgr.GetAllPlayers();

            foreach (GamePlayer p in players)
            {
                p.Out.SendTCP(pkg);
            }
        }
示例#7
0
        public bool UpdatePlayer(PlayerInfo player)
        {
            bool result = false;
            try
            {
                if (player.Grade < 1)
                    return result;

                SqlParameter[] para = new SqlParameter[35];
                para[0] = new SqlParameter("@UserID", player.ID);
                para[1] = new SqlParameter("@Attack", player.Attack);
                para[2] = new SqlParameter("@Colors", player.Colors == null ? "" : player.Colors);
                para[3] = new SqlParameter("@ConsortiaID", player.ConsortiaID);
                para[4] = new SqlParameter("@Defence", player.Defence);
                para[5] = new SqlParameter("@Gold", player.Gold);
                para[6] = new SqlParameter("@GP", player.GP);
                para[7] = new SqlParameter("@Grade", player.Grade);
                para[8] = new SqlParameter("@Luck", player.Luck);
                para[9] = new SqlParameter("@Money", player.Money);
                para[10] = new SqlParameter("@Style", player.Style == null ? "" : player.Style);
                para[11] = new SqlParameter("@Agility", player.Agility);
                para[12] = new SqlParameter("@State", player.State);
                para[13] = new SqlParameter("@Hide", player.Hide);
                para[14] = new SqlParameter("@ExpendDate", player.ExpendDate == null ? "" : player.ExpendDate.ToString());
                para[15] = new SqlParameter("@Win", player.Win);
                para[16] = new SqlParameter("@Total", player.Total);
                para[17] = new SqlParameter("@Escape", player.Escape);
                para[18] = new SqlParameter("@Skin", player.Skin == null ? "" : player.Skin);
                para[19] = new SqlParameter("@Offer", player.Offer);
                para[20] = new SqlParameter("@AntiAddiction", player.AntiAddiction);
                para[20].Direction = ParameterDirection.InputOutput;
                para[21] = new SqlParameter("@Result", System.Data.SqlDbType.Int);
                para[21].Direction = ParameterDirection.ReturnValue;
                para[22] = new SqlParameter("@RichesOffer", player.RichesOffer);
                para[23] = new SqlParameter("@RichesRob", player.RichesRob);
                para[24] = new SqlParameter("@CheckCount", player.CheckCount);
                para[24].Direction = ParameterDirection.InputOutput;
                para[25] = new SqlParameter("@MarryInfoID", player.MarryInfoID);
                para[26] = new SqlParameter("@DayLoginCount", player.DayLoginCount);
                para[27] = new SqlParameter("@Nimbus", player.Nimbus);
                para[28] = new SqlParameter("@LastAward", player.LastAward);
                para[29] = new SqlParameter("@GiftToken", player.GiftToken);
                para[30] = new SqlParameter("@QuestSite", player.QuestSite);
                para[31] = new SqlParameter("@PvePermission", player.PvePermission);
                para[32] = new SqlParameter("@FightPower", player.FightPower);
                para[33] = new SqlParameter("@AnswerSite", player.AnswerSite);
                
                para[34] = new SqlParameter("@LastAuncherAward", player.LastAward);
                //para[34].Direction = ParameterDirection.Output;
                db.RunProcedure("SP_Users_Update", para);
	           
                result = (int)para[21].Value == 0;
                //TrieuLSL
                //result = true;
                if (result)
                {
                    player.AntiAddiction = (int)para[20].Value;
                    player.CheckCount = (int)para[24].Value;
                }
                player.IsDirty = false;
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("Init", e);
            }
            return result;
        }
        public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items)
        {

            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240);

            pkg.WriteInt(player.ID);
            pkg.WriteInt(player.Agility);
            pkg.WriteInt(player.Attack);
            pkg.WriteString(player.Colors);
            pkg.WriteString(player.Skin);
            pkg.WriteInt(player.Defence);
            pkg.WriteInt(player.GP);
            pkg.WriteInt(player.Grade);
            pkg.WriteInt(player.Luck);
            pkg.WriteInt(player.Hide);
            pkg.WriteInt(player.Repute);
            pkg.WriteBoolean(player.Sex);
            pkg.WriteString(player.Style);
            pkg.WriteInt(player.Offer);
            pkg.WriteString(player.NickName);
            pkg.WriteBoolean(true);
            pkg.WriteInt(5);
            pkg.WriteInt(player.Win);
            pkg.WriteInt(player.Total);
            pkg.WriteInt(player.Escape);
            pkg.WriteInt(player.ConsortiaID);
            pkg.WriteString(player.ConsortiaName);
            pkg.WriteInt(player.RichesOffer);
            pkg.WriteInt(player.RichesRob);
            pkg.WriteBoolean(player.IsMarried);
            pkg.WriteInt(player.SpouseID);
            pkg.WriteString(player.SpouseName);
            pkg.WriteString(player.DutyName);
            pkg.WriteInt(player.Nimbus);
            pkg.WriteInt(player.FightPower);

            pkg.WriteInt(5);
            pkg.WriteInt(-1);
            pkg.WriteString("Master");
            pkg.WriteInt(5);
            pkg.WriteString("HoNorMaster");
            //AchievementPoint
            pkg.WriteInt(9999);
            pkg.WriteString("Honor");
            pkg.WriteDateTime(DateTime.Now.AddDays(-2));
            pkg.WriteInt(items.Count);
            foreach (ItemInfo info in items)
            {
                pkg.WriteByte((byte)info.BagType);
                pkg.WriteInt(info.UserID);
                pkg.WriteInt(info.ItemID);
                pkg.WriteInt(info.Count);
                pkg.WriteInt(info.Place);
                pkg.WriteInt(info.TemplateID);
                pkg.WriteInt(info.AttackCompose);
                pkg.WriteInt(info.DefendCompose);
                pkg.WriteInt(info.AgilityCompose);
                pkg.WriteInt(info.LuckCompose);
                pkg.WriteInt(info.StrengthenLevel);
                pkg.WriteBoolean(info.IsBinds);
                pkg.WriteBoolean(info.IsJudge);
                pkg.WriteDateTime(info.BeginDate);
                pkg.WriteInt(info.ValidDate);
                pkg.WriteString(info.Color);
                pkg.WriteString(info.Skin);
                pkg.WriteBoolean(info.IsUsed);
                pkg.WriteInt(info.Hole1);
                pkg.WriteInt(info.Hole2);
                pkg.WriteInt(info.Hole3);
                pkg.WriteInt(info.Hole4);
                pkg.WriteInt(info.Hole5);
                pkg.WriteInt(info.Hole6);
                pkg.WriteString(info.Template.Pic);
                pkg.WriteInt(info.Template.RefineryLevel);
                pkg.WriteDateTime(DateTime.Now);

                pkg.WriteByte(5);
                pkg.WriteInt(5);
                pkg.WriteByte(5);
                pkg.WriteInt(5);

                //item.Hole5Level = pkg.readByte();
                //item.Hole5Exp = pkg.readInt();
                //item.Hole6Level = pkg.readByte();
                //item.Hole6Exp = pkg.readInt();
            }
            pkg.Compress();
            SendTCP(pkg);
            return pkg;
        }
        public void SendUpdatePrivateInfo(PlayerInfo info)
        {
            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.UPDATE_PRIVATE_INFO, info.ID);

            pkg.WriteInt(info.Money);
            //Medal
            pkg.WriteInt(1);
            pkg.WriteInt(info.Gold);
            pkg.WriteInt(info.GiftToken);
            SendTCP(pkg);
        }
示例#10
0
 public bool UpdateVIPInfo(PlayerInfo p)
 {
     bool flag = false;
     try
     {
         SqlParameter[] SqlParameters = new SqlParameter[10]
     {
       new SqlParameter("@ID", (object) p.ID),
       new SqlParameter("@VIPLevel", (object) p.VIPLevel),
       new SqlParameter("@VIPExp", (object) p.VIPExp),
       new SqlParameter("@VIPOnlineDays", SqlDbType.BigInt),
       new SqlParameter("@VIPOfflineDays", SqlDbType.BigInt),
       new SqlParameter("@VIPExpireDay", (object) p.VIPExpireDay.ToString()),
       new SqlParameter("@VIPLastDate", (object) DateTime.Now),
       new SqlParameter("@VIPNextLevelDaysNeeded", SqlDbType.BigInt),
       new SqlParameter("@CanTakeVipReward", (object) (int) (p.CanTakeVipReward ? 1 : 0)),
       new SqlParameter("@Result", SqlDbType.Int)
     };
         SqlParameters[9].Direction = ParameterDirection.ReturnValue;
         this.db.RunProcedure("SP_UpdateVIPInfo", SqlParameters);
         flag = true;
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"SP_UpdateVIPInfo", ex);
     }
     return flag;
 }
示例#11
0
 public bool UpdatePlayer(PlayerInfo player)
 {
     bool flag = false;
     try
     {
         if (player.Grade < 1)
             return flag;
         SqlParameter[] SqlParameters = new SqlParameter[81];
         SqlParameters[0] = new SqlParameter("@UserID", (object)player.ID);
         SqlParameters[1] = new SqlParameter("@Attack", (object)player.Attack);
         SqlParameters[2] = new SqlParameter("@Colors", player.Colors == null ? (object)"" : (object)player.Colors);
         SqlParameters[3] = new SqlParameter("@ConsortiaID", (object)player.ConsortiaID);
         SqlParameters[4] = new SqlParameter("@Defence", (object)player.Defence);
         SqlParameters[5] = new SqlParameter("@Gold", (object)player.Gold);
         SqlParameters[6] = new SqlParameter("@GP", (object)player.GP);
         SqlParameters[7] = new SqlParameter("@Grade", (object)player.Grade);
         SqlParameters[8] = new SqlParameter("@Luck", (object)player.Luck);
         SqlParameters[9] = new SqlParameter("@Money", (object)player.Money);
         SqlParameters[10] = new SqlParameter("@Style", player.Style == null ? (object)"" : (object)player.Style);
         SqlParameters[11] = new SqlParameter("@Agility", (object)player.Agility);
         SqlParameters[12] = new SqlParameter("@State", (object)player.State);
         SqlParameters[13] = new SqlParameter("@Hide", (object)player.Hide);
         SqlParameters[14] = new SqlParameter("@ExpendDate", !player.ExpendDate.HasValue ? (object)"" : (object)player.ExpendDate.ToString());
         SqlParameters[15] = new SqlParameter("@Win", (object)player.Win);
         SqlParameters[16] = new SqlParameter("@Total", (object)player.Total);
         SqlParameters[17] = new SqlParameter("@Escape", (object)player.Escape);
         SqlParameters[18] = new SqlParameter("@Skin", player.Skin == null ? (object)"" : (object)player.Skin);
         SqlParameters[19] = new SqlParameter("@Offer", (object)player.Offer);
         SqlParameters[20] = new SqlParameter("@AntiAddiction", (object)player.AntiAddiction);
         SqlParameters[20].Direction = ParameterDirection.InputOutput;
         SqlParameters[21] = new SqlParameter("@Result", SqlDbType.Int);
         SqlParameters[21].Direction = ParameterDirection.ReturnValue;
         SqlParameters[22] = new SqlParameter("@RichesOffer", (object)player.RichesOffer);
         SqlParameters[23] = new SqlParameter("@RichesRob", (object)player.RichesRob);
         SqlParameters[24] = new SqlParameter("@CheckCount", (object)player.CheckCount);
         SqlParameters[24].Direction = ParameterDirection.InputOutput;
         SqlParameters[25] = new SqlParameter("@MarryInfoID", (object)player.MarryInfoID);
         SqlParameters[26] = new SqlParameter("@DayLoginCount", (object)player.DayLoginCount);
         SqlParameters[27] = new SqlParameter("@Nimbus", (object)player.Nimbus);
         SqlParameters[28] = new SqlParameter("@LastAward", (object)player.LastAward);
         SqlParameters[29] = new SqlParameter("@GiftToken", (object)player.GiftToken);
         SqlParameters[30] = new SqlParameter("@QuestSite", (object)player.QuestSite);
         SqlParameters[31] = new SqlParameter("@PvePermission", (object)player.PvePermission);
         SqlParameters[32] = new SqlParameter("@FightPower", (object)player.FightPower);
         SqlParameters[33] = new SqlParameter("@AnswerSite", (object)player.AnswerSite);
         SqlParameters[34] = new SqlParameter("@LastAuncherAward", (object)player.LastAward);
         SqlParameters[35] = new SqlParameter("@hp", (object)player.hp);
         SqlParameters[36] = new SqlParameter("@ChatCount", (object)player.ChatCount);
         SqlParameters[37] = new SqlParameter("@SpaPubGoldRoomLimit", (object)player.SpaPubGoldRoomLimit);
         SqlParameters[38] = new SqlParameter("@LastSpaDate", (object)player.LastSpaDate);
         SqlParameters[39] = new SqlParameter("@FightLabPermission", (object)player.FightLabPermission);
         SqlParameters[40] = new SqlParameter("@SpaPubMoneyRoomLimit", (object)player.SpaPubMoneyRoomLimit);
         SqlParameters[41] = new SqlParameter("@IsInSpaPubGoldToday", (object)(int)(player.IsInSpaPubGoldToday ? 1 : 0));
         SqlParameters[42] = new SqlParameter("@IsInSpaPubMoneyToday", (object)(int)(player.IsInSpaPubMoneyToday ? 1 : 0));
         SqlParameters[43] = new SqlParameter("@AchievementPoint", (object)player.AchievementPoint);
         SqlParameters[44] = new SqlParameter("@LastWeekly", (object)player.LastWeekly);
         SqlParameters[45] = new SqlParameter("@LastWeeklyVersion", (object)player.LastWeeklyVersion);
         SqlParameters[46] = new SqlParameter("@GiftGp", (object)player.GiftGp);
         SqlParameters[47] = new SqlParameter("@GiftLevel", (object)player.GiftLevel);
         SqlParameters[48] = new SqlParameter("@IsOpenGift", (object)(int)(player.IsOpenGift ? 1 : 0));
         SqlParameters[49] = new SqlParameter("@WeaklessGuildProgressStr", (object)player.WeaklessGuildProgressStr);
         SqlParameters[50] = new SqlParameter("@IsOldPlayer", (object)(int)(player.IsOldPlayer ? 1 : 0));
         SqlParameters[51] = new SqlParameter("@VIPLevel", (object)player.VIPLevel);
         SqlParameters[52] = new SqlParameter("@VIPExp", (object)player.VIPExp);
         SqlParameters[53] = new SqlParameter("@Score", (object)player.Score);
         SqlParameters[54] = new SqlParameter("@OptionOnOff", (object)player.OptionOnOff);
         SqlParameters[55] = new SqlParameter("@isOldPlayerHasValidEquitAtLogin", (object)(int)(player.isOldPlayerHasValidEquitAtLogin ? 1 : 0));
         SqlParameters[56] = new SqlParameter("@badLuckNumber", (object)player.badLuckNumber);
         SqlParameters[57] = new SqlParameter("@luckyNum", (object)player.luckyNum);
         SqlParameters[58] = new SqlParameter("@lastLuckyNumDate", (object)player.lastLuckyNumDate.ToString());
         SqlParameters[59] = new SqlParameter("@lastLuckNum", (object)player.lastLuckNum);
         SqlParameters[60] = new SqlParameter("@CardSoul", (object)player.CardSoul);
         SqlParameters[61] = new SqlParameter("@uesedFinishTime", (object)player.uesedFinishTime);
         SqlParameters[62] = new SqlParameter("@totemId", (object)player.totemId);
         SqlParameters[63] = new SqlParameter("@damageScores", (object)player.damageScores);
         SqlParameters[64] = new SqlParameter("@petScore", (object)player.petScore);
         SqlParameters[65] = new SqlParameter("@IsShowConsortia", (object)(int)(player.IsShowConsortia ? 1 : 0));
         SqlParameter[] sqlParameterArray1 = SqlParameters;
         int index1 = 66;
         string parameterName1 = "@LastRefreshPet";
         DateTime dateTime = player.LastRefreshPet;
         string str1 = dateTime.ToString();
         SqlParameter sqlParameter1 = new SqlParameter(parameterName1, (object)str1);
         sqlParameterArray1[index1] = sqlParameter1;
         SqlParameters[67] = new SqlParameter("@GetSoulCount", (object)player.GetSoulCount);
         SqlParameters[68] = new SqlParameter("@isFirstDivorce", (object)player.isFirstDivorce);
         SqlParameters[69] = new SqlParameter("@needGetBoxTime", (object)player.needGetBoxTime);
         SqlParameters[70] = new SqlParameter("@myScore", (object)player.myScore);
         SqlParameter[] sqlParameterArray2 = SqlParameters;
         int index2 = 71;
         string parameterName2 = "@TimeBox";
         dateTime = player.TimeBox;
         string str2 = dateTime.ToString();
         SqlParameter sqlParameter2 = new SqlParameter(parameterName2, (object)str2);
         sqlParameterArray2[index2] = sqlParameter2;
         SqlParameters[72] = new SqlParameter("@IsFistGetPet", (object)(int)(player.IsFistGetPet ? 1 : 0));
         SqlParameters[73] = new SqlParameter("@MaxBuyHonor", (object)player.MaxBuyHonor);
         SqlParameters[74] = new SqlParameter("@Medal", (object)player.medal);
         SqlParameters[75] = new SqlParameter("@myHonor", (object)player.myHonor);
         SqlParameters[76] = new SqlParameter("@LeagueMoney", (object)player.LeagueMoney);
         SqlParameters[77] = new SqlParameter("@Honor", (object)player.Honor);
         SqlParameters[78] = new SqlParameter("@necklaceExp", (object)player.necklaceExp);
         SqlParameters[79] = new SqlParameter("@necklaceExpAdd", (object)player.necklaceExpAdd);
         SqlParameters[80] = new SqlParameter("@hardCurrency", (object)player.hardCurrency);
         this.db.RunProcedure("SP_Users_Update", SqlParameters);
         flag = (int)SqlParameters[21].Value == 0;
         if (flag)
         {
             player.AntiAddiction = (int)SqlParameters[20].Value;
             player.CheckCount = (int)SqlParameters[24].Value;
         }
         player.IsDirty = false;
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"Init", ex);
     }
     return flag;
 }
示例#12
0
 public PlayerInfo[] GetPlayerPage(int page, int size, ref int total, int order, int userID, ref bool resultValue)
 {
     List<PlayerInfo> list = new List<PlayerInfo>();
     try
     {
         string queryWhere = " IsExist=1 and IsFirst<> 0 ";
         if (userID != -1)
             queryWhere = string.Concat(new object[4]
       {
     (object) queryWhere,
     (object) " and UserID =",
     (object) userID,
     (object) " "
       });
         string str = "GP desc";
         switch (order)
         {
             case 1:
                 str = "Offer desc";
                 break;
             case 2:
                 str = "AddDayGP desc";
                 break;
             case 3:
                 str = "AddWeekGP desc";
                 break;
             case 4:
                 str = "AddDayOffer desc";
                 break;
             case 5:
                 str = "AddWeekOffer desc";
                 break;
             case 6:
                 str = "FightPower desc";
                 break;
             case 7:
                 str = "AchievementPoint desc";
                 break;
             case 8:
                 str = "AddDayAchievementPoint desc";
                 break;
             case 9:
                 str = "AddWeekAchievementPoint desc";
                 break;
             case 10:
                 str = "GiftGp desc";
                 break;
             case 11:
                 str = "AddDayGiftGp desc";
                 break;
             case 12:
                 str = "AddWeekGiftGp desc";
                 break;
         }
         string fdOreder = str + ",UserID";
         foreach (DataRow dataRow in (InternalDataCollectionBase)this.GetPage("V_Sys_Users_Detail", queryWhere, page, size, "*", fdOreder, "UserID", ref total).Rows)
         {
             PlayerInfo playerInfo = new PlayerInfo();
             playerInfo.Agility = (int)dataRow["Agility"];
             playerInfo.Attack = (int)dataRow["Attack"];
             playerInfo.Colors = dataRow["Colors"] == null ? "" : dataRow["Colors"].ToString();
             playerInfo.ConsortiaID = (int)dataRow["ConsortiaID"];
             playerInfo.Defence = (int)dataRow["Defence"];
             playerInfo.Gold = (int)dataRow["Gold"];
             playerInfo.GP = (int)dataRow["GP"];
             playerInfo.Grade = (int)dataRow["Grade"];
             playerInfo.ID = (int)dataRow["UserID"];
             playerInfo.Luck = (int)dataRow["Luck"];
             playerInfo.Money = (int)dataRow["Money"];
             playerInfo.NickName = dataRow["NickName"] == null ? "" : dataRow["NickName"].ToString();
             playerInfo.Sex = (bool)dataRow["Sex"];
             playerInfo.State = (int)dataRow["State"];
             playerInfo.Style = dataRow["Style"] == null ? "" : dataRow["Style"].ToString();
             playerInfo.Hide = (int)dataRow["Hide"];
             playerInfo.Repute = (int)dataRow["Repute"];
             playerInfo.UserName = dataRow["UserName"] == null ? "" : dataRow["UserName"].ToString();
             playerInfo.ConsortiaName = dataRow["ConsortiaName"] == null ? "" : dataRow["ConsortiaName"].ToString();
             playerInfo.Offer = (int)dataRow["Offer"];
             playerInfo.Skin = dataRow["Skin"] == null ? "" : dataRow["Skin"].ToString();
             playerInfo.IsBanChat = (bool)dataRow["IsBanChat"];
             playerInfo.ReputeOffer = (int)dataRow["ReputeOffer"];
             playerInfo.ConsortiaRepute = (int)dataRow["ConsortiaRepute"];
             playerInfo.ConsortiaLevel = (int)dataRow["ConsortiaLevel"];
             playerInfo.StoreLevel = (int)dataRow["StoreLevel"];
             playerInfo.ShopLevel = (int)dataRow["ShopLevel"];
             playerInfo.SmithLevel = (int)dataRow["SmithLevel"];
             playerInfo.ConsortiaHonor = (int)dataRow["ConsortiaHonor"];
             playerInfo.RichesOffer = (int)dataRow["RichesOffer"];
             playerInfo.RichesRob = (int)dataRow["RichesRob"];
             playerInfo.DutyLevel = (int)dataRow["DutyLevel"];
             playerInfo.DutyName = dataRow["DutyName"] == null ? "" : dataRow["DutyName"].ToString();
             playerInfo.Right = (int)dataRow["Right"];
             playerInfo.ChairmanName = dataRow["ChairmanName"] == null ? "" : dataRow["ChairmanName"].ToString();
             playerInfo.Win = (int)dataRow["Win"];
             playerInfo.Total = (int)dataRow["Total"];
             playerInfo.Escape = (int)dataRow["Escape"];
             playerInfo.AddDayGP = (int)dataRow["AddDayGP"] == 0 ? playerInfo.GP : (int)dataRow["AddDayGP"];
             playerInfo.AddDayOffer = (int)dataRow["AddDayOffer"] == 0 ? playerInfo.Offer : (int)dataRow["AddDayOffer"];
             playerInfo.AddWeekGP = (int)dataRow["AddWeekGP"] == 0 ? playerInfo.GP : (int)dataRow["AddWeekyGP"];
             playerInfo.AddWeekOffer = (int)dataRow["AddWeekOffer"] == 0 ? playerInfo.Offer : (int)dataRow["AddWeekOffer"];
             playerInfo.ConsortiaRiches = (int)dataRow["ConsortiaRiches"];
             playerInfo.CheckCount = (int)dataRow["CheckCount"];
             playerInfo.Nimbus = (int)dataRow["Nimbus"];
             playerInfo.GiftToken = (int)dataRow["GiftToken"];
             playerInfo.QuestSite = dataRow["QuestSite"] == null ? new byte[200] : (byte[])dataRow["QuestSite"];
             playerInfo.PvePermission = dataRow["PvePermission"] == null ? "" : dataRow["PvePermission"].ToString();
             playerInfo.FightPower = (int)dataRow["FightPower"];
             list.Add(playerInfo);
         }
         resultValue = true;
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"Init", ex);
     }
     return list.ToArray();
 }
示例#13
0
        public bool UpdatePlayer(PlayerInfo player)
        {
            bool result = false;
            try
            {
                if (player.Grade < 1)
                    return result;

                SqlParameter[] para = new SqlParameter[53]; //trminhpc
                para[0] = new SqlParameter("@UserID", player.ID);
                para[1] = new SqlParameter("@Attack", player.Attack);
                para[2] = new SqlParameter("@Colors", player.Colors == null ? "" : player.Colors);
                para[3] = new SqlParameter("@ConsortiaID", player.ConsortiaID);
                para[4] = new SqlParameter("@Defence", player.Defence);
                para[5] = new SqlParameter("@Gold", player.Gold);
                para[6] = new SqlParameter("@GP", player.GP);
                para[7] = new SqlParameter("@Grade", player.Grade);
                para[8] = new SqlParameter("@Luck", player.Luck);
                para[9] = new SqlParameter("@Money", player.Money);
                para[10] = new SqlParameter("@Style", player.Style == null ? "" : player.Style);
                para[11] = new SqlParameter("@Agility", player.Agility);
                para[12] = new SqlParameter("@State", player.State);
                para[13] = new SqlParameter("@Hide", player.Hide);
                para[14] = new SqlParameter("@ExpendDate", player.ExpendDate == null ? "" : player.ExpendDate.ToString());
                para[15] = new SqlParameter("@Win", player.Win);
                para[16] = new SqlParameter("@Total", player.Total);
                para[17] = new SqlParameter("@Escape", player.Escape);
                para[18] = new SqlParameter("@Skin", player.Skin == null ? "" : player.Skin);
                para[19] = new SqlParameter("@Offer", player.Offer);
                para[20] = new SqlParameter("@AntiAddiction", player.AntiAddiction);
                para[20].Direction = ParameterDirection.InputOutput;
                para[21] = new SqlParameter("@Result", System.Data.SqlDbType.Int);
                para[21].Direction = ParameterDirection.ReturnValue;
                para[22] = new SqlParameter("@RichesOffer", player.RichesOffer);
                para[23] = new SqlParameter("@RichesRob", player.RichesRob);
                para[24] = new SqlParameter("@CheckCount", player.CheckCount);
                para[24].Direction = ParameterDirection.InputOutput;
                para[25] = new SqlParameter("@MarryInfoID", player.MarryInfoID);
                para[26] = new SqlParameter("@DayLoginCount", player.DayLoginCount);
                para[27] = new SqlParameter("@Nimbus", player.Nimbus);
                para[28] = new SqlParameter("@LastAward", player.LastAward);
                para[29] = new SqlParameter("@GiftToken", player.GiftToken);
                para[30] = new SqlParameter("@QuestSite", player.QuestSite);
                para[31] = new SqlParameter("@PvePermission", player.PvePermission);
                para[32] = new SqlParameter("@FightPower", player.FightPower);
                para[33] = new SqlParameter("@AnswerSite", player.AnswerSite);
                para[34] = new SqlParameter("@LastAuncherAward", player.LastAward);
                para[35] = new SqlParameter("@Medal", player.medal);
                para[36] = new SqlParameter("@ChatCount", player.ChatCount);
                para[37] = new SqlParameter("@SpaPubGoldRoomLimit", player.SpaPubGoldRoomLimit);
                para[38] = new SqlParameter("@LastSpaDate", player.LastSpaDate);
                para[39] = new SqlParameter("@FightLabPermission", player.FightLabPermission);
                para[40] = new SqlParameter("@SpaPubMoneyRoomLimit", player.SpaPubMoneyRoomLimit);
                para[41] = new SqlParameter("@IsInSpaPubGoldToday", player.IsInSpaPubGoldToday);
                para[42] = new SqlParameter("@IsInSpaPubMoneyToday", player.IsInSpaPubMoneyToday);
                para[43] = new SqlParameter("@AchievementPoint", player.AchievementPoint);
                para[44] = new SqlParameter("@LastWeekly", player.LastWeekly);
                para[45] = new SqlParameter("@LastWeeklyVersion", player.LastWeeklyVersion);
                para[46] = new SqlParameter("@GiftGp", player.GiftGp);
                para[47] = new SqlParameter("@GiftLevel", player.GiftLevel);
                para[48] = new SqlParameter("@IsOpenGift", player.IsOpenGift);
                para[49] = new SqlParameter("@WeaklessGuildProgressStr", player.WeaklessGuildProgressStr);
                para[50] = new SqlParameter("@IsOldPlayer", player.IsOldPlayer);
                para[51] = new SqlParameter("@VIPLevel", player.VIPLevel);
                para[52] = new SqlParameter("@VIPExp", player.VIPExp);
                db.RunProcedure("SP_Users_Update", para);

                result = (int)para[21].Value == 0;
                if (result)
                {
                    player.AntiAddiction = (int)para[20].Value;
                    player.CheckCount = (int)para[24].Value;
                }
                player.IsDirty = false;
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("Init", e);
            }
            return result;
        }
示例#14
0
 public GSPacketIn SendUpdatePublicPlayer(PlayerInfo info)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.UPDATE_PLAYER_INFO, info.ID);
     pkg.WriteInt(info.GP);
     pkg.WriteInt(info.Offer);
     pkg.WriteInt(info.RichesOffer);
     pkg.WriteInt(info.RichesRob);
     pkg.WriteInt(info.Win);
     pkg.WriteInt(info.Total);
     pkg.WriteInt(info.Escape);
     pkg.WriteInt(info.Attack);
     pkg.WriteInt(info.Defence);
     pkg.WriteInt(info.Agility);
     pkg.WriteInt(info.Luck);
     pkg.WriteInt(info.hp);//info.hp = pkg.readInt();
     pkg.WriteInt(info.Hide);
     pkg.WriteString(info.Style);
     pkg.WriteString(info.Colors);
     pkg.WriteString(info.Skin);
     pkg.WriteBoolean(false);//info.IsShowConsortia = pkg.readBoolean();
     pkg.WriteInt(info.ConsortiaID);
     pkg.WriteString(info.ConsortiaName);
     pkg.WriteInt(0);//info.badgeID = pkg.readInt();
     pkg.WriteInt(info.ConsortiaLevel);//unknown1 = pkg.readInt();
     pkg.WriteInt(info.ConsortiaRepute);//unknown2 = pkg.readInt();
     pkg.WriteInt(info.Nimbus);
     pkg.WriteString(info.PvePermission);
     pkg.WriteString(info.FightLabPermission);
     pkg.WriteInt(info.FightPower);
     pkg.WriteInt(5);//apprenticeshipState = pkg.readInt();
     pkg.WriteInt(-1);//masterID = pkg.readInt();
     pkg.WriteString("Master");//setMasterOrApprentices(pkg.readUTF());
     pkg.WriteInt(0);//graduatesCount = pkg.readInt();
     pkg.WriteString("HoNorMaster");//honourOfMaster = pkg.readUTF();
     pkg.WriteInt(info.AchievementPoint);
     pkg.WriteString("Danh hiệu Gunny"); //honor = pkg.readUTF();
     pkg.WriteDateTime((DateTime)info.LastSpaDate);
     pkg.WriteInt(100);//charmgp
     pkg.WriteInt(100); //unknown3 = pkg.readInt();
     pkg.WriteDateTime(DateTime.MinValue); //info.shopFinallyGottenTime
     pkg.WriteInt(info.Offer);//info.UseOffer = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.matchInfo.dailyScore = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.matchInfo.dailyWinCount = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.matchInfo.dailyGameCount = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.matchInfo.weeklyScore = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.matchInfo.weeklyGameCount = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.spdTexpExp = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.attTexpExp = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.defTexpExp = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.hpTexpExp = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.lukTexpExp = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.texpTaskCount = pkg.readInt();
     pkg.WriteInt(info.Offer);//info.texpCount = pkg.readInt();
     pkg.WriteDateTime(DateTime.Now.AddDays(-5));//info.texpTaskDate = pkg.readDate();
     pkg.WriteInt(1);//len = pkg.readInt();
     for (int i = 0; i < 1; i++)
     {
         pkg.WriteInt(1);//mapId = pkg.readInt();
         pkg.WriteByte(1);//flag = pkg.readByte();
     }
     SendTCP(pkg);
     return pkg;
 }
示例#15
0
 public void SendUpdatePrivateInfo(PlayerInfo info)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.UPDATE_PRIVATE_INFO, info.ID);
     pkg.WriteInt(info.Money);
     pkg.WriteInt(info.GiftToken); //this._self.DDTMoney = event.pkg.readInt();
     pkg.WriteInt(1);//this._self.Score = event.pkg.readInt();
     pkg.WriteInt(info.Gold);
     pkg.WriteInt(1);//_self.badLuckNumber = event.pkg.readInt();
     pkg.WriteInt(1);//_self.damageScores = event.pkg.readInt();
     SendTCP(pkg);
 }
示例#16
0
        public GSPacketIn SendUpdatePetInfo(PlayerInfo player, List<ItemInfo> items)
        {
            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.PET, player.ID);
            pkg.WriteByte((byte)Game.Logic.eTankCmdType.UPDATE_PET);
            pkg.WriteInt(player.ID);
            pkg.WriteInt(1);
            //foreach (ItemInfo info in items)

            //{
                pkg.WriteInt(0);//_loc_11.Place = _loc_7;
                //if (items.Count > 0)
                //{
                    pkg.WriteBoolean(true);
                    pkg.WriteInt(1);//_loc_11.ID = _loc_2.readInt();
                    //pkg.WriteInt(100703);//_loc_11.TemplateID = _loc_2.readInt();
                    //pkg.WriteString("Gà Du Kích");//_loc_11.Name = _loc_2.readUTF();
                    pkg.WriteInt(140403);//_loc_11.TemplateID = _loc_2.readInt();
                    pkg.WriteString("远古魔龙");//_loc_11.Name = _loc_2.readUTF();
                    pkg.WriteInt(player.ID);//_loc_11.UserID = _loc_2.readInt();
                    pkg.WriteInt(5000);//_loc_11.Attack = _loc_2.readInt();
                    pkg.WriteInt(3000);//_loc_11.Defence = _loc_2.readInt();
                    pkg.WriteInt(4000);//_loc_11.Luck = _loc_2.readInt();
                    pkg.WriteInt(6000);//_loc_11.Agility = _loc_2.readInt();
                    pkg.WriteInt(4000);//_loc_11.Blood = _loc_2.readInt();
                    pkg.WriteInt(6000);//_loc_11.Damage = _loc_2.readInt();
                    pkg.WriteInt(1500);//_loc_11.Guard = _loc_2.readInt();
                    pkg.WriteInt(2700);//_loc_11.AttackGrow = _loc_2.readInt();
                    pkg.WriteInt(500);//_loc_11.DefenceGrow = _loc_2.readInt();
                    pkg.WriteInt(800);//_loc_11.LuckGrow = _loc_2.readInt();
                    pkg.WriteInt(600);//_loc_11.AgilityGrow = _loc_2.readInt();
                    pkg.WriteInt(700);//_loc_11.BloodGrow = _loc_2.readInt();
                    pkg.WriteInt(500);//_loc_11.DamageGrow = _loc_2.readInt();
                    pkg.WriteInt(400);//_loc_11.GuardGrow = _loc_2.readInt();
                    pkg.WriteInt(60);//_loc_11.Level = _loc_2.readInt();
                    pkg.WriteInt(0);//_loc_11.GP = _loc_2.readInt();
                    pkg.WriteInt(10);//_loc_11.MaxGP = _loc_2.readInt();
                    pkg.WriteInt(10000);//_loc_11.Hunger = _loc_2.readInt();
                    pkg.WriteInt(3);//_loc_11.PetHappyStar = _loc_2.readInt();
                    pkg.WriteInt(100);//_loc_11.MP = _loc_2.readInt();
                    pkg.WriteInt(3);// _loc_2.readInt();==>Ky nang thu cung
                    for (int i = 0; i < 3; i++)
                    {
                        pkg.WriteInt(110 + i);//_loc_2.readInt();
                        pkg.WriteInt(i);//_loc_17 = _loc_2.readInt();
                    }
                    pkg.WriteInt(3);// _loc_2.readInt();==>ky nang chien dau
                    for (int ii = 0; ii < 3; ii++)
                    {
                        pkg.WriteInt(ii);//_loc_19 = _loc_2.readInt();
                        pkg.WriteInt(110 + ii);//_loc_20 = _loc_2.readInt();

                    }
                    pkg.WriteBoolean(true);//_loc_11.IsEquip = _loc_2.readBoolean();
                //}
                //else { pkg.WriteBoolean(false);  }
            //}

            //pkg.Compress();
            SendTCP(pkg);
            return pkg;
        }
示例#17
0
        public PlayerInfo[] GetPlayerPage(int page, int size, ref int total, int order, int userID, ref bool resultValue)
        {
            List<PlayerInfo> infos = new List<PlayerInfo>();
            try
            {
                string sWhere = " IsExist=1 and IsFirst<> 0 ";
                if (userID != -1)
                {
                    sWhere += " and UserID =" + userID + " ";
                }
                string sOrder = "GP desc";
                //string sOrder = "LastDayGP desc";
                switch (order)
                {
                    case 1:
                        sOrder = "Offer desc";
                        //sOrder = "LastDayOffer desc";
                        break;
                    case 2:
                        sOrder = "AddDayGP desc";
                        break;
                    case 3:
                        sOrder = "AddWeekGP desc";
                        break;
                    case 4:
                        sOrder = "AddDayOffer desc";
                        break;
                    case 5:
                        sOrder = "AddWeekOffer desc";
                        break;
                    case 6:
                        sOrder = "FightPower desc";
                        break;
                }

                sOrder += ",UserID";

                DataTable dt = GetPage("V_Sys_Users_Detail", sWhere, page, size, "*", sOrder, "UserID", ref total);
                foreach (DataRow dr in dt.Rows)
                {
                    PlayerInfo info = new PlayerInfo();
                    info.Agility = (int)dr["Agility"];
                    info.Attack = (int)dr["Attack"];
                    info.Colors = dr["Colors"] == null ? "" : dr["Colors"].ToString();
                    info.ConsortiaID = (int)dr["ConsortiaID"];
                    info.Defence = (int)dr["Defence"];
                    info.Gold = (int)dr["Gold"];
                    info.GP = (int)dr["GP"];
                    info.Grade = (int)dr["Grade"];
                    info.ID = (int)dr["UserID"];
                    info.Luck = (int)dr["Luck"];
                    info.Money = (int)dr["Money"];
                    info.NickName = dr["NickName"] == null ? "" : dr["NickName"].ToString();
                    info.Sex = (bool)dr["Sex"];
                    info.State = (int)dr["State"];
                    info.Style = dr["Style"] == null ? "" : dr["Style"].ToString();
                    info.Hide = (int)dr["Hide"];
                    info.Repute = (int)dr["Repute"];
                    info.UserName = dr["UserName"] == null ? "" : dr["UserName"].ToString();
                    info.ConsortiaName = dr["ConsortiaName"] == null ? "" : dr["ConsortiaName"].ToString();
                    info.Offer = (int)dr["Offer"];
                    info.Skin = dr["Skin"] == null ? "" : dr["Skin"].ToString();
                    info.IsBanChat = (bool)dr["IsBanChat"];
                    info.ReputeOffer = (int)dr["ReputeOffer"];
                    info.ConsortiaRepute = (int)dr["ConsortiaRepute"];
                    info.ConsortiaLevel = (int)dr["ConsortiaLevel"];
                    info.StoreLevel = (int)dr["StoreLevel"];
                    info.ShopLevel = (int)dr["ShopLevel"];
                    info.SmithLevel = (int)dr["SmithLevel"];
                    info.ConsortiaHonor = (int)dr["ConsortiaHonor"];
                    info.RichesOffer = (int)dr["RichesOffer"];
                    info.RichesRob = (int)dr["RichesRob"];
                    info.DutyLevel = (int)dr["DutyLevel"];
                    info.DutyName = dr["DutyName"] == null ? "" : dr["DutyName"].ToString();
                    info.Right = (int)dr["Right"];
                    info.ChairmanName = dr["ChairmanName"] == null ? "" : dr["ChairmanName"].ToString();
                    info.Win = (int)dr["Win"];
                    info.Total = (int)dr["Total"];
                    info.Escape = (int)dr["Escape"];
                    info.AddDayGP = (int)dr["AddDayGP"];
                    info.AddDayOffer = (int)dr["AddDayOffer"];
                    info.AddWeekGP = (int)dr["AddWeekGP"];
                    info.AddWeekOffer = (int)dr["AddWeekOffer"];
                    info.ConsortiaRiches = (int)dr["ConsortiaRiches"];
                    info.CheckCount = (int)dr["CheckCount"];
                    info.Nimbus = (int)dr["Nimbus"];
                    info.GiftToken = (int)dr["GiftToken"];
                    info.QuestSite = dr["QuestSite"] == null ? new byte[200] : (byte[])dr["QuestSite"];
                    info.PvePermission = dr["PvePermission"] == null ? "" : dr["PvePermission"].ToString();
                    info.FightPower = (int)dr["FightPower"];
                    infos.Add(info);
                }
                resultValue = true;

            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("Init", e);
            }
            finally
            {
            }

            return infos.ToArray();
        }
示例#18
0
 public PlayerInfo InitPlayerInfo(SqlDataReader reader)
 {
     PlayerInfo player = new PlayerInfo();
     player.Password = (string)reader["Password"];
     player.IsConsortia = (bool)reader["IsConsortia"];
     player.Agility = (int)reader["Agility"];
     player.Attack = (int)reader["Attack"];
     player.Colors = reader["Colors"] == null ? "" : reader["Colors"].ToString();
     player.ConsortiaID = (int)reader["ConsortiaID"];
     player.Defence = (int)reader["Defence"];
     player.Gold = (int)reader["Gold"];
     player.GP = (int)reader["GP"];
     player.Grade = (int)reader["Grade"];
     player.ID = (int)reader["UserID"];
     player.Luck = (int)reader["Luck"];
     player.Money = (int)reader["Money"];
     player.NickName = reader["NickName"] == null ? "" : reader["NickName"].ToString();
     player.Sex = (bool)reader["Sex"];
     player.State = (int)reader["State"];
     player.Style = reader["Style"] == null ? "" : reader["Style"].ToString();
     player.Hide = (int)reader["Hide"];
     player.Repute = (int)reader["Repute"];
     player.UserName = reader["UserName"] == null ? "" : reader["UserName"].ToString();
     player.ConsortiaName = reader["ConsortiaName"] == null ? "" : reader["ConsortiaName"].ToString();
     player.Offer = (int)reader["Offer"];
     player.Win = (int)reader["Win"];
     player.Total = (int)reader["Total"];
     player.Escape = (int)reader["Escape"];
     player.Skin = reader["Skin"] == null ? "" : reader["Skin"].ToString();
     player.IsBanChat = (bool)reader["IsBanChat"];
     player.ReputeOffer = (int)reader["ReputeOffer"];
     player.ConsortiaRepute = (int)reader["ConsortiaRepute"];
     player.ConsortiaLevel = (int)reader["ConsortiaLevel"];
     player.StoreLevel = (int)reader["StoreLevel"];
     player.ShopLevel = (int)reader["ShopLevel"];
     player.SmithLevel = (int)reader["SmithLevel"];
     player.ConsortiaHonor = (int)reader["ConsortiaHonor"];
     player.RichesOffer = (int)reader["RichesOffer"];
     player.RichesRob = (int)reader["RichesRob"];
     player.AntiAddiction = (int)reader["AntiAddiction"];
     player.DutyLevel = (int)reader["DutyLevel"];
     player.DutyName = reader["DutyName"] == null ? "" : reader["DutyName"].ToString();
     player.Right = (int)reader["Right"];
     player.ChairmanName = reader["ChairmanName"] == null ? "" : reader["ChairmanName"].ToString();
     player.AddDayGP = (int)reader["AddDayGP"];
     player.AddDayOffer = (int)reader["AddDayOffer"];
     player.AddWeekGP = (int)reader["AddWeekGP"];
     player.AddWeekOffer = (int)reader["AddWeekOffer"];
     player.ConsortiaRiches = (int)reader["ConsortiaRiches"];
     player.CheckCount = (int)reader["CheckCount"];
     player.IsMarried = (bool)reader["IsMarried"];
     player.SpouseID = (int)reader["SpouseID"];
     player.SpouseName = reader["SpouseName"] == null ? "" : reader["SpouseName"].ToString();
     player.MarryInfoID = (int)reader["MarryInfoID"];
     player.IsCreatedMarryRoom = (bool)reader["IsCreatedMarryRoom"];
     player.DayLoginCount = (int)reader["DayLoginCount"];
     player.PasswordTwo = reader["PasswordTwo"] == null ? "" : reader["PasswordTwo"].ToString();
     player.SelfMarryRoomID = (int)reader["SelfMarryRoomID"];
     player.IsGotRing = (bool)reader["IsGotRing"];
     player.Rename = (bool)reader["Rename"];
     player.ConsortiaRename = (bool)reader["ConsortiaRename"];
     player.IsDirty = false;
     player.IsFirst = (int)reader["IsFirst"];
     player.Nimbus = (int)reader["Nimbus"];
     player.LastAward = (DateTime)reader["LastAward"];
     player.GiftToken = (int)reader["GiftToken"];
     player.QuestSite = reader["QuestSite"] == null ? new byte[200] : (byte[])reader["QuestSite"];
     player.PvePermission = reader["PvePermission"] == null ? "" : reader["PvePermission"].ToString();
     player.FightPower = (int)reader["FightPower"];
     player.PasswordQuest1 = reader["PasswordQuestion1"] == null ? "" : reader["PasswordQuestion1"].ToString();
     player.PasswordQuest2 = reader["PasswordQuestion2"] == null ? "" : reader["PasswordQuestion2"].ToString();
     player.FailedPasswordAttemptCount = (DateTime)reader["LastFindDate"] == null ? 5 : (int)reader["FailedPasswordAttemptCount"];
     player.AnswerSite = (int)reader["AnswerSite"];
     return player;
 }
示例#19
0
        public bool UpdatePlayerMarry(PlayerInfo player)
        {
            bool result = false;
            try
            {
                SqlParameter[] para = new SqlParameter[7];
                para[0] = new SqlParameter("@UserID", player.ID);
                para[1] = new SqlParameter("@IsMarried", player.IsMarried);
                para[2] = new SqlParameter("@SpouseID", player.SpouseID);
                para[3] = new SqlParameter("@SpouseName", player.SpouseName);
                para[4] = new SqlParameter("@IsCreatedMarryRoom", player.IsCreatedMarryRoom);
                para[5] = new SqlParameter("@SelfMarryRoomID", player.SelfMarryRoomID);
                para[6] = new SqlParameter("@IsGotRing", player.IsGotRing);

                result = db.RunProcedure("SP_Users_Marry", para);
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("UpdatePlayerMarry", e);
            }
            return result;
        }
示例#20
0
 public GSPacketIn SendUserEquip(SqlDataProvider.Data.PlayerInfo info, List <SqlDataProvider.Data.ItemInfo> items)
 {
     throw new NotImplementedException();
 }
示例#21
0
 public GSPacketIn SendUpdatePetInfo(SqlDataProvider.Data.PlayerInfo player, List <SqlDataProvider.Data.ItemInfo> items)
 {
     throw new NotImplementedException();
 }
示例#22
0
 public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240);
     pkg.WriteInt(player.ID);
     pkg.WriteString(player.NickName);
     pkg.WriteInt(player.Agility);
     pkg.WriteInt(player.Attack);
     pkg.WriteString(player.Colors);
     pkg.WriteString(player.Skin);
     pkg.WriteInt(player.Defence);
     pkg.WriteInt(player.GP);
     pkg.WriteInt(player.Grade);
     pkg.WriteInt(player.Luck);
     pkg.WriteInt(player.hp);//_loc_5.hp = _loc_2.readInt();
     pkg.WriteInt(player.Hide);
     pkg.WriteInt(player.Repute);
     pkg.WriteBoolean(player.Sex);
     pkg.WriteString(player.Style);
     pkg.WriteInt(player.Offer);
     pkg.WriteByte(player.typeVIP);
     pkg.WriteInt(player.VIPLevel);
     pkg.WriteInt(player.Win);
     pkg.WriteInt(player.Total);
     pkg.WriteInt(player.Escape);
     pkg.WriteInt(player.ConsortiaID);
     pkg.WriteString(player.ConsortiaName);
     pkg.WriteInt(0);//_loc_5.badgeID = _loc_2.readInt();
     pkg.WriteInt(player.RichesOffer);
     pkg.WriteInt(player.RichesRob);
     pkg.WriteBoolean(player.IsMarried);
     pkg.WriteInt(player.SpouseID);
     pkg.WriteString(player.SpouseName);
     pkg.WriteString(player.DutyName);
     pkg.WriteInt(player.Nimbus);
     pkg.WriteInt(player.FightPower);
     pkg.WriteInt(5);//apprenticeshipState = _loc_2.readInt();
     pkg.WriteInt(-1);//masterID = _loc_2.readInt();
     pkg.WriteString("Master");//setMasterOrApprentices(_loc_2.readUTF());
     pkg.WriteInt(0);//graduatesCount = _loc_2.readInt();
     pkg.WriteString("HoNorMaster");//honourOfMaster = _loc_2.readUTF();
     pkg.WriteInt(player.AchievementPoint);//
     pkg.WriteString("Tân Binh");//honor = _loc_2.readUTF();
     pkg.WriteDateTime(DateTime.Now.AddDays(-2));
     pkg.WriteInt(player.Offer);    //_loc_5.spdTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.attTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.defTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.hpTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.lukTexpExp = _loc_2.readInt();
     pkg.WriteBoolean(false);    //_loc_5.DailyLeagueFirst = _loc_2.readBoolean();
     pkg.WriteInt(player.Offer);    //_loc_5.DailyLeagueLastScore = _loc_2.readInt();
     pkg.WriteInt(items.Count);
     foreach (ItemInfo info in items)
     {
         pkg.WriteByte((byte)info.BagType);
         pkg.WriteInt(info.UserID);
         pkg.WriteInt(info.ItemID);
         pkg.WriteInt(info.Count);
         pkg.WriteInt(info.Place);
         pkg.WriteInt(info.TemplateID);
         pkg.WriteInt(info.AttackCompose);
         pkg.WriteInt(info.DefendCompose);
         pkg.WriteInt(info.AgilityCompose);
         pkg.WriteInt(info.LuckCompose);
         pkg.WriteInt(info.StrengthenLevel);
         pkg.WriteBoolean(info.IsBinds);
         pkg.WriteBoolean(info.IsJudge);
         pkg.WriteDateTime(info.BeginDate);
         pkg.WriteInt(info.ValidDate);
         pkg.WriteString(info.Color);
         pkg.WriteString(info.Skin);
         pkg.WriteBoolean(info.IsUsed);
         pkg.WriteInt(info.Hole1);
         pkg.WriteInt(info.Hole2);
         pkg.WriteInt(info.Hole3);
         pkg.WriteInt(info.Hole4);
         pkg.WriteInt(info.Hole5);
         pkg.WriteInt(info.Hole6);
         pkg.WriteString(info.Template.Pic);
         pkg.WriteInt(info.Template.RefineryLevel);
         pkg.WriteDateTime(DateTime.Now);
         pkg.WriteByte((byte)info.Hole5Level);
         pkg.WriteInt(info.Hole5Exp);
         pkg.WriteByte((byte)info.Hole6Level);
         pkg.WriteInt(info.Hole6Exp);
         if (info.IsGold)
         {
             pkg.WriteBoolean(info.IsGold);//_loc_8.isGold = _loc_2.readBoolean();
             pkg.WriteInt(365);//_loc_8.goldValidDate = _loc_2.readInt();
             pkg.WriteDateTime(DateTime.Now);//_loc_8.goldBeginTime = _loc_2.readDateString();
         }
         else { pkg.WriteBoolean(false); }
     }
     pkg.Compress();
     SendTCP(pkg);
     return pkg;
 }
示例#23
0
 public bool UpdateLastVIPPackTime(PlayerInfo info)
 {
     bool flag = false;
     try
     {
         SqlParameter[] sqlParameters = new SqlParameter[] {
             new SqlParameter("@UserID", info.ID),
             new SqlParameter("@LastVIPPackTime", DateTime.Now.Date),
             new SqlParameter("@Result", SqlDbType.Int) };
         sqlParameters[2].Direction = ParameterDirection.ReturnValue;
         db.RunProcedure("SP_UpdateUserLastVIPPackTime", sqlParameters);
         flag = true;
     }
     catch (Exception exception)
     {
         if (BaseBussiness.log.IsErrorEnabled)
         {
             BaseBussiness.log.Error("SP_UpdateUserLastVIPPackTime", exception);
         }
     }
     return flag;
 }
示例#24
0
        public GSPacketIn SendPlayerCardInfo(PlayerInfo player, List<ItemInfo> items)
        {
            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.CARDS_DATA, player.ID);
            pkg.WriteInt(player.ID);
            pkg.WriteInt(items.Count);
            foreach (ItemInfo info in items)
            {
                pkg.WriteInt(info.Place);
                if (items.Count > 0)
                {
                    pkg.WriteBoolean(true);
                    pkg.WriteInt(info.ItemID);
                    pkg.WriteInt(player.ID);
                    pkg.WriteInt(info.Count);
                    pkg.WriteInt(info.Place);
                    pkg.WriteInt(info.Template.TemplateID);
                    pkg.WriteInt(info.Attack);
                    pkg.WriteInt(info.Defence);
                    pkg.WriteInt(info.Agility);
                    pkg.WriteInt(info.Luck);
                    pkg.WriteInt(info.AttackCompose);
                    pkg.WriteInt(info.DefendCompose);
                    pkg.WriteInt(info.StrengthenLevel);
                    pkg.WriteInt(info.Hole5Exp);
                    pkg.WriteBoolean(info.IsGold);

                }
                else { pkg.WriteBoolean(false); }
            }

            //pkg.Compress();
            SendTCP(pkg);
            return pkg;
        }
示例#25
0
 public PlayerInfo InitPlayerInfo(SqlDataReader reader)
 {
     PlayerInfo playerInfo1 = new PlayerInfo();
     playerInfo1.Password = (string)reader["Password"];
     playerInfo1.IsConsortia = (bool)reader["IsConsortia"];
     playerInfo1.Agility = (int)reader["Agility"];
     playerInfo1.Attack = (int)reader["Attack"];
     playerInfo1.hp = (int)reader["hp"];
     playerInfo1.Colors = reader["Colors"] == null ? "" : reader["Colors"].ToString();
     playerInfo1.ConsortiaID = (int)reader["ConsortiaID"];
     playerInfo1.Defence = (int)reader["Defence"];
     playerInfo1.Gold = (int)reader["Gold"];
     playerInfo1.GP = (int)reader["GP"];
     playerInfo1.Grade = (int)reader["Grade"];
     playerInfo1.ID = (int)reader["UserID"];
     playerInfo1.Luck = (int)reader["Luck"];
     playerInfo1.Money = (int)reader["Money"];
     playerInfo1.NickName = (string)reader["NickName"] == null ? "" : (string)reader["NickName"];
     playerInfo1.Sex = (bool)reader["Sex"];
     playerInfo1.State = (int)reader["State"];
     playerInfo1.Style = reader["Style"] == null ? "" : reader["Style"].ToString();
     playerInfo1.Hide = (int)reader["Hide"];
     playerInfo1.Repute = (int)reader["Repute"];
     playerInfo1.UserName = reader["UserName"] == null ? "" : reader["UserName"].ToString();
     playerInfo1.ConsortiaName = reader["ConsortiaName"] == null ? "" : reader["ConsortiaName"].ToString();
     playerInfo1.Offer = (int)reader["Offer"];
     playerInfo1.Win = (int)reader["Win"];
     playerInfo1.Total = (int)reader["Total"];
     playerInfo1.Escape = (int)reader["Escape"];
     playerInfo1.Skin = reader["Skin"] == null ? "" : reader["Skin"].ToString();
     playerInfo1.IsBanChat = (bool)reader["IsBanChat"];
     playerInfo1.ReputeOffer = (int)reader["ReputeOffer"];
     playerInfo1.ConsortiaRepute = (int)reader["ConsortiaRepute"];
     playerInfo1.ConsortiaLevel = (int)reader["ConsortiaLevel"];
     playerInfo1.StoreLevel = (int)reader["StoreLevel"];
     playerInfo1.ShopLevel = (int)reader["ShopLevel"];
     playerInfo1.SmithLevel = (int)reader["SmithLevel"];
     playerInfo1.ConsortiaHonor = (int)reader["ConsortiaHonor"];
     playerInfo1.RichesOffer = (int)reader["RichesOffer"];
     playerInfo1.RichesRob = (int)reader["RichesRob"];
     playerInfo1.AntiAddiction = (int)reader["AntiAddiction"];
     playerInfo1.DutyLevel = (int)reader["DutyLevel"];
     playerInfo1.DutyName = reader["DutyName"] == null ? "" : reader["DutyName"].ToString();
     playerInfo1.Right = (int)reader["Right"];
     playerInfo1.ChairmanName = reader["ChairmanName"] == null ? "" : reader["ChairmanName"].ToString();
     playerInfo1.AddDayGP = (int)reader["AddDayGP"];
     playerInfo1.AddDayOffer = (int)reader["AddDayOffer"];
     playerInfo1.AddWeekGP = (int)reader["AddWeekGP"];
     playerInfo1.AddWeekOffer = (int)reader["AddWeekOffer"];
     playerInfo1.ConsortiaRiches = (int)reader["ConsortiaRiches"];
     playerInfo1.CheckCount = (int)reader["CheckCount"];
     playerInfo1.IsMarried = (bool)reader["IsMarried"];
     playerInfo1.SpouseID = (int)reader["SpouseID"];
     playerInfo1.SpouseName = reader["SpouseName"] == null ? "" : reader["SpouseName"].ToString();
     playerInfo1.MarryInfoID = (int)reader["MarryInfoID"];
     playerInfo1.IsCreatedMarryRoom = (bool)reader["IsCreatedMarryRoom"];
     playerInfo1.DayLoginCount = (int)reader["DayLoginCount"];
     playerInfo1.PasswordTwo = reader["PasswordTwo"] == null ? "" : reader["PasswordTwo"].ToString();
     playerInfo1.SelfMarryRoomID = (int)reader["SelfMarryRoomID"];
     playerInfo1.IsGotRing = (bool)reader["IsGotRing"];
     playerInfo1.Rename = (bool)reader["Rename"];
     playerInfo1.ConsortiaRename = (bool)reader["ConsortiaRename"];
     playerInfo1.IsDirty = false;
     playerInfo1.IsFirst = (int)reader["IsFirst"];
     playerInfo1.Nimbus = (int)reader["Nimbus"];
     playerInfo1.LastAward = (DateTime)reader["LastAward"];
     playerInfo1.GiftToken = (int)reader["GiftToken"];
     playerInfo1.QuestSite = reader["QuestSite"] == null ? new byte[200] : (byte[])reader["QuestSite"];
     playerInfo1.PvePermission = reader["PvePermission"] == null ? "" : reader["PvePermission"].ToString();
     playerInfo1.FightPower = (int)reader["FightPower"];
     playerInfo1.PasswordQuest1 = reader["PasswordQuestion1"] == null ? "" : reader["PasswordQuestion1"].ToString();
     playerInfo1.PasswordQuest2 = reader["PasswordQuestion2"] == null ? "" : reader["PasswordQuestion2"].ToString();
     PlayerInfo playerInfo2 = playerInfo1;
     DateTime dateTime = (DateTime)reader["LastFindDate"];
     playerInfo2.FailedPasswordAttemptCount = (int)reader["FailedPasswordAttemptCount"];
     playerInfo1.AnswerSite = (int)reader["AnswerSite"];
     playerInfo1.medal = (int)reader["Medal"];
     playerInfo1.ChatCount = (int)reader["ChatCount"];
     playerInfo1.SpaPubGoldRoomLimit = (int)reader["SpaPubGoldRoomLimit"];
     playerInfo1.LastSpaDate = (DateTime)reader["LastSpaDate"];
     playerInfo1.FightLabPermission = (string)reader["FightLabPermission"];
     playerInfo1.SpaPubMoneyRoomLimit = (int)reader["SpaPubMoneyRoomLimit"];
     playerInfo1.IsInSpaPubGoldToday = (bool)reader["IsInSpaPubGoldToday"];
     playerInfo1.IsInSpaPubMoneyToday = (bool)reader["IsInSpaPubMoneyToday"];
     playerInfo1.AchievementPoint = (int)reader["AchievementPoint"];
     playerInfo1.LastWeekly = (DateTime)reader["LastWeekly"];
     playerInfo1.LastWeeklyVersion = (int)reader["LastWeeklyVersion"];
     playerInfo1.GiftGp = (int)reader["GiftGp"];
     playerInfo1.GiftLevel = (int)reader["GiftLevel"];
     playerInfo1.IsOpenGift = (bool)reader["IsOpenGift"];
     playerInfo1.badgeID = (int)reader["badgeID"];
     playerInfo1.typeVIP = Convert.ToByte(reader["typeVIP"]);
     playerInfo1.VIPLevel = (int)reader["VIPLevel"];
     playerInfo1.VIPExp = (int)reader["VIPExp"];
     playerInfo1.VIPExpireDay = (DateTime)reader["VIPExpireDay"];
     playerInfo1.LastVIPPackTime = (DateTime)reader["LastVIPPackTime"];
     playerInfo1.CanTakeVipReward = (bool)reader["CanTakeVipReward"];
     playerInfo1.WeaklessGuildProgressStr = (string)reader["WeaklessGuildProgressStr"];
     playerInfo1.IsOldPlayer = (bool)reader["IsOldPlayer"];
     playerInfo1.LastDate = (DateTime)reader["LastDate"];
     playerInfo1.VIPLastDate = (DateTime)reader["VIPLastDate"];
     playerInfo1.Score = (int)reader["Score"];
     playerInfo1.OptionOnOff = (int)reader["OptionOnOff"];
     playerInfo1.isOldPlayerHasValidEquitAtLogin = (bool)reader["isOldPlayerHasValidEquitAtLogin"];
     playerInfo1.badLuckNumber = (int)reader["badLuckNumber"];
     playerInfo1.luckyNum = (int)reader["luckyNum"];
     playerInfo1.lastLuckyNumDate = (DateTime)reader["lastLuckyNumDate"];
     playerInfo1.lastLuckNum = (int)reader["lastLuckNum"];
     playerInfo1.CardSoul = (int)reader["CardSoul"];
     playerInfo1.uesedFinishTime = (int)reader["uesedFinishTime"];
     playerInfo1.totemId = (int)reader["totemId"];
     playerInfo1.damageScores = (int)reader["damageScores"];
     playerInfo1.petScore = (int)reader["petScore"];
     playerInfo1.IsShowConsortia = (bool)reader["IsShowConsortia"];
     playerInfo1.LastRefreshPet = (DateTime)reader["LastRefreshPet"];
     playerInfo1.GetSoulCount = (int)reader["GetSoulCount"];
     playerInfo1.isFirstDivorce = (int)reader["isFirstDivorce"];
     playerInfo1.myScore = (int)reader["myScore"];
     playerInfo1.LastGetEgg = (DateTime)reader["LastGetEgg"];
     playerInfo1.TimeBox = (DateTime)reader["TimeBox"];
     playerInfo1.IsFistGetPet = (bool)reader["IsFistGetPet"];
     playerInfo1.myHonor = (int)reader["myHonor"];
     playerInfo1.hardCurrency = (int)reader["hardCurrency"];
     playerInfo1.MaxBuyHonor = (int)reader["MaxBuyHonor"];
     playerInfo1.LeagueMoney = (int)reader["LeagueMoney"];
     playerInfo1.Honor = (string)reader["Honor"];
     playerInfo1.necklaceExp = (int)reader["necklaceExp"];
     playerInfo1.necklaceExpAdd = (int)reader["necklaceExpAdd"];
     return playerInfo1;
 }
示例#26
0
 public bool LoadFromDatabase()
 {
     using (PlayerBussiness db = new PlayerBussiness())
     {
         PlayerInfo detail = db.GetUserSingleByUserID(m_character.ID);
         if (detail == null)
         {
             Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Forbid"));
             Client.Disconnect();
             return false;
         }
         else
         {
             m_character = detail;
         }
         ChargeToUser();
         int[] sole = new int[] { 0, 1, 2 };
         Out.SendUpdateInventorySlot(FightBag, sole);
         UpdateItemForUser(1);
         UpdateVIPForUser();
         //AddGP(0);
         UpdateWeapon(m_mainBag.GetItemAt(6));
         UpdateSecondWeapon(m_mainBag.GetItemAt(15));
         m_pvepermissions = string.IsNullOrEmpty(detail.PvePermission) ? InitPvePermission() : m_converter.GetBytes(detail.PvePermission);
         _friends = new Dictionary<int, int>();
         _friends = db.GetFriendsIDAll(m_character.ID);
         m_character.State = 1;
         db.UpdatePlayer(m_character);
         //  db.UpdateVIPInfo(m_character);
         return true;
     }
 }
示例#27
0
 public bool UpdatePlayerMarry(PlayerInfo player)
 {
     bool flag = false;
     try
     {
         flag = this.db.RunProcedure("SP_Users_Marry", new SqlParameter[7]
     {
       new SqlParameter("@UserID", (object) player.ID),
       new SqlParameter("@IsMarried", (object) (int) (player.IsMarried ? 1 : 0)),
       new SqlParameter("@SpouseID", (object) player.SpouseID),
       new SqlParameter("@SpouseName", (object) player.SpouseName),
       new SqlParameter("@IsCreatedMarryRoom", (object) (int) (player.IsCreatedMarryRoom ? 1 : 0)),
       new SqlParameter("@SelfMarryRoomID", (object) player.SelfMarryRoomID),
       new SqlParameter("@IsGotRing", (object) (int) (player.IsGotRing ? 1 : 0))
     });
     }
     catch (Exception ex)
     {
         if (BaseBussiness.log.IsErrorEnabled)
             BaseBussiness.log.Error((object)"UpdatePlayerMarry", ex);
     }
     return flag;
 }
示例#28
0
        public GamePlayer(int playerId, string account, GameClient client, PlayerInfo info)
            : base()
        {
            m_playerId = playerId;
            m_account = account;
            m_client = client;
            m_character = info;
            LastChatTime = DateTime.Today;
            m_mainBag = new PlayerEquipInventory(this);
            m_propBag = new PlayerInventory(this, true, 50, (int)eBageType.PropBag, 0, true);
            m_storeBag = new PlayerInventory(this, true, 100, (int)eBageType.Bank, 0, true);//bank
            m_storeBag2 = new PlayerInventory(this, true, 20, (int)eBageType.Store, 0, true);
            m_fightBag = new PlayerInventory(this, false, 3, (int)eBageType.FightBag, 0, false);
            m_tempBag = new PlayerInventory(this, false, 60, (int)eBageType.TempBag, 0, true);
            m_caddyBag = new PlayerInventory(this, false, 30, (int)eBageType.CaddyBag, 0, true);
            m_farm = new PlayerInventory(this, false, 30, (int)eBageType.FARM, 0, true);
            m_vegetable = new PlayerInventory(this, false, 30, (int)eBageType.VEGETABLE, 0, true);
            m_food = new PlayerInventory(this, false, 30, (int)eBageType.FOOD, 0, true);
            m_petEgg = new PlayerInventory(this, false, 30, (int)eBageType.PETEGG, 0, false);

            m_cardBag = new PlayerInventory(this, true, 20, 15, 0, true);
            m_questInventory = new QuestInventory(this);
            m_bufferList = new BufferList(this);
            m_equipEffect = new List<int>();

            //双倍经验卡初始化
            GPAddPlus = 1;

            X = 646;
            Y = 1241;
            MarryMap = 0;
            m_converter = new System.Text.UTF8Encoding();
        }
示例#29
0
        public virtual PlayerInfo LoginGame(string name, string pass, ref bool isFirst)
        {
            try
            {
                using (CenterServiceClient client = new CenterServiceClient())
                {
                    int userID = 0;
                    if (client.ValidateLoginAndGetID(name, pass, ref userID, ref isFirst))
                    {
                        PlayerInfo player = new PlayerInfo();
                        player.ID = userID;
                        player.UserName = name;
                        return player;
                    }
                }

            }
            catch (Exception ex)
            {
                log.Error("LoginGame", ex);
            }

            return null;
        }
示例#30
0
 public void SendUpdatePrivateInfo(SqlDataProvider.Data.PlayerInfo info)
 {
     throw new NotImplementedException();
 }
示例#31
0
        public GSPacketIn SendUpdatePublicPlayer(PlayerInfo info)
        {
            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.UPDATE_PlAYER_INFO, info.ID);
            pkg.WriteInt(info.GP);
            pkg.WriteInt(info.Offer);
            pkg.WriteInt(info.RichesOffer);
            pkg.WriteInt(info.RichesRob);
            pkg.WriteInt(info.Win);
            pkg.WriteInt(info.Total);
            pkg.WriteInt(info.Escape);

            pkg.WriteInt(info.Attack);
            pkg.WriteInt(info.Defence);
            pkg.WriteInt(info.Agility);
            pkg.WriteInt(info.Luck);
            pkg.WriteInt(info.Hide);
            //pkg.WriteInt(info.Grade);
            pkg.WriteString(info.Style);
            pkg.WriteString(info.Colors);
            pkg.WriteString(info.Skin);

            pkg.WriteInt(info.ConsortiaID);
            pkg.WriteString(info.ConsortiaName);
            pkg.WriteInt(info.ConsortiaLevel);
            pkg.WriteInt(info.ConsortiaRepute);

            pkg.WriteInt(info.Nimbus);
            //PVE难度等级测试
            pkg.WriteString(info.PvePermission);
            //fightPermission
            //pkg.WriteString(info.PvePermission);
            pkg.WriteString("1");
            pkg.WriteInt(info.FightPower);

            //info.apprenticeshipState = pkg.readInt();
            //info.masterID = pkg.readInt();
            //info.setMasterOrApprentices(pkg.readUTF());
            //info.graduatesCount = pkg.readInt();
            //info.honourOfMaster = pkg.readUTF();
            pkg.WriteInt(1);
            pkg.WriteInt(-1);
            pkg.WriteString("ss");
            pkg.WriteInt(1);
            pkg.WriteString("ss");
            ////AchievementPoint
            pkg.WriteInt(0);
            ////honor
            pkg.WriteString("honor");
            //LastSpaDate
            if (info.ExpendDate != null)
                pkg.WriteDateTime((DateTime)info.ExpendDate);
            else { pkg.WriteDateTime(DateTime.MinValue); }
            //charmgp
            pkg.WriteInt(100);
            //consortiaCharmGP
            pkg.WriteInt(100);

            pkg.WriteDateTime(DateTime.MinValue);
            ////DeputyWeaponID
            pkg.WriteInt(10001);
            pkg.WriteInt(0);
            // box gi ko biet
            pkg.WriteInt(info.AnswerSite);
            // pkg.WriteInt(0);
            SendTCP(pkg);


            return pkg;
        }
示例#32
0
 public GSPacketIn SendUpdatePublicPlayer(SqlDataProvider.Data.PlayerInfo info)
 {
     throw new NotImplementedException();
 }
示例#33
0
        public void HandleGameRoomCreate(GSPacketIn pkg)
        {
            int roomId = pkg.ReadInt();
            int gameType = pkg.ReadInt();
            int guildId = pkg.ReadInt();

            int count = pkg.ReadInt();
            int totalLevel = 0;
            IGamePlayer[] players = new IGamePlayer[count];
            for (int i = 0; i < count; i++)
            {
                PlayerInfo info = new PlayerInfo();
                info.ID = pkg.ReadInt();
                info.NickName = pkg.ReadString();
                info.Sex = pkg.ReadBoolean();
                info.Hide = pkg.ReadInt();
                info.Style = pkg.ReadString();
                info.Colors = pkg.ReadString();
                info.Skin = pkg.ReadString();
                info.Offer = pkg.ReadInt();
                info.GP = pkg.ReadInt();
                info.Grade = pkg.ReadInt();
                info.Repute = pkg.ReadInt();
                info.ConsortiaID = pkg.ReadInt();
                info.ConsortiaName = pkg.ReadString();
                info.ConsortiaLevel = pkg.ReadInt();
                info.ConsortiaRepute = pkg.ReadInt();

                info.Attack = pkg.ReadInt();
                info.Defence = pkg.ReadInt();
                info.Agility = pkg.ReadInt();
                info.Luck = pkg.ReadInt();

                double baseAttack = pkg.ReadDouble();
                double baseDefence = pkg.ReadDouble();
                double baseAgility = pkg.ReadDouble();
                double baseBlood = pkg.ReadDouble();
                int templateId = pkg.ReadInt();
                bool canUserProp = pkg.ReadBoolean();
                int secondWeapon = pkg.ReadInt();
                int strengthLevel = pkg.ReadInt();


                double gprate = pkg.ReadDouble();
                double offerrate = pkg.ReadDouble();
                double rate = pkg.ReadDouble();
                int serverid = pkg.ReadInt();

                ItemTemplateInfo itemTemplate = ItemMgr.FindItemTemplate(templateId);
                ItemInfo item = null;
                if (secondWeapon != 0)
                {
                    ItemTemplateInfo secondWeaponTemp = ItemMgr.FindItemTemplate(secondWeapon);
                    item = ItemInfo.CreateFromTemplate(secondWeaponTemp, 1, 1);
                    item.StrengthenLevel = strengthLevel;
                }

                List<BufferInfo> infos = new List<BufferInfo>();

                int buffercout = pkg.ReadInt();
                for (int j = 0; j < buffercout; j++)
                {
                    BufferInfo buffinfo = new BufferInfo();
                    buffinfo.Type = pkg.ReadInt();
                    buffinfo.IsExist = pkg.ReadBoolean();
                    buffinfo.BeginDate = pkg.ReadDateTime();
                    buffinfo.ValidDate = pkg.ReadInt();
                    buffinfo.Value = pkg.ReadInt();
                    if (info != null)
                        infos.Add(buffinfo);
                }

                players[i] = new ProxyPlayer(this, info, itemTemplate, item, baseAttack, baseDefence, baseAgility, baseBlood, gprate, offerrate, rate, infos, serverid);
                players[i].CanUseProp = canUserProp;

                int ec = pkg.ReadInt();
                for (int j = 0; j < ec; j++)
                {
                    players[i].EquipEffect.Add(pkg.ReadInt());
                }
                totalLevel += info.Grade;
            }

            ProxyRoom room = new ProxyRoom(ProxyRoomMgr.NextRoomId(), roomId, players, this);
            room.GuildId = guildId;
            room.GameType = (eGameType)gameType;

            lock (m_rooms)
            {
                if (!m_rooms.ContainsKey(roomId))
                {
                    m_rooms.Add(roomId, room);
                }
                else
                {
                    room = null;
                }
            }

            if (room != null)
            {
                ProxyRoomMgr.AddRoom(room);
            }
            else
            {
                log.ErrorFormat("Room already exists:{0}", roomId);
            }
        }
示例#34
0
 public bool UpdateVIPInfo(PlayerInfo p)
 {
     bool flag = false;
     try
     {
         SqlParameter[] sqlParameters = new SqlParameter[] {
             new SqlParameter("@UserID", p.ID),
             new SqlParameter("@VIPLevel", p.VIPLevel),
             new SqlParameter("@VIPExp", p.VIPExp),
             new SqlParameter("@VIPOnlineDays", p.VIPOnlineDays),
             new SqlParameter("@VIPOfflineDays", p.VIPOfflineDays),
             new SqlParameter("@VIPExpireDay", p.VIPExpireDay.ToString()),
             new SqlParameter("@VIPLastDate", DateTime.Now),
             new SqlParameter("@VIPNextLevelDaysNeeded", p.VIPNextLevelDaysNeeded),
             new SqlParameter("@CanTakeVipReward", p.CanTakeVipReward),
             new SqlParameter("@Result", SqlDbType.Int) };
         sqlParameters[9].Direction = ParameterDirection.ReturnValue;
         db.RunProcedure("SP_UpdateVIPInfo", sqlParameters);
         //p.IsDirty = false;
         flag = true;
     }
     catch (Exception exception)
     {
         if (BaseBussiness.log.IsErrorEnabled)
         {
             BaseBussiness.log.Error("SP_UpdateVIPInfo", exception);
         }
     }
     return flag;
 }