//similiar to StartDownloadingWorld, but operates assuming we can't rely on the current browser page to contain the level //all world references will be through Guids instead of LevelMetadata until the download completes public bool StartDownloadingOffPageWorld(Guid worldId, LevelDownloadOffPageCompleteEvent callback) { OffPageLevelInfo downloadInfo = new OffPageLevelInfo(); downloadInfo.WorldId = worldId; downloadInfo.downloadCallback = callback; return(0 != Web.Community.Async_GetWorldData(worldId, GetOffPageWorldDataCallback, downloadInfo)); }
private void GetOffPageWorldDataCallback(AsyncResult result) { OffPageLevelInfo downloadInfo = (OffPageLevelInfo)result.Param; if (result.Success) { AsyncResult_GetWorldData data = result as AsyncResult_GetWorldData; if (data != null) { data.World.Data.WorldId = data.World.Info.WorldId; downloadInfo.downloadCallback(data.World.Data, data.World.Info.ThumbnailBytes, downloadInfo.WorldId); } else { downloadInfo.downloadCallback(null, null, downloadInfo.WorldId); } } else { downloadInfo.downloadCallback(null, null, downloadInfo.WorldId); } }