mirror of
https://github.com/project-redbud/FunGame-Desktop.git
synced 2025-04-22 04:59:34 +08:00
添加服务器强制将玩家下线
This commit is contained in:
parent
60b645d09d
commit
0011720dce
@ -34,7 +34,7 @@ namespace Milimoe.FunGame.Desktop.Model
|
||||
string msg = "";
|
||||
Guid key = Guid.Empty;
|
||||
(msg, key) = await Task.Factory.StartNew(SocketHandler_LogOut);
|
||||
if (key != Guid.Empty)
|
||||
if (key == Config.Guid_LoginKey)
|
||||
{
|
||||
Config.Guid_LoginKey = Guid.Empty;
|
||||
Main.UpdateUI(MainInvokeType.LogOut, msg ?? "");
|
||||
@ -145,6 +145,7 @@ namespace Milimoe.FunGame.Desktop.Model
|
||||
Main.GetMessage(msg, TimeType.None);
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
throw new CanNotSendTalkException();
|
||||
}
|
||||
@ -168,6 +169,20 @@ namespace Milimoe.FunGame.Desktop.Model
|
||||
if ((RunTime.Socket?.Connected ?? false) && Usercfg.LoginUser != null)
|
||||
Main.UpdateUI(MainInvokeType.SetGreenAndPing);
|
||||
}
|
||||
else if (SocketObject.SocketType == SocketMessageType.ForceLogout)
|
||||
{
|
||||
// 服务器强制下线登录
|
||||
Guid key = Guid.Empty;
|
||||
string? msg = "";
|
||||
if (SocketObject.Length > 0) key = SocketObject.GetParam<Guid>(0);
|
||||
if (SocketObject.Length > 1) msg = SocketObject.GetParam<string>(1);
|
||||
msg ??= "";
|
||||
if (key == Config.Guid_LoginKey)
|
||||
{
|
||||
Config.Guid_LoginKey = Guid.Empty;
|
||||
Main.UpdateUI(MainInvokeType.LogOut, msg ?? "");
|
||||
}
|
||||
}
|
||||
else if (SocketMessageTypes.Contains(SocketObject.SocketType))
|
||||
{
|
||||
Work = SocketObject;
|
||||
|
Loading…
x
Reference in New Issue
Block a user