Handle exceptions when generating spawners as pattern may match non-spawner files (#186)
This commit is contained in:
parent
21b02a7508
commit
df53c16620
1 changed files with 10 additions and 2 deletions
|
|
@ -42,8 +42,16 @@ namespace Server.Engines.Spawners
|
|||
{
|
||||
var file = files[i];
|
||||
from.SendMessage("GenerateSpawners: Generating spawners for {0}...", file.Name);
|
||||
List<DynamicJson> spawners = JsonConfig.Deserialize<List<DynamicJson>>(file.FullName);
|
||||
ParseSpawnerList(from, spawners, options);
|
||||
|
||||
try
|
||||
{
|
||||
var spawners = JsonConfig.Deserialize<List<DynamicJson>>(file.FullName);
|
||||
ParseSpawnerList(from, spawners, options);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
from.SendMessage("GenerateSpawners: Exception parsing {0}, file may not be in the correct format.", file.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue