feat: websockets
This commit is contained in:
@@ -32,7 +32,7 @@ public sealed class AuthorizationHandler: IHandler
|
||||
writer.WriteString(playerName);
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
context.Connection.ReliableChannel.Send(sendData);
|
||||
context.Connection.Reliable.Send(sendData);
|
||||
|
||||
_logger.Trace($"Player {context.Connection.Id}|{context.LobbyPlayer.Name} authorized");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public sealed class CreateHandler: IHandler
|
||||
writer.WriteString($"Room with id {roomId} already exists");
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
context.Connection.ReliableChannel.Send(sendData);
|
||||
context.Connection.Reliable.Send(sendData);
|
||||
|
||||
_logger.Trace($"Player {context.Connection.Id}|{context.LobbyPlayer.Name} join failed to room {roomId}, room already exist");
|
||||
return;
|
||||
@@ -79,6 +79,6 @@ public sealed class CreateHandler: IHandler
|
||||
writer.WriteString(room.Info.Map);
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
player.Connection.ReliableChannel.Send(sendData);
|
||||
player.Connection.Reliable.Send(sendData);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public sealed class JoinHandler : IHandler
|
||||
writer.WriteString(room.Info.Map);
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
player.Connection.ReliableChannel.Send(sendData);
|
||||
player.Connection.Reliable.Send(sendData);
|
||||
}
|
||||
|
||||
private void JoinFailed(LobbyPlayer player, RagonSerializer writer)
|
||||
@@ -57,6 +57,6 @@ public sealed class JoinHandler : IHandler
|
||||
writer.WriteString($"Room not exists");
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
player.Connection.ReliableChannel.Send(sendData);
|
||||
player.Connection.Reliable.Send(sendData);
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public sealed class JoinOrCreateHandler : IHandler
|
||||
writer.WriteString(room.Info.Map);
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
player.Connection.ReliableChannel.Send(sendData);
|
||||
player.Connection.Reliable.Send(sendData);
|
||||
|
||||
_logger.Trace($"Joined to room {room.Id}");
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public sealed class SceneLoadedHandler : IHandler
|
||||
foreach (var awaiter in room.ReadyPlayersList)
|
||||
{
|
||||
if (awaiter != roomPlayer)
|
||||
awaiter.Connection.ReliableChannel.Send(sendData);
|
||||
awaiter.Connection.Reliable.Send(sendData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,6 @@ public sealed class SceneLoadedHandler : IHandler
|
||||
|
||||
var sendData = writer.ToArray();
|
||||
foreach (var player in receviersList)
|
||||
player.Connection.ReliableChannel.Send(sendData);
|
||||
player.Connection.Reliable.Send(sendData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user