Skip to content

Commit d2f9e9c

Browse files
committed
fix for poly bridge v1.30
1 parent fac0769 commit d2f9e9c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

MultiplayerMod.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public void OnBridgeAction(BridgeActionModel message)
245245
// switch to handle actions
246246
switch (message.action){
247247
case actionType.CREATE_EDGE:
248-
edgeProxy = new BridgeEdgeProxy(message.content, ref offset);
248+
edgeProxy = new BridgeEdgeProxy(10, message.content, ref offset);
249249
//BridgeEdges.CreateEdgeFromProxy(edgeProxy);
250250

251251
edge = BridgeEdges.FindDisabledEdgeByJointGuids(
@@ -306,7 +306,7 @@ public void OnBridgeAction(BridgeActionModel message)
306306
instance.ClientRecieving[actionType.CREATE_JOINT] = false;
307307
break;
308308
case actionType.DELETE_EDGE:
309-
edgeProxy = new BridgeEdgeProxy(message.content, ref offset);
309+
edgeProxy = new BridgeEdgeProxy(10, message.content, ref offset);
310310
edge = BridgeEdges.FindEnabledEdgeByJointGuids(edgeProxy.m_NodeA_Guid, edgeProxy.m_NodeB_Guid, edgeProxy.m_Material);
311311
if (edge){
312312
edge.ForceDisable();
@@ -380,7 +380,7 @@ public void OnBridgeAction(BridgeActionModel message)
380380
}
381381
break;
382382
case actionType.SPLIT_MODIFY:
383-
edgeProxy = new BridgeEdgeProxy(message.content, ref offset);
383+
edgeProxy = new BridgeEdgeProxy(10, message.content, ref offset);
384384
edge = BridgeEdges.FindEnabledEdgeByJointGuids(edgeProxy.m_NodeA_Guid, edgeProxy.m_NodeB_Guid, edgeProxy.m_Material);
385385
if (edge){
386386
edge.m_JointAPart = edgeProxy.m_JointAPart;
@@ -1007,7 +1007,7 @@ public static void Postfix(
10071007
var edge = new BridgeEdgeProxy(__result);
10081008
var message = new BridgeActionModel {
10091009
action = actionType.CREATE_EDGE,
1010-
content = edge.SerializeBinary(),
1010+
content = edge.SerializeBinary(true),
10111011
playSound = true
10121012
};
10131013
instance.Logger.LogInfo("<CLIENT> sending CREATE_EDGE");
@@ -1094,7 +1094,7 @@ public static void Prefix() {
10941094
var joint = new BridgeEdgeProxy(e);
10951095
var message = new BridgeActionModel {
10961096
action = actionType.DELETE_EDGE,
1097-
content = joint.SerializeBinary(),
1097+
content = joint.SerializeBinary(true),
10981098
playSound = playSound
10991099
};
11001100
playSound = false;
@@ -1203,7 +1203,7 @@ public static void Postfix(bool forward, ref BridgeJointSelector __instance){
12031203
var edge = new BridgeEdgeProxy(__instance.m_Edge);
12041204
var message = new BridgeActionModel {
12051205
action = actionType.SPLIT_MODIFY,
1206-
content = edge.SerializeBinary()
1206+
content = edge.SerializeBinary(true)
12071207
};
12081208

12091209
instance.communication.Lobby.SendBridgeAction(message);
@@ -1755,7 +1755,7 @@ BridgeActionPacket packet
17551755
switch (action){
17561756
case actionType.CREATE_EDGE:
17571757
message.action = actionType.DELETE_EDGE;
1758-
message.content = packet.m_Edge.SerializeBinary();
1758+
message.content = packet.m_Edge.SerializeBinary(true);
17591759
break;
17601760

17611761
case actionType.CREATE_JOINT:
@@ -1765,7 +1765,7 @@ BridgeActionPacket packet
17651765

17661766
case actionType.DELETE_EDGE:
17671767
message.action = actionType.CREATE_EDGE;
1768-
message.content = packet.m_Edge.SerializeBinary();
1768+
message.content = packet.m_Edge.SerializeBinary(true);
17691769
break;
17701770

17711771
case actionType.DELETE_JOINT:
@@ -1856,15 +1856,15 @@ public static bool Prefix(){
18561856
}
18571857
}
18581858

1859-
[HarmonyPatch()]
1859+
[HarmonyPatch]
18601860
public static class LoadLayoutOrSlotPatch {
18611861
static IEnumerable<MethodBase> TargetMethods()
18621862
{
18631863
yield return AccessTools.Method(typeof(BridgeSave), "Deserialize");
18641864
yield return AccessTools.Method(typeof(SandboxLayout), "DeserializeFromProxies");
18651865
}
18661866
public static void Postfix(){
1867-
// if (GameStateManager.GetState() == GameState.BUILD || GameStateManager.GetState() == GameState.SANDBOX) syncLayout();
1867+
if (GameStateManager.GetState() == GameState.BUILD || GameStateManager.GetState() == GameState.SANDBOX) syncLayout();
18681868
}
18691869
}
18701870

MultiplayerMod.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@
4848
<Reference Include="UnityEngine.JSONSerializeModule">
4949
<HintPath>../Poly Bridge 2/Poly Bridge 2_Data/Managed/UnityEngine.JSONSerializeModule.dll</HintPath>
5050
</Reference>
51+
<Reference Include="UnityEngine.InputLegacyModule">
52+
<HintPath>../Poly Bridge 2/Poly Bridge 2_Data/Managed/UnityEngine.InputLegacyModule.dll</HintPath>
53+
</Reference>
5154
</ItemGroup>
5255
</Project>

0 commit comments

Comments
 (0)