InputSource inputSource = new InputSource(bufferedInputStream);
DOMParser builder = new DOMParser();
try {
builder.parse(inputSource);
} catch (SAXException exception) {
return new CommandResult(CommandResult.RESULT_ERROR, "SAXException : " + exception.getMessage());
} catch (IOException exception) {
return new CommandResult(CommandResult.RESULT_ERROR, "IOException : " + exception.getMessage());
}
NodeList nodeList = builder.getDocument().getElementsByTagName("WorldMap");
Node worldMapNode = nodeList.item(0);
WorldMap worldMap = new WorldMap();
(new WorldMapXMLWrapper(worldMap)).initializeFromNode(realm, worldMapNode);
realm.setWorldMap(worldMap);
realm.setPathFinder(new AStarPathFinder(realm, 100));
return new CommandResult(CommandResult.RESULT_OK, "");
}