Example #1
0
        protected bool GiveEffectiveTimeAward(GameClient client, AwardItem myAwardItem)
        {
            bool result;

            if (client == null || null == myAwardItem)
            {
                result = false;
            }
            else
            {
                if (myAwardItem.GoodsDataList != null)
                {
                    for (int i = 0; i < myAwardItem.GoodsDataList.Count; i++)
                    {
                        int nGoodsID = myAwardItem.GoodsDataList[i].GoodsID;
                        if (Global.IsCanGiveRewardByOccupation(client, nGoodsID))
                        {
                            client.ClientData.AddAwardRecord((RoleAwardMsg)this.ActivityType, myAwardItem.GoodsDataList[i], false);
                            Global.AddEffectiveTimeGoodsDBCommand(Global._TCPManager.TcpOutPacketPool, client, myAwardItem.GoodsDataList[i].GoodsID, myAwardItem.GoodsDataList[i].GCount, myAwardItem.GoodsDataList[i].Quality, "", myAwardItem.GoodsDataList[i].Forge_level, myAwardItem.GoodsDataList[i].Binding, 0, "", false, 1, Activity.GetActivityChineseName((ActivityTypes)this.ActivityType), myAwardItem.GoodsDataList[i].Starttime, myAwardItem.GoodsDataList[i].Endtime, myAwardItem.GoodsDataList[i].AddPropIndex, myAwardItem.GoodsDataList[i].BornIndex, myAwardItem.GoodsDataList[i].Lucky, myAwardItem.GoodsDataList[i].Strong, myAwardItem.GoodsDataList[i].ExcellenceInfo, myAwardItem.GoodsDataList[i].AppendPropLev, myAwardItem.GoodsDataList[i].ChangeLifeLevForEquip, null, null);
                        }
                    }
                }
                if (myAwardItem.AwardYuanBao > 0)
                {
                    GameManager.ClientMgr.AddUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, myAwardItem.AwardYuanBao, string.Format("领取{0}活动奖励", (ActivityTypes)this.ActivityType), ActivityTypes.None, "");
                    GameManager.ClientMgr.NotifyImportantMsg(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, StringUtil.substitute(GLang.GetLang(386, new object[0]), new object[]
                    {
                        myAwardItem.AwardYuanBao
                    }), GameInfoTypeIndexes.Normal, ShowGameInfoTypes.OnlyErr, 0);
                    GameManager.DBCmdMgr.AddDBCmd(10113, string.Format("{0}:{1}:{2}", client.ClientData.RoleID, myAwardItem.AwardYuanBao, string.Format("领取{0}活动奖励", (ActivityTypes)this.ActivityType)), null, client.ServerId);
                }
                result = true;
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// 发放时限性物品
        /// </summary>
        /// <param name="client"></param>
        /// <param name="item"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public bool GiveEffectiveTimeAward(GameClient client, AwardItem item, ESevenDayActType type)
        {
            if (null == client || null == item)
            {
                return(false);
            }

            if (item.GoodsDataList != null)
            {
                for (int i = 0; i < item.GoodsDataList.Count; i++)
                {
                    int nGoodsID = item.GoodsDataList[i].GoodsID; // 物品id

                    if (Global.IsCanGiveRewardByOccupation(client, nGoodsID))
                    {
                        //添加限时物品
                        Global.AddEffectiveTimeGoodsDBCommand(Global._TCPManager.TcpOutPacketPool, client,
                                                              item.GoodsDataList[i].GoodsID, item.GoodsDataList[i].GCount,
                                                              item.GoodsDataList[i].Quality, "", item.GoodsDataList[i].Forge_level,
                                                              item.GoodsDataList[i].Binding, 0, "", false, 1,
                                                              GetActivityChineseName((ESevenDayActType)type), item.GoodsDataList[i].Starttime, item.GoodsDataList[i].Endtime,
                                                              item.GoodsDataList[i].AddPropIndex, item.GoodsDataList[i].BornIndex,
                                                              item.GoodsDataList[i].Lucky, item.GoodsDataList[i].Strong,
                                                              item.GoodsDataList[i].ExcellenceInfo, item.GoodsDataList[i].AppendPropLev, item.GoodsDataList[i].ChangeLifeLevForEquip);
                    }
                }
            }

            return(true);
        }