Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nxPublic committed Jan 31, 2022
1 parent 1caeb91 commit ba62c2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ValheimPlus/GameClasses/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private static void Prefix()
{
ZRoutedRpc.instance.Register("VPlusConfigSync", new Action<long, ZPackage>(VPlusConfigSync.RPC_VPlusConfigSync)); //Config Sync
ZRoutedRpc.instance.Register("VPlusMapSync", new Action<long, ZPackage>(VPlusMapSync.RPC_VPlusMapSync)); //Map Sync
ZRoutedRpc.instance.Register("VPlusMapPinSync", new Action<long, ZPackage>(VPlusMapPinSync.RPC_VPlusMapPinSync)); //Map Pin Sync
ZRoutedRpc.instance.Register("VPlusMapAddPin", new Action<long, ZPackage>(VPlusMapPinSync.RPC_VPlusMapAddPin)); //Map Pin Sync
ZRoutedRpc.instance.Register("VPlusAck", new Action<long>(VPlusAck.RPC_VPlusAck)); //Ack
}
}
Expand Down
6 changes: 3 additions & 3 deletions ValheimPlus/RPC/VPlusMapPinSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class VPlusMapPinSync
/// <summary>
/// Sync Pin with clients via the server
/// </summary>
public static void RPC_VPlusMapPinSync(long sender, ZPackage mapPinPkg)
public static void RPC_VPlusMapAddPin(long sender, ZPackage mapPinPkg)
{
if (ZNet.m_isServer) //Server
{
Expand All @@ -22,7 +22,7 @@ public static void RPC_VPlusMapPinSync(long sender, ZPackage mapPinPkg)
foreach(ZNetPeer peer in ZRoutedRpc.instance.m_peers)
{
if(peer.m_uid != sender)
ZRoutedRpc.instance.InvokeRoutedRPC(peer.m_uid, "VPlusMapPinSync", new object[] { mapPinPkg });
ZRoutedRpc.instance.InvokeRoutedRPC(peer.m_uid, "VPlusMapAddPin", new object[] { mapPinPkg });
}

ZLog.Log($"Sent map pin to all clients");
Expand Down Expand Up @@ -78,7 +78,7 @@ public static void SendMapPinToServer(Minimap.PinData pinData, bool keepQuiet =
pkg.Write(pinData.m_name); // Pin name
pkg.Write(keepQuiet); // Don't shout

ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.instance.GetServerPeerID(), "VPlusMapPinSync", new object[] { pkg });
ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.instance.GetServerPeerID(), "VPlusMapAddPin", new object[] { pkg });

ZLog.Log($"Sent map pin {pinData.m_name} to the server");

Expand Down

0 comments on commit ba62c2f

Please sign in to comment.