mirror of
https://github.com/CyberL1/MyMcRealms.git
synced 2024-11-24 06:58:22 -05:00
chore: remove function
This commit is contained in:
parent
4af592a543
commit
f5c0963473
@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore;
|
||||
using MyMcRealms.Attributes;
|
||||
using MyMcRealms.Data;
|
||||
using MyMcRealms.Entities;
|
||||
using MyMcRealms.MyMcAPI;
|
||||
using MyMcRealms.MyMcAPI.Responses;
|
||||
using MyMcRealms.Requests;
|
||||
using MyMcRealms.Responses;
|
||||
@ -227,7 +226,7 @@ namespace MyMcRealms.Controllers
|
||||
public async Task<ActionResult<Connection>> Join(int wId)
|
||||
{
|
||||
AllServersResponse AllServers = await new MyMcAPI.MyMcAPI(Environment.GetEnvironmentVariable("MYMC_API_KEY")).GetAllServers();
|
||||
|
||||
|
||||
ConnectionResponse connection = new()
|
||||
{
|
||||
Address = AllServers.Servers[wId].Connect,
|
||||
|
@ -13,26 +13,13 @@ namespace MyMcRealms.MyMcAPI
|
||||
httpClient.BaseAddress = new Uri(ApiUrl);
|
||||
}
|
||||
|
||||
public async Task<HelloResponse?> GetHello()
|
||||
{
|
||||
HelloResponse response = await httpClient.GetFromJsonAsync<HelloResponse>("hello");
|
||||
|
||||
if (response == null)
|
||||
{
|
||||
Console.WriteLine($"error while doing GET /hello");
|
||||
return null;
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public async Task<AllServersResponse?> GetAllServers()
|
||||
{
|
||||
AllServersResponse response = await httpClient.GetFromJsonAsync<AllServersResponse>($"list_all_servers/{Environment.GetEnvironmentVariable("MYMC_SERVER_LIST_KEY")}");
|
||||
|
||||
if (response == null)
|
||||
{
|
||||
Console.WriteLine("error while doing GET/list_all_servers");
|
||||
Console.WriteLine("error while doing GET /list_all_servers");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user