✨ http-commands
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Ragon.Server.Room;
|
||||
|
||||
namespace Ragon.Server.Plugin.Web;
|
||||
|
||||
[Serializable]
|
||||
public class PlayerDto
|
||||
{
|
||||
public string Id { get; set;}
|
||||
public string Name { get; set; }
|
||||
|
||||
public PlayerDto(RagonRoomPlayer ragonRoomPlayer)
|
||||
{
|
||||
Id = ragonRoomPlayer.Id;
|
||||
Name = ragonRoomPlayer.Name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Ragon.Server.Room;
|
||||
|
||||
namespace Ragon.Server.Plugin.Web;
|
||||
|
||||
[Serializable]
|
||||
public class RoomDto
|
||||
{
|
||||
public string Id { get; set;}
|
||||
public int PlayerMin { get; set; }
|
||||
public int PlayerMax { get; set; }
|
||||
public int PlayerCount { get; set; }
|
||||
public PlayerDto[] Players { get; set; }
|
||||
|
||||
public RoomDto(RagonRoom room)
|
||||
{
|
||||
Id = room.Id;
|
||||
PlayerMin = room.PlayerMin;
|
||||
PlayerMax = room.PlayerMax;
|
||||
PlayerCount = room.PlayerCount;
|
||||
|
||||
Players = room.PlayerList.Select(p => new PlayerDto(p)).ToArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user