diff --git a/Controller/AddonController.cs b/Controller/AddonController.cs index 5021e50..feda96f 100644 --- a/Controller/AddonController.cs +++ b/Controller/AddonController.cs @@ -23,6 +23,11 @@ namespace Milimoe.FunGame.Core.Controller /// private Func MaskMethod_NewLongRunningDataRequest { get; set; } + /// + /// 输出错误消息 + /// + private Action MaskMethod_Error { get; set; } = new(e => Console.Write("\r" + e + "\n\r> ")); + /// /// 输出系统消息 /// @@ -45,7 +50,14 @@ namespace Milimoe.FunGame.Core.Controller /// /// public DataRequest NewLongRunningDataRequest(DataRequestType type) => MaskMethod_NewLongRunningDataRequest(type); - + + /// + /// 输出错误消息 + /// + /// + /// + public void Error(Exception e) => MaskMethod_Error(e); + /// /// 新建一个AddonController /// @@ -57,6 +69,7 @@ namespace Milimoe.FunGame.Core.Controller if (delegates.Length > 0) MaskMethod_WriteLine = (Action)delegates[0]; if (delegates.Length > 1) MaskMethod_NewDataRequest = (Func)delegates[1]; if (delegates.Length > 2) MaskMethod_NewLongRunningDataRequest = (Func)delegates[2]; + if (delegates.Length > 3) MaskMethod_Error = (Action)delegates[3]; MaskMethod_NewDataRequest ??= new(DefaultNewDataRequest); MaskMethod_NewLongRunningDataRequest ??= new(DefaultNewDataRequest); } diff --git a/Docs/FunGame.Core.xml b/Docs/FunGame.Core.xml index 8cb4136..ae04447 100644 --- a/Docs/FunGame.Core.xml +++ b/Docs/FunGame.Core.xml @@ -975,6 +975,11 @@ 基于本地已连接的Socket创建长时间运行的数据请求 + + + 输出错误消息 + + 输出系统消息 @@ -998,6 +1003,13 @@ + + + 输出错误消息 + + + + 新建一个AddonController