12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- 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;
- using pomelo.five2five;
- namespace XmdsBotTest.Runner
- {
- public class Five2FiveFunc : BotRunner.RunnerModule
- {
- public Five2FiveFunc() {
- module_name = "试炼大赛";
- }
- public Five2FiveFunc(BotRunner r) : base(r)
- {
- bot.Client.GameSocket.listen<Five2FiveMatchMemberInfoPush>(on_five2FiveMatchMemberInfoPush);
- }
- protected internal override void OnGateBindPlayer(BindPlayerResponse e)
- {
- base.OnGateBindPlayer(e);
- }
- protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
- {
- layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
- {
- if (IsCanJoin)
- {
- Five2FiveMatchRequest();
- }
- });
- }
- private void Five2FiveMatchRequest()
- {
- client.GameSocket.five2FiveHandler.five2FiveMatchRequest(1,
- (err, rsp) =>
- { });
- }
- private void on_five2FiveMatchMemberInfoPush(Five2FiveMatchMemberInfoPush e)
- {
- client.GameSocket.five2FiveHandler.five2FiveReadyRequest(e.tempTeamId,
- (err, rsp) =>
- { });
- }
- protected override int rand()
- {
- return Config.RandNum;
- }
- [Desc("试炼大赛配置")]
- [Expandable]
- public class Config : ConfigBase
- {
- [Desc("试炼大赛检测间隔")]
- public static int CheckIntervalMS = 5000;
- [Desc("试炼大赛随机数")]
- public static int RandNum = 8;
- public override string ToString()
- {
- return "试炼大赛";
- }
- public override void popG2DPropertyDialog()
- {
- CommonFroms.G2D.G2DPropertyDialog<Five2FiveFunc.Config>.Show("修改配置", this);
- }
- }
- }
- }
|