mirror of
https://github.com/CyberL1/MyMcRealms.git
synced 2025-04-02 14:08:36 -04:00
Compare commits
3 Commits
ead8d901f3
...
5ca12b1530
Author | SHA1 | Date | |
---|---|---|---|
5ca12b1530 | |||
4a34048841 | |||
f48ded5ceb |
@ -8,9 +8,9 @@ namespace Minecraft_Realms_Emulator.Controllers
|
||||
[RequireMinecraftCookie]
|
||||
public class SubscriptionsController : ControllerBase
|
||||
{
|
||||
[HttpGet("{id}")]
|
||||
[HttpGet("{wId}")]
|
||||
[CheckRealmOwner]
|
||||
public ActionResult<string> GetSubscription(int id)
|
||||
public ActionResult<string> GetSubscription(int wId)
|
||||
{
|
||||
return BadRequest("No subscription for you :(");
|
||||
}
|
||||
|
@ -147,18 +147,18 @@ namespace MyMcRealms.Controllers
|
||||
|
||||
[HttpPost("{wId}/reset")]
|
||||
[CheckRealmOwner]
|
||||
public ActionResult<string> ChangeSlot(int id)
|
||||
public ActionResult<string> ChangeSlot(int wId)
|
||||
{
|
||||
return BadRequest("lol nice try");
|
||||
}
|
||||
|
||||
[HttpPut("{id}/open")]
|
||||
[HttpPut("{wId}/open")]
|
||||
[CheckRealmOwner]
|
||||
public async Task<ActionResult<bool>> Open(int id)
|
||||
public async Task<ActionResult<bool>> Open(int wId)
|
||||
{
|
||||
var _api = new MyMcAPI.Wrapper(Environment.GetEnvironmentVariable("MYMC_API_KEY"));
|
||||
|
||||
var world = (await _api.GetAllServers()).Servers[id];
|
||||
var world = (await _api.GetAllServers()).Servers[wId];
|
||||
var api = new MyMcAPI.Wrapper(world.OwnersToken);
|
||||
|
||||
if (world == null) return NotFound("World not found");
|
||||
@ -168,13 +168,13 @@ namespace MyMcRealms.Controllers
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
[HttpPut("{id}/close")]
|
||||
[HttpPut("{wId}/close")]
|
||||
[CheckRealmOwner]
|
||||
public async Task<ActionResult<bool>> Close(int id)
|
||||
public async Task<ActionResult<bool>> Close(int wId)
|
||||
{
|
||||
var _api = new MyMcAPI.Wrapper(Environment.GetEnvironmentVariable("MYMC_API_KEY"));
|
||||
|
||||
var world = (await _api.GetAllServers()).Servers[id];
|
||||
var world = (await _api.GetAllServers()).Servers[wId];
|
||||
var api = new MyMcAPI.Wrapper(world.OwnersToken);
|
||||
|
||||
if (world == null) return NotFound("World not found");
|
||||
|
@ -36,7 +36,7 @@ namespace Minecraft_Realms_Emulator.Middlewares
|
||||
return;
|
||||
}
|
||||
|
||||
if (!attribute.IsRealmOwner(playerUUID, server.Ops[0].Uuid))
|
||||
if (!attribute.IsRealmOwner(playerUUID, server.Ops[0].Uuid.Replace("-", "")))
|
||||
{
|
||||
httpContext.Response.StatusCode = 403;
|
||||
await httpContext.Response.WriteAsync("You don't own this world");
|
||||
|
Loading…
x
Reference in New Issue
Block a user