wip
This commit is contained in:
@@ -4,7 +4,7 @@ using Ragon.Core.Lobby;
|
||||
|
||||
namespace Ragon.Core.Handlers;
|
||||
|
||||
public sealed class AuthHandler: IHandler
|
||||
public sealed class AuthorizationHandler: IHandler
|
||||
{
|
||||
private Logger _logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
@@ -50,7 +50,7 @@ public sealed class CreateHandler: IHandler
|
||||
var lobbyPlayer = context.LobbyPlayer;
|
||||
var roomPlayer = new RoomPlayer(lobbyPlayer.Connection, lobbyPlayer.Id, lobbyPlayer.Name);
|
||||
|
||||
var room = new Room(roomId, information, new PluginBase());
|
||||
var room = new Room(roomId, information);
|
||||
room.AddPlayer(roomPlayer);
|
||||
|
||||
context.Room?.RemovePlayer(context.RoomPlayer);
|
||||
@@ -62,6 +62,8 @@ public sealed class CreateHandler: IHandler
|
||||
|
||||
JoinSuccess(roomPlayer, room, writer);
|
||||
|
||||
context.Loop.Run(room);
|
||||
|
||||
_logger.Trace($"Player {context.Connection.Id}|{context.LobbyPlayer.Name} joined to room {room.Id}");
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public sealed class JoinOrCreateHandler : IHandler
|
||||
Min = _roomParameters.Min,
|
||||
};
|
||||
|
||||
var room = new Room(roomId, information, new PluginBase());
|
||||
var room = new Room(roomId, information);
|
||||
context.Lobby.Persist(room);
|
||||
|
||||
var roomPlayer = new RoomPlayer(lobbyPlayer.Connection, lobbyPlayer.Id, lobbyPlayer.Name);
|
||||
@@ -57,6 +57,8 @@ public sealed class JoinOrCreateHandler : IHandler
|
||||
_logger.Trace($"Player {context.Connection.Id}|{context.LobbyPlayer.Name} create room {room.Id} {information}");
|
||||
|
||||
JoinSuccess(roomPlayer, room, writer);
|
||||
|
||||
context.Loop.Run(room);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user