1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using pomelo.connector;
- using CommonLang.Property;
- using pomelo.area;
- namespace XmdsBotTest.Runner
- {
- public class PrepaidOrderIdWarn : BotRunner.RunnerModule
- {
- public PrepaidOrderIdWarn() {
- module_name = "充值生成订";
- }
- public PrepaidOrderIdWarn(BotRunner r) : base(r)
- {
-
- }
- protected internal override void OnGateBindPlayer(BindPlayerResponse e)
- {
- base.OnGateBindPlayer(e);
- }
- protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
- {
- layer.AddTimeDelayMS(Config.CheckIntervalMS, (t) =>
- {
- if (Enable)
- {
-
- }
- });
- layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
- {
- if (Enable)
- {
- prepaidOrderIdRequest();
- }
- });
- }
- private void prepaidOrderIdRequest()
- {
- client.GameSocket.prepaidHandler.prepaidOrderIdRequest(Config.c2s_productId, 0 , "" , 0,
- (err, rsp) =>
- {
- if (null != rsp && 200 == rsp.s2c_code) {
- Console.WriteLine("OrderId: {0}", rsp.s2c_orderId);
- runner.do_gm_pay_success(rsp.s2c_orderId);
- }
- });
- }
- [Desc("充值生成订单配置")]
- [Expandable]
- public class Config : ConfigBase
- {
- [Desc("充值生成订单检测间隔")]
- public static int CheckIntervalMS = 60*1000;
- public static int c2s_productId = 1; // 充值档
- public static int c2s_type = 0; // 1 表示买卡 2 表示买元宝
- public override string ToString()
- {
- return "充值生成订单配置";
- }
- public override void popG2DPropertyDialog()
- {
- CommonFroms.G2D.G2DPropertyDialog<PrepaidOrderIdWarn.Config>.Show("修改配置", this);
- }
- }
- }
- }
|