public static void OnServerRemovePin(ZRpc _, ZPackage pinData) { if (!Store.IsSharingPin()) { return; } pinData.SetPos(0); Utility.Log("Client deleted pin by server"); var pin = ExplorationDatabase.UnpackPin(pinData); foreach (var clientPin in ExplorationDatabase.ClientPins.ToList()) { if (UtilityPin.ArePinsEqual(clientPin, pin)) { ExplorationDatabase.ClientPins.Remove(clientPin); } } var mapPin = UtilityPin.GetMapPin(pin); if (mapPin == null) { return; } _Minimap.RemovePin(_Minimap._instance, mapPin); }
public static void OnServerCheckPin(ZRpc client, ZPackage data) { if (!Store.IsSharingPin()) { return; } data.SetPos(0); Utility.Log("Client checked pin by server"); var pin = ExplorationDatabase.UnpackPin(data); var state = data.ReadBool(); foreach (var clientPin in ExplorationDatabase.ClientPins.ToList()) { if (UtilityPin.ArePinsEqual(clientPin, pin)) { clientPin.Checked = state; var mapPin = UtilityPin.GetMapPin(clientPin); if (mapPin != null) { mapPin.m_checked = state; } } } }
public static void SetPinState(PinData needle, bool state) { foreach (var pin in ServerPins.ToList()) { if (UtilityPin.ArePinsEqual(pin, needle)) { pin.Checked = state; } } }
public static void RemovePinEqual(PinData needle) { foreach (var pin in ServerPins.ToList()) { if (UtilityPin.ArePinsEqual(pin, needle)) { ServerPins.Remove(pin); } } }