1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using CommonAI.ZoneClient;
- using CommonLang.Property;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace XmdsBotTest.Runner
- {
- public class ModuleReconnect : BotRunner.RunnerModule
- {
- public ModuleReconnect() {
- module_name = "断线重连";
- }
- public ModuleReconnect(BotRunner r) : base(r)
- {
- }
- protected internal override void OnBattleActorReady(ZoneLayer layer, ZoneActor actor)
- {
- layer.AddTimePeriodicMS(bot.Random.Next(Config.IntervalMS_Min, Config.IntervalMS_Max), (t) =>
- {
- if (Enable)
- {
- runner.reconnect();
- }
- });
- }
- [Desc("重连配置")]
- [Expandable]
- public class Config : ConfigBase
- {
- [Desc("重连间隔")]
- public static int IntervalMS_Min = 300000;
- [Desc("重连间隔")]
- public static int IntervalMS_Max = 1200000;
- public override string ToString()
- {
- return "重连配置";
- }
- public override void popG2DPropertyDialog()
- {
- CommonFroms.G2D.G2DPropertyDialog<ModuleReconnect.Config>.Show("修改配置", this);
- }
- }
- }
- }
|