コード例 #1
0
ファイル: PaySectionHandler.cs プロジェクト: wjydc/YueDu_v3
        public override object Create(object parent, object configContext, System.Xml.XmlNode section)
        {
            IPaySection model = null;

            if (section != null)
            {
                model = new PaySection();

                XmlNode node = null;

                #region

                if (GetSingleNodeValue(section, "/PaySection/NowPay", out node))
                {
                    model.NowPay.AppId              = GetSingleNodeAttributeValue(node, "item[@key=\"AppId\"]", "value");
                    model.NowPay.AppKey             = GetSingleNodeAttributeValue(node, "item[@key=\"AppKey\"]", "value");
                    model.NowPay.WeChatAppId        = GetSingleNodeAttributeValue(node, "item[@key=\"WeChatAppId\"]", "value");
                    model.NowPay.WeChatAppKey       = GetSingleNodeAttributeValue(node, "item[@key=\"WeChatAppKey\"]", "value");
                    model.NowPay.WeChatQrCodeAppId  = GetSingleNodeAttributeValue(node, "item[@key=\"WeChatQrCodeAppId\"]", "value");
                    model.NowPay.WeChatQrCodeAppKey = GetSingleNodeAttributeValue(node, "item[@key=\"WeChatQrCodeAppKey\"]", "value");
                    model.NowPay.CallbackUrl        = GetSingleNodeAttributeValue(node, "item[@key=\"CallbackUrl\"]", "value");
                    model.NowPay.NewCallbackUrl     = GetSingleNodeAttributeValue(node, "item[@key=\"NewCallbackUrl\"]", "value");
                }
                if (GetSingleNodeValue(section, "/PaySection/WxPay", out node))
                {
                    model.WxPay.AppId       = GetSingleNodeAttributeValue(node, "item[@key=\"AppId\"]", "value");
                    model.WxPay.MchId       = GetSingleNodeAttributeValue(node, "item[@key=\"MchId\"]", "value");
                    model.WxPay.AppKey      = GetSingleNodeAttributeValue(node, "item[@key=\"AppKey\"]", "value");
                    model.WxPay.AppSecret   = GetSingleNodeAttributeValue(node, "item[@key=\"AppSecret\"]", "value");
                    model.WxPay.CallbackUrl = GetSingleNodeAttributeValue(node, "item[@key=\"CallbackUrl\"]", "value");
                    model.WxPay.LogLevel    = GetSingleNodeAttributeValue(node, "item[@key=\"LogLevel\"]", "value");
                }
                if (GetSingleNodeValue(section, "/PaySection/WxPay2", out node))
                {
                    model.WxPay2.AppId       = GetSingleNodeAttributeValue(node, "item[@key=\"AppId\"]", "value");
                    model.WxPay2.MchId       = GetSingleNodeAttributeValue(node, "item[@key=\"MchId\"]", "value");
                    model.WxPay2.AppKey      = GetSingleNodeAttributeValue(node, "item[@key=\"AppKey\"]", "value");
                    model.WxPay2.AppSecret   = GetSingleNodeAttributeValue(node, "item[@key=\"AppSecret\"]", "value");
                    model.WxPay2.CallbackUrl = GetSingleNodeAttributeValue(node, "item[@key=\"CallbackUrl\"]", "value");
                    model.WxPay2.LogLevel    = GetSingleNodeAttributeValue(node, "item[@key=\"LogLevel\"]", "value");
                }
                if (GetSingleNodeValue(section, "/PaySection/Alipay", out node))
                {
                    model.Alipay.SellerEmail  = GetSingleNodeAttributeValue(node, "item[@key=\"SellerEmail\"]", "value");
                    model.Alipay.Partner      = GetSingleNodeAttributeValue(node, "item[@key=\"Partner\"]", "value");
                    model.Alipay.Key          = GetSingleNodeAttributeValue(node, "item[@key=\"Key\"]", "value");
                    model.Alipay.PrivateKey   = GetSingleNodeAttributeValue(node, "item[@key=\"PrivateKey\"]", "value");
                    model.Alipay.PublicKey    = GetSingleNodeAttributeValue(node, "item[@key=\"PublicKey\"]", "value");
                    model.Alipay.InputCharset = GetSingleNodeAttributeValue(node, "item[@key=\"InputCharset\"]", "value");
                    model.Alipay.SignType     = GetSingleNodeAttributeValue(node, "item[@key=\"SignType\"]", "value");
                }

                #endregion
            }

            return(model);
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: neil501/UAASMods
            private static void Prefix(PaySection __instance)
            {
                var instance = PlayerController.instance;

                if (_settings.MinimumReputation > 0)
                {
                    instance.Reputation = Math.Max(_settings.MinimumReputation, instance.Reputation);
                }
                if (_settings.MinimumCash > 0)
                {
                    instance.Gold = Math.Max(_settings.MinimumCash, instance.Gold);
                }
            }
コード例 #3
0
            private static void Prefix(PaySection __instance)
            {
                PlayerController instance = PlayerController.instance;
                bool             flag     = Main._settings.MinimumReputation > 0;

                if (flag)
                {
                    instance.Reputation = Math.Max(Main._settings.MinimumReputation, instance.Reputation);
                }
                bool flag2 = Main._settings.MinimumCash > 0;

                if (flag2)
                {
                    instance.Gold = Math.Max(Main._settings.MinimumCash, instance.Gold);
                }
            }