예제 #1
0
        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);
                }
            });
        }
예제 #2
0
        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);
                }
            });
        }
예제 #3
0
        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);
                }
            });
        }