Files
MauMau-Server/Room/Lobby.cs
DTieman 694bc6147a
Some checks failed
Build Mau & Deploy Mau / build (push) Failing after 1m15s
Build Mau & Deploy Mau / deploy (push) Has been skipped
Partial rewrite, missing:
- Correctly parsing incoming messages
- Sending the gamestate after relevant actions
2024-05-04 19:55:11 +02:00

39 lines
947 B
C#

using MauMau_Server.Mau;
using MauMau_Server.Websockets;
namespace MauMau_Server.Room;
public class Lobby : RoomType
{
private readonly Room _room;
public Lobby(Room room)
{
_room = room;
}
public Lobby(Room room, ConnectionInstance connection)
{
_room = room;
Console.WriteLine(connection.Name + " won the game!");
}
public void OnMessage(ConnectionInstance sender, string message)
{
// TODO: Add a way to change game settings
if (sender == _room._host)
{
_room._roomType = new Game(_room, _room.Connections);
}
}
public void OnConnect(ConnectionInstance connection)
{
var roomMessage = new RoomMessage("LOBBY", MessageType.INFO, _room.Connections, connection.Name + " joined!");
}
public void OnDisconnect(ConnectionInstance connection)
{
throw new NotImplementedException();
}
}