mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-09 07:58:23 -05:00
Separate player entity from player request
This commit is contained in:
parent
c472eff002
commit
9f90a40aee
@ -2,6 +2,7 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Minecraft_Realms_Emulator.Data;
|
using Minecraft_Realms_Emulator.Data;
|
||||||
using Minecraft_Realms_Emulator.Entities;
|
using Minecraft_Realms_Emulator.Entities;
|
||||||
|
using Minecraft_Realms_Emulator.Requests;
|
||||||
using Minecraft_Realms_Emulator.Responses;
|
using Minecraft_Realms_Emulator.Responses;
|
||||||
|
|
||||||
namespace Minecraft_Realms_Emulator.Controllers
|
namespace Minecraft_Realms_Emulator.Controllers
|
||||||
@ -91,7 +92,7 @@ namespace Minecraft_Realms_Emulator.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{wId}")]
|
[HttpPost("{wId}")]
|
||||||
public async Task<ActionResult<World>> InvitePlayer(int wId, Player body)
|
public async Task<ActionResult<World>> InvitePlayer(int wId, PlayerRequest body)
|
||||||
{
|
{
|
||||||
string cookie = Request.Headers.Cookie;
|
string cookie = Request.Headers.Cookie;
|
||||||
string playerName = cookie.Split(";")[1].Split("=")[1];
|
string playerName = cookie.Split(";")[1].Split("=")[1];
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
public bool Accepted { get; set; }
|
public bool Accepted { get; set; }
|
||||||
public bool Online { get; set; }
|
public bool Online { get; set; }
|
||||||
public string Permission { get; set; } = "MEMBER";
|
public string Permission { get; set; } = "MEMBER";
|
||||||
public World? World { get; set; }
|
public World World { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
Minecraft-Realms-Emulator/Requests/PlayerRequest.cs
Normal file
13
Minecraft-Realms-Emulator/Requests/PlayerRequest.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace Minecraft_Realms_Emulator.Requests
|
||||||
|
{
|
||||||
|
public class PlayerRequest
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
public string Uuid { get; set; } = string.Empty;
|
||||||
|
public bool Operator { get; set; }
|
||||||
|
public bool Accepted { get; set; }
|
||||||
|
public bool Online { get; set; }
|
||||||
|
public string Permission { get; set; } = "MEMBER";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user