错误1 赋值问题

貌似编译器版本有点低,无法识别C#的高级语法糖

属性的初始值,必须是public bool IsEnabled { get{return true;} }

不能写成public bool IsEnabled { get; }=true;

Control

Compiler Error: \Plugins\AutoConcede\AutoConcede.cs(75,38) :

error CS0840: 'AutoConcede.AutoConcede.Control.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.
Compiler Error: c:\Users\clu\Desktop\Hearthbuddy 0.3.1446.417\Plugins\AutoConcede\AutoConcede.cs(76,40) : error CS0840: 'AutoConcede.AutoConcede.Settings.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.

2019-07-16 14:22:58,834 [14] DEBUG Logger (null) - [AutoConcede] Initialize

自动投降不工作,提示是

2019-07-16 15:10:03,568 [5] INFO Logger (null) - [Concede] GameState == null.
2019

  1. public static bool Concede(bool logReason)
  2. {
  3. bool result;
  4. try
  5. {
  6. if (GameState.Get() == null)
  7. {
  8. if (logReason)
  9. {
  10. TritonHs.ilog_0.InfoFormat("[Concede] GameState == null.", Array.Empty<object>());
  11. }
  12. result = false;
  13. }
  14. else if (!GameUtils.CanConcedeCurrentMission())
  15. {
  16. TritonHs.ilog_0.InfoFormat("[Concede] !GameUtils.CanConcedeCurrentMission().", Array.Empty<object>());
  17. result = false;
  18. }
  19. else
  20. {
  21. GameState.Get().Concede();
  22. using (TritonHs.Memory.ReleaseFrame(true))
  23. {
  24. Thread.Sleep();
  25. }
  26. result = true;
  27. }
  28. }
  29. catch (Exception ex)
  30. {
  31. if (logReason)
  32. {
  33. TritonHs.ilog_0.InfoFormat("[Concede] An exception occurred. {0}", ex.ToString());
  34. }
  35. result = false;
  36. }
  37. return result;
  38. }

关于在选牌阶段,以及回合开始投降

https://tieba.baidu.com/p/5929349383?red_tag=2707770290

Hearthbuddy\Routines\DefaultRoutine\DefaultRoutine.cs

public async Task MulliganLogic(MulliganData mulliganData)

public async Task OurTurnLogic()

DefaultRoutine继承了Triton.Bot.IRoutine接口

  1. public interface IRoutine : IRunnable, IAuthored, IBase, IConfigurable
  2. {
  3. // Token: 0x06001185 RID: 4485
  4. void SetConfiguration(string name, params object[] param);
  5.  
  6. // Token: 0x06001186 RID: 4486
  7. object GetConfiguration(string name);
  8.  
  9. // Token: 0x06001187 RID: 4487
  10. Task<bool> Logic(string type, object context);
  11. }

主要逻辑的入口,都是在Logic函数里面

  1. /// <summary>
  2. /// The routine's coroutine logic to execute.
  3. /// </summary>
  4. /// <param name="type">The requested type of logic to execute.</param>
  5. /// <param name="context">Data sent to the routine from the bot for the current logic.</param>
  6. /// <returns>true if logic was executed to handle this type and false otherwise.</returns>
  7. public async Task<bool> Logic(string type, object context)
  8. {
  9.  
  10. // The bot is requesting mulligan logic.
  11. if (type == "mulligan")
  12. {
  13. await MulliganLogic(context as MulliganData);
  14. return true;
  15. }
  16.  
  17. // The bot is requesting emote logic.
  18. if (type == "emote")
  19. {
  20. await EmoteLogic(context as EmoteData);
  21. return true;
  22. }
  23.  
  24. // The bot is requesting our turn logic.
  25. if (type == "our_turn")
  26. {
  27. await OurTurnLogic();
  28. return true;
  29. }
  30.  
  31. // The bot is requesting opponent turn logic.
  32. if (type == "opponent_turn")
  33. {
  34. await OpponentTurnLogic();
  35. return true;
  36. }
  37.  
  38. // The bot is requesting our turn logic.
  39. if (type == "our_turn_combat")
  40. {
  41. await OurTurnCombatLogic();
  42. return true;
  43. }
  44.  
  45. // The bot is requesting opponent turn logic.
  46. if (type == "opponent_turn_combat")
  47. {
  48. await OpponentTurnCombatLogic();
  49. return true;
  50. }
  51.  
  52. // The bot is requesting arena draft logic.
  53. if (type == "arena_draft")
  54. {
  55. await ArenaDraftLogic(context as ArenaDraftData);
  56. return true;
  57. }
  58.  
  59. // The bot is requesting quest handling logic.
  60. if (type == "handle_quests")
  61. {
  62. await HandleQuestsLogic(context as QuestData);
  63. return true;
  64. }
  65.  
  66. // Whatever the current logic type is, this routine doesn't implement it.
  67. return false;
  68. }

无法识别Object,必须改成小写的object

如何确定插件是否加载成功

查看plugins的tab那边是否显示了相应的插件,如果没有显示,就说明插件编译失败。可以去日志文件看细节

需要依据GameEventManager 中的事件,来决定如何写代码

public class GameEventManager : IRunnable, IResetable

2019-07-17 11:51:33,227 [19] DEBUG Logger (null) - [AutoConcede] ConcedeThread for loop, index = 1
2019-07-17 11:51:33,228 [14] INFO Logger (null) - [GameEventManagerOnMulliganConfirm]
2019-07-17 11:51:49,782 [14] ERROR Logger (null) - [Tick] Exception during execution:
GreyMagic.InjectionDesyncException: Process must have frozen or gotten out of sync: Injection Finished Event was never fired
at GreyMagic.Executor.WaitForInjection(Int32 timeout)
at GreyMagic.Executor.SharedExecuteLogicEnd(Int32 timeout)
at GreyMagic.Executor.Execute(Int32 timeout)
at GreyMagic.Executor.GrabFrame()
at GreyMagic.ExternalProcessMemory.AcquireFrame(Boolean isHardLock)
at Triton.Bot.BotManager.smethod_1(IBot ibot_1)
2019-07-17 11:51:49,785 [14] DEBUG Logger (null) - [BotThreadFunction] An InjectionDesyncException was detected.

HearthBuddy Plugin编写遇到的问题的更多相关文章

  1. Bootstrap plugin编写

    滚动demo: <!doctype html> <html lang="en"> <head> <meta charset="U ...

  2. lua 5.3最简单plugin编写

    #include <windows.h> #include "lauxlib.h" /* Pop-up a Windows message box with your ...

  3. AS 自定义 Gradle plugin 插件 案例 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  4. 使用 CodeIgniter 框架快速开发 PHP 应用(三)

    原文:使用 CodeIgniter 框架快速开发 PHP 应用(三) 分析网站结构既然我们已经安装 CI ,我们开始了解它如何工作.读者已经知道 CI 实现了MVC式样. 通过对目录和文件的内容进行分 ...

  5. 使用dropwizard(4)-加入测试-jacoco代码覆盖率

    前言 dropwizard提供了一个简单的测试框架.这里简单集成并加入jacoco测试. Demo source https://github.com/Ryan-Miao/l4dropwizard 本 ...

  6. 30分钟带你了解Docker

    最近一直在忙项目,不知不觉2个多月没有更新博客了.正好自学了几天docker就干脆总结一下,也顺带增加一篇<30分钟入门系列>.网上能够查到的对于docker的定义我就不再重复了,说说我自 ...

  7. MQTT---HiveMQ源代码具体解释(四)插件载入

    源博客地址:http://blog.csdn.net/pipinet123 MQTT交流群:221405150 实现功能 将全部放在plugins文件夹下的全部符合plugin编写规范的plugin ...

  8. 掘金 Android 文章精选合集

    掘金 Android 文章精选合集 掘金官方 关注 2017.07.10 16:42* 字数 175276 阅读 50053评论 13喜欢 669 用两张图告诉你,为什么你的 App 会卡顿? - A ...

  9. 什么是SpringBoot

    随着动态语言的流行(Ruby,Groovy,Scala,Node.js),Java的开发显得格外的笨重;繁多的配置,低下的开发效率,复杂的部署流程以及第三方技术集成难度大. 在上述环境 下,Sprin ...

随机推荐

  1. vue项目使用openlayers来添加地图标注,标注样式设置的简要模板

    先把代码贴出来,注释以后有时间再写(需要留意一下这里图标的引入方式,函数内相同路径无法找到图片) import sk from "../../assets/img/home/sk-activ ...

  2. netty的断线重连问题

    手里的这个项目需要作为客户端,不断的接收服务端发来的数据,用的netty框架,但是一直存在一个问题,就是断线重连问题. 什么是断线重连呢? 就是我们这个客户端要保证一直与服务端保持连接,这样客户端才能 ...

  3. xtrabackup备份恢复过程

    备份 1.全备 innobackupex --user=root --password=123456 --no-timestamp /backup/full 增加数据 mysql> insert ...

  4. 将 spring boot 安装为 systemd 服务

    [root@ecs-11-132 system]# cat /etc/systemd/system/push-gateway-3.0.0.service [Unit] Description=app- ...

  5. String类型为什么不可变

    在学习Java的过程中,我们会被告知 String 被设计成不可变的类型.为什么 String 会被 Java 开发者有如此特殊的对待?他们的设计意图和设计理念到底是什么?因此,我带着以下三个问题,对 ...

  6. C - Covered Points Count CodeForces - 1000C (差分,离散化,统计)

    C - Covered Points Count CodeForces - 1000C You are given nn segments on a coordinate line; each end ...

  7. Json中相关注解解释说明

    @JsonProperty用法: @JsonProperty 此注解用于属性上,作用是把该属性的名称序列化为另外一个名称,如把trueName属性序列化为name,@JsonProperty(“nam ...

  8. Create React App 安装less 报错

    执行npm run eject 暴露模块 安装 npm i  less less-loader -D 1.打开 react app 的 webpack.config.js const sassRege ...

  9. Linux/Ubantu 安装 idea

    wget 使用 wget url (这里的url就是你要下载idea的网站) 在idea官网中 找到 direct link 右键复制链接 在 linux 中 打开 终端命令窗口 (Ctrl +Alt ...

  10. HDU 6044 - Limited Permutation | 2017 Multi-University Training Contest 1

    研究一下建树 : /* HDU 6044 - Limited Permutation [ 读入优化,笛卡尔树 ] | 2017 Multi-University Training Contest 1 ...