Пример #1
0
        public void HandleClientChargeMoney(string userID, int rid, int addMoney, bool transmit, int superInputFanLi = 0)
        {
            JieriIPointsExchgActivity act = HuodongCachingMgr.GetJieriIPointsExchgActivity();

            if (null != act)
            {
                act.OnMoneyChargeEvent(userID, rid, addMoney);
            }
            EverydayActivity everyAct = HuodongCachingMgr.GetEverydayActivity();

            if (null != everyAct)
            {
                everyAct.OnMoneyChargeEvent(userID, rid, addMoney);
            }
            SpecPriorityActivity spAct = HuodongCachingMgr.GetSpecPriorityActivity();

            if (null != everyAct)
            {
                spAct.OnMoneyChargeEvent(userID, rid, addMoney);
            }
            if (superInputFanLi > 0)
            {
                JieriSuperInputActivity siAct = HuodongCachingMgr.GetJieRiSuperInputActivity();
                if (null != siAct)
                {
                    siAct.OnMoneyChargeEvent(userID, rid, addMoney, superInputFanLi);
                }
            }
            TMSKSocket clientSocket = GameManager.OnlineUserSession.FindSocketByUserID(userID);

            if (null == clientSocket)
            {
                SpecialActivity specAct = HuodongCachingMgr.GetSpecialActivity();
                if (null != specAct)
                {
                    specAct.OnMoneyChargeEventOffLine(userID, rid, addMoney);
                }
            }
            else
            {
                if (transmit)
                {
                    LogManager.WriteLog(LogTypes.SQL, string.Format("通知账户ID{0}的角色更新元宝数量", userID), null, true);
                }
                GameClient otherClient = GameManager.ClientMgr.FindClient(clientSocket);
                if (null != otherClient)
                {
                    SpecialActivity specAct = HuodongCachingMgr.GetSpecialActivity();
                    if (null != specAct)
                    {
                        specAct.OnMoneyChargeEventOnLine(otherClient, addMoney);
                    }
                    GameManager.ClientMgr.AddUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, otherClient, 0, "", ActivityTypes.None, "");
                    GameManager.logDBCmdMgr.AddDBLogInfo(-1, "钻石", "GM命令强迫更新", "系统", otherClient.ClientData.RoleName, "增加", addMoney, otherClient.ClientData.ZoneID, otherClient.strUserID, otherClient.ClientData.UserMoney, otherClient.ServerId, null);
                    otherClient._IconStateMgr.FlushChongZhiIconState(otherClient);
                    otherClient._IconStateMgr.CheckJieRiActivity(otherClient, false);
                    otherClient._IconStateMgr.SendIconStateToClient(otherClient);
                    UserReturnManager.getInstance().initUserReturnData(otherClient);
                    SingletonTemplate <SevenDayActivityMgr> .Instance().OnCharge(otherClient);

                    FundManager.initFundData(otherClient);
                }
                else
                {
                    SpecialActivity specAct = HuodongCachingMgr.GetSpecialActivity();
                    if (null != specAct)
                    {
                        specAct.OnMoneyChargeEventOffLine(userID, rid, addMoney);
                    }
                }
            }
        }
Пример #2
0
 public void InitFirstChargeConfigData()
 {
     try
     {
         string strCmd = GameManager.GameConfigMgr.GetGameConfigItemStr("platformtype", "app");
         strCmd = strCmd.ToLower();
         string             sectionKey = string.Empty;
         ChargePlatformType cpt;
         if (strCmd == "app")
         {
             sectionKey = "dl_app";
             cpt        = ChargePlatformType.CPT_App;
         }
         else if (strCmd == "yueyu")
         {
             sectionKey = "dl_yueyu";
             cpt        = ChargePlatformType.CPT_YueYu;
         }
         else if (strCmd == "andrid" || strCmd == "android" || strCmd == "yyb")
         {
             sectionKey = "dl_android";
             cpt        = ChargePlatformType.CPT_Android;
         }
         else
         {
             sectionKey = "dl_app";
             cpt        = ChargePlatformType.CPT_App;
         }
         GeneralCachingXmlMgr.RemoveCachingXml(Global.GameResPath("Config/MU_ChongZhi.xml"));
         XElement xml = GeneralCachingXmlMgr.GetXElement(Global.GameResPath("Config/MU_ChongZhi.xml"));
         if (xml != null)
         {
             IEnumerable <XElement> xmlItems   = xml.Elements().First((XElement _xml) => _xml.Attribute("TypeID").Value.ToString().ToLower() == sectionKey).Elements();
             SingleChargeData       chargeData = new SingleChargeData();
             chargeData.YueKaBangZuan  = GameManager.PlatConfigMgr.GetGameConfigItemInt("YueKaBangZuan", 0);
             chargeData.ChargePlatType = (int)cpt;
             foreach (XElement item in xmlItems)
             {
                 if (null != item)
                 {
                     int money     = (int)Global.GetSafeAttributeLong(item, "RMB");
                     int bindmoney = (int)Global.GetSafeAttributeLong(item, "FirstBindZuanShi");
                     int id        = (int)Global.GetSafeAttributeLong(item, "ID");
                     if (id == YueKaManager.YUE_KA_MONEY_ID_IN_CHARGE_FILE)
                     {
                         chargeData.YueKaMoney = money;
                     }
                     chargeData.ChargeIDVsMoneyDict[id]    = money;
                     chargeData.MoneyVsChargeIDDict[money] = id;
                     if (!chargeData.singleData.ContainsKey(money))
                     {
                         chargeData.singleData[money] = bindmoney;
                     }
                 }
             }
             JieriSuperInputActivity jsiAct = HuodongCachingMgr.GetJieRiSuperInputActivity();
             if (null != jsiAct)
             {
                 jsiAct.FilterSingleChargeData(chargeData);
             }
             if (1 == Global.sendToDB <int, byte[]>(10171, DataHelper.ObjectToBytes <SingleChargeData>(chargeData), 0))
             {
                 Data.ChargeData = chargeData;
             }
         }
         else
         {
             LogManager.WriteLog(LogTypes.Fatal, string.Format("丢失平台充值配置文件{0}", "Config/MU_ChongZhi.xml"), null, true);
         }
     }
     catch (Exception e)
     {
         LogManager.WriteException("读取充值xml错误:" + e.ToString());
     }
 }