联机bug

This commit is contained in:
daixiawu 2026-05-29 16:33:42 +08:00
parent 906b155629
commit 1d74f48ba5
14 changed files with 5869 additions and 5659 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1159320,7 +1159320,7 @@ MonoBehaviour:
- ID: 19999
ZH: "\u5BC6\u7801\u623F\u95F4"
TDZH: "\u5BC6\u78BC\u623F\u9593"
EN: Private
EN: Password
JP: "\u9375\u4ED8\u304D"
KR: "\uC7A0\uAE08\uBC29"
RU:

View File

@ -4349,7 +4349,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7849747489070299319, guid: 19402153ee79dbc4e80a78f3222e6b47, type: 3}
propertyPath: m_SizeDelta.x
value: 830.08167
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7849747489070299319, guid: 19402153ee79dbc4e80a78f3222e6b47, type: 3}
propertyPath: m_AnchoredPosition.x
@ -4534,7 +4534,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7849747489070299319, guid: ed55b8a014ca41543a2d95f370c5750d, type: 3}
propertyPath: m_SizeDelta.x
value: 556.2688
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7849747489070299319, guid: ed55b8a014ca41543a2d95f370c5750d, type: 3}
propertyPath: m_AnchoredPosition.x

View File

@ -1271,7 +1271,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 216.46, y: -0.98245}
m_SizeDelta: {x: 835, y: 55.577}
m_SizeDelta: {x: 403.47, y: 55.577}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &823716877754914448
CanvasRenderer:
@ -2217,7 +2217,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 840, y: 53.6123}
m_SizeDelta: {x: 418.1917, y: 53.6123}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!225 &6590096838502500504
CanvasGroup:

View File

@ -2056,6 +2056,12 @@ namespace Logic.Action
if (unit1.GetSkill(SkillType.SUWAKOATTACK, out var _))
{
animSkillData = SkillType.SUWAKOATTACK;
if (targetGrid.RealUnit(actionParams.MapData, out var targetGridUnit))
{
targetGridUnit.OnBeInteractTarget(actionParams.MapData, unit1, targetGrid);
return true;
}
unit1.ClearActionPoint();
var fullType = new UnitFullType()
{ UnitType = UnitType.MoriyaHebi, GiantType = GiantType.None, UnitLevel = 1 };

View File

@ -352,6 +352,7 @@ namespace TH1_Logic.Steam
Main.Instance.GameLogic.ChangeState(GameState.ForceUpdating);
try
{
RestoreForceUpdateTurnStartTime(message);
if (!Main.Instance.NetResumeMatch(message.MapData))
{
NetworkPlayerTipManager.Instance.Request(NetworkPlayerTipType.ReconnectFailed);
@ -380,6 +381,13 @@ namespace TH1_Logic.Steam
// Main.MapData = message.MapData;
}
private void RestoreForceUpdateTurnStartTime(ForceUpdateMessage message)
{
if (message?.MapData?.Net == null) return;
if (!message.HasCurrentTurnElapsedSeconds) return;
message.MapData.Net.PlayerStartTime = UnityEngine.Time.time - Math.Max(0f, message.CurrentTurnElapsedSeconds);
}
private void OnReceivedMapDataDebug(MapDataDebugMessage message)
{
if (message == null)

View File

@ -164,8 +164,7 @@ namespace TH1_Logic.Steam
{
if (memberId == 0) return;
if (!TryGetValidMultiMapForBroadcast("ForceUpdate", out var mapData)) return;
var data = new ForceUpdateMessage();
data.MapData = mapData;
var data = BuildForceUpdateMessage(mapData);
SendMessageToPlayer(memberId, data);
}
@ -173,11 +172,26 @@ namespace TH1_Logic.Steam
public void BroadcastForceUpdate()
{
if (!TryGetValidMultiMapForBroadcast("BroadcastForceUpdate", out var mapData)) return;
var data = new ForceUpdateMessage();
data.MapData = mapData;
var data = BuildForceUpdateMessage(mapData);
BroadcastMessage(data);
}
private ForceUpdateMessage BuildForceUpdateMessage(MapData mapData)
{
var data = new ForceUpdateMessage
{
MapData = mapData
};
if (mapData?.Net != null && mapData.Net.PlayerStartTime > 0f)
{
data.HasCurrentTurnElapsedSeconds = true;
data.CurrentTurnElapsedSeconds = UnityEngine.Mathf.Max(0f, UnityEngine.Time.time - mapData.Net.PlayerStartTime);
}
return data;
}
// MapData 一致性诊断 (成员 => 房主)
public bool SendMapDataDebugToHost(string note = null)
{

View File

@ -159,6 +159,8 @@ namespace TH1_Logic.Steam
{
public override P2PMsgType MessageType => P2PMsgType.ForceUpdate;
public MapData MapData { get; set; }
public bool HasCurrentTurnElapsedSeconds { get; set; }
public float CurrentTurnElapsedSeconds { get; set; }
}

View File

@ -1508,7 +1508,6 @@ namespace TH1_UI.View.Outside
if (!AreCurrentLobbyMembersReady())
{
Debug.Log("Cannot resume multiplayer game: not all current lobby members are ready");
NetworkPlayerTipManager.Instance.Request(NetworkPlayerTipType.LobbyMembersNotReady);
ShowLobbyNotify(UINotifyCommonType.OutsideMultiplayRoomNotReady);
return;
}
@ -1527,7 +1526,6 @@ namespace TH1_UI.View.Outside
if (!Main.Instance.MapConfig.AreAllLobbyMembersReady())
{
Debug.Log("Cannot start multiplayer game: not all members are ready");
NetworkPlayerTipManager.Instance.Request(NetworkPlayerTipType.LobbyMembersNotReady);
ShowLobbyNotify(UINotifyCommonType.OutsideMultiplayRoomNotReady);
return;
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff