Merge branch 'main' of http://10.27.17.121:3000/kawagiri/TH1
This commit is contained in:
commit
8545b81d8c
@ -13,6 +13,7 @@ using Logic.AI;
|
||||
using Logic.Audio;
|
||||
using Logic.CrashSight;
|
||||
using RuntimeData;
|
||||
using TH1_Core.Events;
|
||||
using TH1_Core.Managers;
|
||||
using TH1_Logic.AITrain;
|
||||
using TH1_Logic.Core;
|
||||
@ -223,6 +224,15 @@ namespace Logic
|
||||
if (!LobbyManager.Instance.Lobby.IsLobbyOwner()) return;
|
||||
GameNetSender.Instance.ForceUpdate(memberId);
|
||||
}
|
||||
|
||||
// 与房主断开时
|
||||
public void OnDisconnectToHost()
|
||||
{
|
||||
if (_curState == GameState.Menu) return;
|
||||
if (Main.MapData.Net.Mode != NetMode.Multi) return;
|
||||
if (LobbyManager.Instance.Lobby.IsLobbyOwner()) return;
|
||||
EventManager.Publish(new ExecuteUIBottomBottomBarQuit());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ namespace TH1_Logic.Net
|
||||
|
||||
// 获取自己在不在房间中
|
||||
public bool IsInLobby();
|
||||
|
||||
|
||||
// 检查和房主的连接状态, 断开需要重连
|
||||
public void CheckConnectionStatus();
|
||||
|
||||
|
||||
@ -349,7 +349,7 @@ namespace TH1_Logic.Steam
|
||||
// 判断是否游戏已经结束而我还在等待
|
||||
if (Main.MapData != null && !Main.MapData.CheckIfGameEnd(out _) && message.State == GameState.Menu)
|
||||
{
|
||||
|
||||
EventManager.Publish(new ExecuteUIBottomBottomBarQuit());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -366,7 +366,6 @@ namespace TH1_Logic.Steam
|
||||
LogSystem.LogWarning($"OnReceivedMemberStateSync 检测状态错误");
|
||||
GameNetSender.Instance.SendRequestForceUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 只有房主会收到
|
||||
|
||||
@ -130,6 +130,7 @@ namespace TH1_Logic.Steam
|
||||
//RefreshSteamGUI();
|
||||
RefreshLoginStatus();
|
||||
RefreshLobbyStatus();
|
||||
RefreshSteamGUI();
|
||||
}
|
||||
|
||||
// 刷新 Steam
|
||||
@ -727,6 +728,10 @@ namespace TH1_Logic.Steam
|
||||
|
||||
private void OnP2PPeerDisconnected(CSteamID steamID)
|
||||
{
|
||||
if (!IsLobbyOwner())
|
||||
{
|
||||
if (steamID.m_SteamID == GetLobbyOwnerId()) Main.Instance.GameLogic.OnDisconnectToHost();
|
||||
}
|
||||
LogSystem.LogInfo($"P2P connection lost with: {steamID}");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user