Client LuaCsForBarotrauma
BarotraumaClient/ClientSource/Events/Missions/MonsterMission.cs
2 
3 namespace Barotrauma
4 {
5  partial class MonsterMission : Mission
6  {
7  public override bool DisplayAsCompleted => State > 0;
8  public override bool DisplayAsFailed => false;
9 
10  public override void ClientReadInitial(IReadMessage msg)
11  {
12  base.ClientReadInitial(msg);
13  byte monsterCount = msg.ReadByte();
14  for (int i = 0; i < monsterCount; i++)
15  {
16  var monster = Character.ReadSpawnData(msg);
17  if (monster == null)
18  {
19  throw new System.Exception($"Error in MonsterMission.ClientReadInitial: failed to create a monster (mission: {Prefab.Identifier}, index: {i})");
20  }
21  monsters.Add(monster);
22  }
23  if (monsters.Count != monsterCount)
24  {
25  throw new System.Exception("Error in MonsterMission.ClientReadInitial: monster count does not match the server count (" + monsterCount + " != " + monsters.Count + "mission: " + Prefab.Identifier + ")");
26  }
27  InitializeMonsters(monsters);
28  }
29  }
30 }
readonly Identifier Identifier
Definition: Prefab.cs:34