// Token: 0x060028DA RID: 10458 RVA: 0x000F896C File Offset: 0x000F6D6C public static void toggleObjectBinaryState(Transform transform) { byte b; byte b2; ushort num; if (ObjectManager.tryGetRegion(transform, out b, out b2, out num)) { ObjectManager.manager.channel.send("askToggleObjectBinaryState", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[] { b, b2, num }); } }
// Token: 0x060028D3 RID: 10451 RVA: 0x000F845C File Offset: 0x000F685C public static void useObjectQuest(Transform transform) { byte b; byte b2; ushort num; if (ObjectManager.tryGetRegion(transform, out b, out b2, out num)) { ObjectManager.manager.channel.send("askUseObjectQuest", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { b, b2, num }); } }
// Token: 0x060028D0 RID: 10448 RVA: 0x000F81A8 File Offset: 0x000F65A8 public static void damage(Transform obj, Vector3 direction, byte section, float damage, float times, out EPlayerKill kill, out uint xp) { kill = EPlayerKill.NONE; xp = 0u; byte b; byte b2; ushort num; if (ObjectManager.tryGetRegion(obj, out b, out b2, out num)) { InteractableObjectRubble rubble = LevelObjects.objects[(int)b, (int)b2][(int)num].rubble; if (rubble != null && !rubble.isSectionDead(section)) { ushort num2 = (ushort)(damage * times); rubble.askDamage(section, num2); if (rubble.isSectionDead(section)) { kill = EPlayerKill.OBJECT; if (LevelObjects.objects[(int)b, (int)b2][(int)num].asset != null) { xp = LevelObjects.objects[(int)b, (int)b2][(int)num].asset.rubbleRewardXP; } byte[] state = LevelObjects.objects[(int)b, (int)b2][(int)num].state; if (section == 255) { state[state.Length - 1] = 0; } else { state[state.Length - 1] = (state[state.Length - 1] & ~Types.SHIFTS[(int)section]); } ObjectManager.manager.channel.send("tellObjectRubble", ESteamCall.ALL, b, b2, ObjectManager.OBJECT_REGIONS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { b, b2, num, section, false, direction * (float)num2 }); } } } }
// 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); } } }
// Token: 0x060028D8 RID: 10456 RVA: 0x000F87F8 File Offset: 0x000F6BF8 public static void updateObjectResource(Transform transform, ushort amount, bool shouldSend) { byte b; byte b2; ushort num; if (ObjectManager.tryGetRegion(transform, out b, out b2, out num)) { if (shouldSend) { ObjectManager.manager.channel.send("tellObjectResource", ESteamCall.ALL, b, b2, ObjectManager.OBJECT_REGIONS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { b, b2, num, amount }); } byte[] bytes = BitConverter.GetBytes(amount); LevelObjects.objects[(int)b, (int)b2][(int)num].state[0] = bytes[0]; LevelObjects.objects[(int)b, (int)b2][(int)num].state[1] = bytes[1]; } }
public virtual void write(SteamChannel channel) { channel.write(this.sequence); channel.write(this.recov); channel.write(this.keys); if (this.clientsideInputs == null) { channel.write(0); } else { channel.write((byte)this.clientsideInputs.Count); foreach (RaycastInfo raycastInfo in this.clientsideInputs) { if (raycastInfo.player != null) { channel.write(3); channel.write(raycastInfo.point); channel.write(raycastInfo.direction); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.limb); channel.write(raycastInfo.player.channel.owner.playerID.steamID); } else if (raycastInfo.zombie != null) { channel.write(4); channel.write(raycastInfo.point); channel.write(raycastInfo.direction); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.limb); channel.write(raycastInfo.zombie.id); } else if (raycastInfo.animal != null) { channel.write(5); channel.write(raycastInfo.point); channel.write(raycastInfo.direction); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.limb); channel.write(raycastInfo.animal.index); } else if (raycastInfo.vehicle != null) { channel.write(6); channel.write(raycastInfo.point); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.material); channel.write(raycastInfo.vehicle.instanceID); } else if (raycastInfo.transform != null) { if (raycastInfo.transform.CompareTag("Barricade")) { channel.write(7); InteractableDoorHinge component = raycastInfo.transform.GetComponent <InteractableDoorHinge>(); if (component != null) { raycastInfo.transform = component.transform.parent.parent; } byte b; byte b2; ushort num; ushort num2; BarricadeRegion barricadeRegion; if (BarricadeManager.tryGetInfo(raycastInfo.transform, out b, out b2, out num, out num2, out barricadeRegion)) { channel.write(raycastInfo.point); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.material); channel.write(b); channel.write(b2); channel.write(num); channel.write(num2); } else { channel.write(Vector3.zero); channel.write(Vector3.up); channel.write(0); channel.write(0); channel.write(0); channel.write(ushort.MaxValue); channel.write(ushort.MaxValue); } } else if (raycastInfo.transform.CompareTag("Structure")) { channel.write(8); byte b3; byte b4; ushort num3; StructureRegion structureRegion; if (StructureManager.tryGetInfo(raycastInfo.transform, out b3, out b4, out num3, out structureRegion)) { channel.write(raycastInfo.point); channel.write(raycastInfo.direction); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.material); channel.write(b3); channel.write(b4); channel.write(num3); } else { channel.write(Vector3.zero); channel.write(Vector3.up); channel.write(Vector3.up); channel.write(0); channel.write(0); channel.write(0); channel.write(ushort.MaxValue); } } else if (raycastInfo.transform.CompareTag("Resource")) { channel.write(9); byte b5; byte b6; ushort num4; if (ResourceManager.tryGetRegion(raycastInfo.transform, out b5, out b6, out num4)) { channel.write(raycastInfo.point); channel.write(raycastInfo.direction); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.material); channel.write(b5); channel.write(b6); channel.write(num4); } else { channel.write(Vector3.zero); channel.write(Vector3.up); channel.write(Vector3.up); channel.write(0); channel.write(0); channel.write(0); channel.write(ushort.MaxValue); } } else if (raycastInfo.transform.CompareTag("Small") || raycastInfo.transform.CompareTag("Medium") || raycastInfo.transform.CompareTag("Large")) { channel.write(2); byte b7; byte b8; ushort num5; if (ObjectManager.tryGetRegion(raycastInfo.transform, out b7, out b8, out num5)) { channel.write(raycastInfo.point); channel.write(raycastInfo.direction); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.material); channel.write(raycastInfo.section); channel.write(b7); channel.write(b8); channel.write(num5); } else { channel.write(Vector3.zero); channel.write(Vector3.up); channel.write(Vector3.up); channel.write(0); channel.write(byte.MaxValue); channel.write(0); channel.write(0); channel.write(ushort.MaxValue); } } else if (raycastInfo.transform.CompareTag("Ground") || raycastInfo.transform.CompareTag("Environment")) { channel.write(0); channel.write(raycastInfo.point); channel.write(raycastInfo.normal); channel.write((byte)raycastInfo.material); } else { channel.write(1); } } else { channel.write(1); } } } }