コード例 #1
0
        /// <summary>
        /// 声望军衔——设置等级
        /// </summary>
        /// <param name="client"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public static void SetPrestigeLevel(GameClient client, int level)
        {
            //更新到数据库
            Global.SaveRoleParamsInt32ValueWithTimeStampToDB(client, RoleParamName.ShengWangLevel, level, true);
            GameManager.logDBCmdMgr.AddDBLogInfo(-1, "声望等级", "GM", "系统", client.ClientData.RoleName, "修改", level, client.ClientData.ZoneID, client.strUserID, level, client.ServerId);

            EventLogManager.AddRoleEvent(client, OpTypes.Trace, OpTags.GM, LogRecordType.IntValueWithType, level, RoleAttributeType.ShengWangLevel);
            if (level > 0)
            {
                JingJiChangManager.getInstance().activeJunXianBuff(client, true);
            }

            //更新BufferData
            double[] actionParams = new double[1];
            actionParams[0] = (double)level - 1;
            Global.UpdateBufferData(client, BufferItemTypes.MU_JINGJICHANG_JUNXIAN, actionParams, 0);

            ChengJiuManager.OnRoleJunXianChengJiu(client);
            Global.BroadcastClientMUShengWang(client, level);

            //通知自己
            GameManager.ClientMgr.NotifySelfParamsValueChange(client, RoleCommonUseIntParamsIndexs.ShengWangLevel, level);
            //通知客户端属性变化
            GameManager.ClientMgr.NotifyUpdateEquipProps(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client);
            // 总生命值和魔法值变化通知(同一个地图才需要通知)
            GameManager.ClientMgr.NotifyOthersLifeChanged(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client);

            // 军衔升级成功时,刷新相应的图标状态
            client._IconStateMgr.CheckJingJiChangJunXian(client);
            client._IconStateMgr.CheckSpecialActivity(client);
            client._IconStateMgr.SendIconStateToClient(client);
        }
コード例 #2
0
 public static void SetPrestigeLevel(GameClient client, int level)
 {
     Global.SaveRoleParamsInt32ValueWithTimeStampToDB(client, "ShengWangLevel", level, true, "2020-12-12 12:12:12");
     GameManager.logDBCmdMgr.AddDBLogInfo(-1, "声望等级", "GM", "系统", client.ClientData.RoleName, "修改", level, client.ClientData.ZoneID, client.strUserID, level, client.ServerId, null);
     EventLogManager.AddRoleEvent(client, OpTypes.Trace, OpTags.GM, LogRecordType.IntValueWithType, new object[]
     {
         level,
         RoleAttributeType.ShengWangLevel
     });
     if (level > 0)
     {
         JingJiChangManager.getInstance().activeJunXianBuff(client, true);
     }
     Global.UpdateBufferData(client, BufferItemTypes.MU_JINGJICHANG_JUNXIAN, new double[]
     {
         (double)level - 1.0
     }, 0, true);
     ChengJiuManager.OnRoleJunXianChengJiu(client);
     Global.BroadcastClientMUShengWang(client, level);
     GameManager.ClientMgr.NotifySelfParamsValueChange(client, RoleCommonUseIntParamsIndexs.ShengWangLevel, level);
     GameManager.ClientMgr.NotifyUpdateEquipProps(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client);
     GameManager.ClientMgr.NotifyOthersLifeChanged(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, true, false, 7);
     client._IconStateMgr.CheckJingJiChangJunXian(client);
     client._IconStateMgr.CheckSpecialActivity(client);
     client._IconStateMgr.CheckEverydayActivity(client);
     client._IconStateMgr.SendIconStateToClient(client);
 }
コード例 #3
0
 public TarotManager.ETarotResult ProcessTarotMoneyCmd(GameClient client, int goodId, int num, int dbid, out int resNum)
 {
     resNum = 0;
     TarotManager.ETarotResult result;
     if (!GlobalNew.IsGongNengOpened(client, GongNengIDs.TarotCard, false))
     {
         result = TarotManager.ETarotResult.NotOpen;
     }
     else
     {
         GoodsData Data = Global.GetGoodsByDbID(client, dbid);
         if (Data == null)
         {
             result = TarotManager.ETarotResult.Error;
         }
         else if (TarotManager.TarotNeedCardNum.ContainsKey(goodId))
         {
             if (num < 0 || num > Data.GCount)
             {
                 result = TarotManager.ETarotResult.MoneyNumError;
             }
             else
             {
                 TarotManager.TarotTemplate nextTemp = TarotManager.TarotTemplates.Find((TarotManager.TarotTemplate x) => x.NeedGoodID == goodId);
                 if (nextTemp == null)
                 {
                     result = TarotManager.ETarotResult.NotFindGood;
                 }
                 else
                 {
                     TarotSystemData tarotData    = client.ClientData.TarotData;
                     TarotCardData   currentTarot = tarotData.TarotCardDatas.Find((TarotCardData x) => x.GoodId == nextTemp.GoodsID);
                     if (currentTarot == null)
                     {
                         currentTarot        = new TarotCardData();
                         currentTarot.GoodId = nextTemp.GoodsID;
                         tarotData.TarotCardDatas.Add(currentTarot);
                     }
                     int reNum = TarotManager.TarotNeedCardNum[goodId] - this.CountTarotNowToCurrLevel(goodId, currentTarot.Level) - currentTarot.TarotMoney;
                     if (reNum == 0)
                     {
                         result = TarotManager.ETarotResult.HasMaxNum;
                     }
                     else
                     {
                         if (num > reNum)
                         {
                             num = reNum;
                         }
                         if (GameManager.ClientMgr.NotifyUseGoodsByDbId(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, dbid, num, false, false))
                         {
                             GoodsData goodsData = Global.GetGoodsByDbID(client, dbid);
                             if (null != goodsData)
                             {
                                 resNum = goodsData.GCount;
                             }
                             currentTarot.TarotMoney += num;
                             EventLogManager.AddRoleEvent(client, OpTypes.Trace, OpTags.TarotMoney, LogRecordType.TarotMoney, new object[]
                             {
                                 num,
                                 currentTarot.TarotMoney,
                                 dbid,
                                 "塔罗牌货币增加"
                             });
                             this.UpdataPalyerTarotAttr(client);
                             TarotManager.UpdateTarotData2DB(client, currentTarot, null);
                             GameManager.logDBCmdMgr.AddDBLogInfo(dbid, "塔罗牌货币", "塔罗牌", client.ClientData.RoleName, "系统", "修改", 0, client.ClientData.ZoneID, client.strUserID, num, client.ServerId, null);
                             result = TarotManager.ETarotResult.Success;
                         }
                         else
                         {
                             result = TarotManager.ETarotResult.UseGoodError;
                         }
                     }
                 }
             }
         }
         else
         {
             result = TarotManager.ETarotResult.GoodIdError;
         }
     }
     return(result);
 }