mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-24 15:18:20 -05:00
fix: only show player owned worlds
This commit is contained in:
parent
eeb0ddf64f
commit
05a3967799
@ -19,16 +19,14 @@ namespace Minecraft_Realms_Emulator.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<ActionResult<ServersArray>> GetWorlds()
|
public async Task<ActionResult<ServersArray>> GetWorlds()
|
||||||
{
|
{
|
||||||
var worlds = await _context.Worlds.ToListAsync();
|
|
||||||
|
|
||||||
string cookie = Request.Headers.Cookie;
|
string cookie = Request.Headers.Cookie;
|
||||||
|
|
||||||
string playerUUID = cookie.Split(";")[0].Split(":")[2];
|
string playerUUID = cookie.Split(";")[0].Split(":")[2];
|
||||||
string playerName = cookie.Split(";")[1].Split("=")[1];
|
string playerName = cookie.Split(";")[1].Split("=")[1];
|
||||||
|
|
||||||
var hasWorld = worlds.Find(p => p.OwnerUUID == playerUUID);
|
var worlds = await _context.Worlds.Where(w => w.OwnerUUID == playerUUID).ToListAsync();
|
||||||
|
|
||||||
if (hasWorld == null)
|
if (worlds == null)
|
||||||
{
|
{
|
||||||
var world = new World
|
var world = new World
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user