diff --git a/Library/Common/Architecture/BaseModel.cs b/Library/Common/Architecture/BaseModel.cs index 2868c5d..56afac4 100644 --- a/Library/Common/Architecture/BaseModel.cs +++ b/Library/Common/Architecture/BaseModel.cs @@ -82,5 +82,16 @@ namespace Milimoe.FunGame.Core.Library.Common.Architecture Working = true; Work = default; } + + /// + /// 调用Socket.Send() == Success后,请等待任务完成 + /// + protected void WaitForWorkDone() + { + while (true) + { + if (!Working) break; + } + } } } diff --git a/Library/Exception/Exception.cs b/Library/Exception/Exception.cs index dace84e..c6bd0ed 100644 --- a/Library/Exception/Exception.cs +++ b/Library/Exception/Exception.cs @@ -149,9 +149,14 @@ { public override string Message => "退出房间失败 (#10030)"; } + + public class CreateRoomException : Exception + { + public override string Message => "创建房间失败 (#10031)"; + } public class GetInstanceException : Exception { - public override string Message => "构造对象实例遇到错误 (#10031)"; + public override string Message => "构造对象实例遇到错误 (#10032)"; } }