| | 1 | | using DCL.Configuration; |
| | 2 | |
|
| | 3 | | public static class BIWUrlUtils |
| | 4 | | { |
| 110 | 5 | | public static string GetUrlSceneObjectContent() { return BIWSettings.BASE_URL_SCENE_OBJECT_CONTENT.Replace("{ENV}", |
| | 6 | |
|
| 0 | 7 | | public static string GetManifestJSON(string jsonManifest) { return "{\"manifest\":" + jsonManifest + "}"; } |
| | 8 | |
|
| | 9 | | public static string GetBuilderAPIBaseUrl() |
| | 10 | | { |
| 8 | 11 | | return GetResolvedEnviromentUrl(BIWSettings.BASE_URL_BUILDER_API); |
| | 12 | | } |
| | 13 | |
|
| | 14 | | public static string GetBuilderProjecThumbnailUrl(string projectId, string filename) |
| | 15 | | { |
| 0 | 16 | | string resolvedUrl = GetResolvedEnviromentUrl(BIWSettings.BASE_URL_BUILDER_PROJECT_THUMBNAIL); |
| 0 | 17 | | resolvedUrl = resolvedUrl.Replace("{id}", projectId) +filename; |
| 0 | 18 | | return resolvedUrl; |
| | 19 | | } |
| | 20 | |
|
| 32 | 21 | | public static string GetUrlAssetPackContent() { return GetResolvedEnviromentUrl(BIWSettings.BASE_URL_ASSETS_PACK_CON |
| | 22 | |
|
| | 23 | | private static string GetResolvedEnviromentUrl(string url) |
| | 24 | | { |
| 40 | 25 | | return url.Replace("{ENV}", GetEnvBase()); |
| | 26 | | } |
| | 27 | |
|
| | 28 | | private static bool IsMainNet() |
| | 29 | | { |
| 150 | 30 | | return KernelConfig.i.Get().network == "mainnet"; |
| | 31 | | } |
| | 32 | |
|
| | 33 | | private static string GetEnvBase() |
| | 34 | | { |
| 150 | 35 | | if (IsMainNet()) |
| 150 | 36 | | return "org"; |
| | 37 | |
|
| 0 | 38 | | return "io"; |
| | 39 | | } |
| | 40 | | } |