// Token: 0x0600287E RID: 10366 RVA: 0x000F5EC8 File Offset: 0x000F42C8 private void arenaRestart() { LevelManager.arenaState = EArenaState.INTERMISSION; base.channel.send("tellLevelTimer", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { (byte)Provider.modeConfigData.Events.Arena_Restart_Timer }); for (int i = 0; i < LevelManager.arenaPlayers.Count; i++) { ArenaPlayer arenaPlayer = LevelManager.arenaPlayers[i]; if (!arenaPlayer.hasDied && arenaPlayer.steamPlayer != null && !(arenaPlayer.steamPlayer.player == null)) { arenaPlayer.steamPlayer.player.sendStat(EPlayerStat.ARENA_WINS); } } for (int j = 0; j < Provider.clients.Count; j++) { SteamPlayer steamPlayer = Provider.clients[j]; if (steamPlayer != null && !(steamPlayer.player == null) && !steamPlayer.player.life.isDead && !steamPlayer.player.movement.isSafe) { EPlayerKill eplayerKill; steamPlayer.player.life.askDamage(101, Vector3.up * 101f, EDeathCause.ARENA, ELimb.SPINE, CSteamID.Nil, out eplayerKill); } } }
// Token: 0x06002875 RID: 10357 RVA: 0x000F5228 File Offset: 0x000F3628 private void updateGroups(SteamPlayer steamPlayer) { if (!steamPlayer.player.quests.isMemberOfAGroup) { LevelManager.nonGroups--; } else { for (int i = LevelManager.arenaPlayers.Count - 1; i >= 0; i--) { ArenaPlayer arenaPlayer = LevelManager.arenaPlayers[i]; if (arenaPlayer.steamPlayer.player.quests.isMemberOfSameGroupAs(steamPlayer.player)) { return; } } LevelManager.arenaGroups.Remove(steamPlayer.player.quests.groupID); } }
// Token: 0x0600287C RID: 10364 RVA: 0x000F5B10 File Offset: 0x000F3F10 private void arenaPlay() { if (LevelManager.arenaMessage != EArenaMessage.PLAY) { base.channel.send("tellArenaMessage", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { 2 }); } if ((long)(LevelManager.nonGroups + LevelManager.arenaGroups.Count) < (long)((ulong)LevelManager.minPlayers)) { LevelManager.arenaState = EArenaState.FINALE; LevelManager.lastFinaleMessage = Time.realtimeSinceStartup; if (LevelManager.arenaPlayers.Count > 0) { ulong[] array = new ulong[LevelManager.arenaPlayers.Count]; for (int i = 0; i < LevelManager.arenaPlayers.Count; i++) { array[i] = LevelManager.arenaPlayers[i].steamPlayer.playerID.steamID.m_SteamID; } LevelManager.arenaMessage = EArenaMessage.LOSE; base.channel.send("tellArenaPlayer", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { array, 5 }); } else { base.channel.send("tellArenaMessage", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { 6 }); } } else { for (int j = LevelManager.arenaPlayers.Count - 1; j >= 0; j--) { ArenaPlayer arenaPlayer = LevelManager.arenaPlayers[j]; if (arenaPlayer.steamPlayer == null || arenaPlayer.steamPlayer.player == null) { ulong[] array2 = new ulong[] { arenaPlayer.steamPlayer.playerID.steamID.m_SteamID }; base.channel.send("tellArenaPlayer", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { array2, 4 }); LevelManager.arenaPlayers.RemoveAt(j); this.updateGroups(arenaPlayer.steamPlayer); base.channel.send("tellLevelNumber", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { (byte)LevelManager.arenaPlayers.Count }); } else { if (Time.realtimeSinceStartup - arenaPlayer.lastAreaDamage > 1f) { float num = Mathf.Pow(arenaPlayer.steamPlayer.player.transform.position.x - LevelManager.arenaCurrentCenter.x, 2f) + Mathf.Pow(arenaPlayer.steamPlayer.player.transform.position.z - LevelManager.arenaCurrentCenter.z, 2f); if (num > LevelManager.arenaSqrRadius || LevelManager.arenaCurrentRadius < 1f) { EPlayerKill eplayerKill; arenaPlayer.steamPlayer.player.life.askDamage((byte)Provider.modeConfigData.Events.Arena_Compactor_Damage, Vector3.up * 10f, EDeathCause.ARENA, ELimb.SPINE, CSteamID.Nil, out eplayerKill); arenaPlayer.lastAreaDamage = Time.realtimeSinceStartup; } } if (arenaPlayer.hasDied) { ulong[] array3 = new ulong[] { arenaPlayer.steamPlayer.playerID.steamID.m_SteamID }; base.channel.send("tellArenaPlayer", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { array3, 3 }); LevelManager.arenaPlayers.RemoveAt(j); this.updateGroups(arenaPlayer.steamPlayer); base.channel.send("tellLevelNumber", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { (byte)LevelManager.arenaPlayers.Count }); } } } } }
// Token: 0x0600287A RID: 10362 RVA: 0x000F56AC File Offset: 0x000F3AAC private void arenaSpawn() { for (byte b = 0; b < Regions.WORLD_SIZE; b += 1) { for (byte b2 = 0; b2 < Regions.WORLD_SIZE; b2 += 1) { if (LevelItems.spawns[(int)b, (int)b2].Count > 0) { for (int i = 0; i < LevelItems.spawns[(int)b, (int)b2].Count; i++) { ItemSpawnpoint itemSpawnpoint = LevelItems.spawns[(int)b, (int)b2][i]; ushort item = LevelItems.getItem(itemSpawnpoint); if (item != 0) { Item item2 = new Item(item, EItemOrigin.ADMIN); ItemManager.dropItem(item2, itemSpawnpoint.point, false, false, false); } } } } } List <VehicleSpawnpoint> spawns = LevelVehicles.spawns; for (int j = 0; j < spawns.Count; j++) { VehicleSpawnpoint vehicleSpawnpoint = spawns[j]; ushort vehicle = LevelVehicles.getVehicle(vehicleSpawnpoint); if (vehicle != 0) { Vector3 point = vehicleSpawnpoint.point; point.y += 1f; VehicleManager.spawnVehicle(vehicle, point, Quaternion.Euler(0f, vehicleSpawnpoint.angle, 0f)); } } List <PlayerSpawnpoint> altSpawns = LevelPlayers.getAltSpawns(); float num = LevelManager.arenaCurrentRadius - SafezoneNode.MIN_SIZE; num *= num; for (int k = altSpawns.Count - 1; k >= 0; k--) { PlayerSpawnpoint playerSpawnpoint = altSpawns[k]; float num2 = Mathf.Pow(playerSpawnpoint.point.x - LevelManager.arenaCurrentCenter.x, 2f) + Mathf.Pow(playerSpawnpoint.point.z - LevelManager.arenaCurrentCenter.z, 2f); if (num2 > num) { altSpawns.RemoveAt(k); } } for (int l = 0; l < Provider.clients.Count; l++) { if (altSpawns.Count == 0) { break; } SteamPlayer steamPlayer = Provider.clients[l]; if (steamPlayer != null && !(steamPlayer.player == null) && !steamPlayer.player.life.isDead) { int index = UnityEngine.Random.Range(0, altSpawns.Count); PlayerSpawnpoint playerSpawnpoint2 = altSpawns[index]; altSpawns.RemoveAt(index); ArenaPlayer arenaPlayer = new ArenaPlayer(steamPlayer); arenaPlayer.steamPlayer.player.life.sendRevive(); arenaPlayer.steamPlayer.player.sendTeleport(playerSpawnpoint2.point, MeasurementTool.angleToByte(playerSpawnpoint2.angle)); LevelManager.arenaPlayers.Add(arenaPlayer); foreach (ArenaLoadout arenaLoadout in Level.info.configData.Arena_Loadouts) { for (ushort num3 = 0; num3 < arenaLoadout.Amount; num3 += 1) { ushort newID = SpawnTableTool.resolve(arenaLoadout.Table_ID); arenaPlayer.steamPlayer.player.inventory.forceAddItemAuto(new Item(newID, true), true, false, true, false); } } } } this.arenaAirdrop(); LevelManager.arenaState = EArenaState.PLAY; base.channel.send("tellLevelNumber", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[] { (byte)LevelManager.arenaPlayers.Count }); }