예제 #1
0
        public JsonResult Load(string worldname)
        {
            var worldLocation = _worldFinder.Find(worldname);

            if (!worldLocation.Attributes.HasFlag(FileAttributes.Directory))
            {
                worldLocation = _worldArchivist.Decompress(worldname);
            }

            var worldFolder = new DirectoryInfo(worldLocation.FullName);
            var world       = _worldLoader.Load(worldFolder);

            return(Json(world));
        }
예제 #2
0
        private bool tryLoadWorldFolder(DirectoryInfo candiate, out WorldInfo world)
        {
            world = new WorldInfo();

            try
            {
                world = _worldLoader.Load(candiate);
                return(true);
            }
            catch (Exception ex)
            {
                _logger.LogInformation(ex, "Couldn't load world.");
                return(false);
            }
        }