1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-09-19 07:52:52 -04:00

chore: remove function

This commit is contained in:
CyberL1 2024-04-23 17:58:07 +02:00
parent 4af592a543
commit f5c0963473
2 changed files with 2 additions and 16 deletions

View File

@ -3,7 +3,6 @@ using Microsoft.EntityFrameworkCore;
using MyMcRealms.Attributes; using MyMcRealms.Attributes;
using MyMcRealms.Data; using MyMcRealms.Data;
using MyMcRealms.Entities; using MyMcRealms.Entities;
using MyMcRealms.MyMcAPI;
using MyMcRealms.MyMcAPI.Responses; using MyMcRealms.MyMcAPI.Responses;
using MyMcRealms.Requests; using MyMcRealms.Requests;
using MyMcRealms.Responses; using MyMcRealms.Responses;
@ -227,7 +226,7 @@ namespace MyMcRealms.Controllers
public async Task<ActionResult<Connection>> Join(int wId) public async Task<ActionResult<Connection>> Join(int wId)
{ {
AllServersResponse AllServers = await new MyMcAPI.MyMcAPI(Environment.GetEnvironmentVariable("MYMC_API_KEY")).GetAllServers(); AllServersResponse AllServers = await new MyMcAPI.MyMcAPI(Environment.GetEnvironmentVariable("MYMC_API_KEY")).GetAllServers();
ConnectionResponse connection = new() ConnectionResponse connection = new()
{ {
Address = AllServers.Servers[wId].Connect, Address = AllServers.Servers[wId].Connect,

View File

@ -13,26 +13,13 @@ namespace MyMcRealms.MyMcAPI
httpClient.BaseAddress = new Uri(ApiUrl); 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() public async Task<AllServersResponse?> GetAllServers()
{ {
AllServersResponse response = await httpClient.GetFromJsonAsync<AllServersResponse>($"list_all_servers/{Environment.GetEnvironmentVariable("MYMC_SERVER_LIST_KEY")}"); AllServersResponse response = await httpClient.GetFromJsonAsync<AllServersResponse>($"list_all_servers/{Environment.GetEnvironmentVariable("MYMC_SERVER_LIST_KEY")}");
if (response == null) if (response == null)
{ {
Console.WriteLine("error while doing GET/list_all_servers"); Console.WriteLine("error while doing GET /list_all_servers");
return null; return null;
} }