Add CreateRoomException and BaseMode.WaitForWorkDone()

This commit is contained in:
Mili 2023-04-02 12:14:18 +08:00
parent 627c8e9900
commit ea9008e908
2 changed files with 17 additions and 1 deletions

View File

@ -82,5 +82,16 @@ namespace Milimoe.FunGame.Core.Library.Common.Architecture
Working = true;
Work = default;
}
/// <summary>
/// 调用Socket.Send() == Success后请等待任务完成
/// </summary>
protected void WaitForWorkDone()
{
while (true)
{
if (!Working) break;
}
}
}
}

View File

@ -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)";
}
}