修复拒绝连接后仍然能连接成功的BUG

This commit is contained in:
milimoe 2023-09-10 14:01:06 +08:00
parent 4558110af9
commit 35382bf703
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E

View File

@ -96,6 +96,7 @@ namespace Milimoe.FunGame.Core.Controller
{ {
bool success = obj.GetParam<bool>(0); bool success = obj.GetParam<bool>(0);
msg = obj.GetParam<string>(1) ?? ""; msg = obj.GetParam<string>(1) ?? "";
result = success ? ConnectResult.Success : ConnectResult.ConnectFailed;
if (success) if (success)
{ {
_Socket.Token = obj.GetParam<Guid>(2); _Socket.Token = obj.GetParam<Guid>(2);
@ -116,10 +117,7 @@ namespace Milimoe.FunGame.Core.Controller
} }
} }
} }
else else result = ConnectResult.ConnectFailed;
{
result = ConnectResult.ConnectFailed;
}
} }
else _Socket?.Close(); else _Socket?.Close();
} }