Add CreateRoomException, ForceLogout and BaseMode.WaitForWorkDone() (#6)

This commit is contained in:
milimoe 2023-04-03 00:00:56 +08:00 committed by GitHub
commit 84cbedf1f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

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

View File

@ -56,6 +56,7 @@
Login, Login,
CheckLogin, CheckLogin,
Logout, Logout,
ForceLogout,
Disconnect, Disconnect,
HeartBeat, HeartBeat,
IntoRoom, IntoRoom,

View File

@ -150,8 +150,13 @@
public override string Message => "退出房间失败 (#10030)"; public override string Message => "退出房间失败 (#10030)";
} }
public class CreateRoomException : Exception
{
public override string Message => "创建房间失败 (#10031)";
}
public class GetInstanceException : Exception public class GetInstanceException : Exception
{ {
public override string Message => "构造对象实例遇到错误 (#10031)"; public override string Message => "构造对象实例遇到错误 (#10032)";
} }
} }