public void RPC_SlayBountyTarget(long sender, ZPackage pkg, string monsterID, bool isAdd) { var isServer = Common.Utils.IsServer(); if (isServer) { EpicLoot.LogWarning($"SERVER: RPC_SlayBountyTarget: {monsterID} ({(isAdd ? "minion" : "target")})"); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "SlayBountyTargetFromServer", pkg, monsterID, isAdd); } else { EpicLoot.LogWarning($"CLIENT: RPC_SlayBountyTarget: {monsterID} ({(isAdd ? "minion" : "target")})"); } var bounty = BountyInfo.FromPackage(pkg); if (isServer) { AddSlainBountyTargetToLedger(bounty, monsterID, isAdd); } if (Player.m_localPlayer == null || bounty.PlayerID != Player.m_localPlayer.GetPlayerID()) { // Not my bounty return; } OnBountyTargetSlain(bounty.ID, monsterID, isAdd); }
public void RPC_SlayBountyTarget(long sender, ZPackage pkg, string monsterID, bool isAdd) { var isServer = Common.Utils.IsServer(); if (isServer) { ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "SlayBountyTargetFromServer", pkg, monsterID, isAdd); } var bounty = BountyInfo.FromPackage(pkg); if (isServer) { AddSlainBountyTargetToLedger(bounty, monsterID, isAdd); } if (Player.m_localPlayer == null || bounty.PlayerID != Player.m_localPlayer.GetPlayerID()) { // Not my bounty return; } OnBountyTargetSlain(bounty.ID, monsterID, isAdd); }