public void askToggleObjectBinaryState(CSteamID steamID, byte x, byte y, ushort index) { if (Provider.isServer) { if (!Regions.checkSafe((int)x, (int)y)) { return; } Player player = PlayerTool.getPlayer(steamID); if (player == null) { return; } if (player.life.isDead) { return; } if ((int)index >= LevelObjects.objects[(int)x, (int)y].Count) { return; } if (!player.tryToPerformRateLimitedAction()) { return; } if ((LevelObjects.objects[(int)x, (int)y][(int)index].transform.position - player.transform.position).sqrMagnitude > 400f) { return; } InteractableObjectBinaryState interactableObjectBinaryState = LevelObjects.objects[(int)x, (int)y][(int)index].interactable as InteractableObjectBinaryState; if (interactableObjectBinaryState != null && interactableObjectBinaryState.isUsable && !interactableObjectBinaryState.objectAsset.interactabilityRemote) { if (!interactableObjectBinaryState.objectAsset.areConditionsMet(player)) { return; } if (!interactableObjectBinaryState.objectAsset.areInteractabilityConditionsMet(player)) { return; } interactableObjectBinaryState.objectAsset.applyInteractabilityConditions(player, true); interactableObjectBinaryState.objectAsset.grantInteractabilityRewards(player, true); ObjectManager.manager.channel.send("tellToggleObjectBinaryState", ESteamCall.ALL, x, y, ObjectManager.OBJECT_REGIONS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { x, y, index, !interactableObjectBinaryState.isUsed }); LevelObjects.objects[(int)x, (int)y][(int)index].state[0] = ((!interactableObjectBinaryState.isUsed) ? 0 : 1); } } }
// Token: 0x060028D9 RID: 10457 RVA: 0x000F88A4 File Offset: 0x000F6CA4 public static void forceObjectBinaryState(Transform transform, bool isUsed) { byte b; byte b2; ushort num; if (ObjectManager.tryGetRegion(transform, out b, out b2, out num)) { InteractableObjectBinaryState interactableObjectBinaryState = LevelObjects.objects[(int)b, (int)b2][(int)num].interactable as InteractableObjectBinaryState; if (interactableObjectBinaryState != null && interactableObjectBinaryState.isUsable) { ObjectManager.manager.channel.send("tellToggleObjectBinaryState", ESteamCall.ALL, b, b2, ObjectManager.OBJECT_REGIONS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { b, b2, num, isUsed }); LevelObjects.objects[(int)b, (int)b2][(int)num].state[0] = ((!interactableObjectBinaryState.isUsed) ? 0 : 1); } } }
public void tellToggleObjectBinaryState(CSteamID steamID, byte x, byte y, ushort index, bool isUsed) { if (base.channel.checkServer(steamID)) { if (!Regions.checkSafe((int)x, (int)y)) { return; } ObjectRegion objectRegion = ObjectManager.regions[(int)x, (int)y]; if (!Provider.isServer && !objectRegion.isNetworked) { return; } if ((int)index >= LevelObjects.objects[(int)x, (int)y].Count) { return; } InteractableObjectBinaryState interactableObjectBinaryState = LevelObjects.objects[(int)x, (int)y][(int)index].interactable as InteractableObjectBinaryState; if (interactableObjectBinaryState != null) { interactableObjectBinaryState.updateToggle(isUsed); } } }