public static void ProbePlanet(long planetId, TerrainObj_callback callback) { string fullURL = "probeplanet"; RestRequest request = new RestRequest(fullURL, Method.POST); request.AddParameter("planetid", planetId); apiClient.ExecuteAsync(request, (response) => { if (response.StatusCode == HttpStatusCode.OK) { TerrainObj newObj = response.Content.FromJson <TerrainObj>(); callback(newObj); } else { callback(null); } }); }
public static void FetchTerrain(long planetId, TerrainObj_callback callback) { string fullURL = "terrain"; RestRequest request = new RestRequest(fullURL, Method.GET); request.AddParameter("planetid", planetId); apiClient.ExecuteAsync(request, (response) => { if (response.StatusCode == HttpStatusCode.OK && response.Content != "null") { TerrainObj newObj = response.Content.FromJson <TerrainObj>(); callback(newObj); } else if (response.StatusCode != 0) { callback(null); } }); }
public static void FetchSolSysStatus(long solSysId, TerrainObj_callback callback) { string fullURL = "solsys"; RestRequest request = new RestRequest(fullURL, Method.GET); request.AddParameter("solsysid", solSysId); request.AddParameter("status", solSysId); apiClient.ExecuteAsync(request, (response) => { if (response.StatusCode == HttpStatusCode.OK) { TerrainObj newObj = response.Content.FromJson <TerrainObj>(); callback(newObj); } else if (response.StatusCode != 0) { callback(null); } }); }