feat: websockets
This commit is contained in:
@@ -5,13 +5,13 @@ namespace Ragon.Server.ENet;
|
||||
public sealed class ENetConnection: INetworkConnection
|
||||
{
|
||||
public ushort Id { get; }
|
||||
public INetworkChannel ReliableChannel { get; private set; }
|
||||
public INetworkChannel UnreliableChannel { get; private set; }
|
||||
public INetworkChannel Reliable { get; private set; }
|
||||
public INetworkChannel Unreliable { get; private set; }
|
||||
|
||||
public ENetConnection(Peer peer)
|
||||
{
|
||||
Id = (ushort) peer.ID;
|
||||
ReliableChannel = new ENetReliableChannel(peer, 0);
|
||||
UnreliableChannel = new ENetUnreliableChannel(peer, 1);
|
||||
Reliable = new ENetReliableChannel(peer, 0);
|
||||
Unreliable = new ENetUnreliableChannel(peer, 1);
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,8 @@ namespace Ragon.Server.ENet
|
||||
{
|
||||
if (!IsValidProtocol(_event.Data))
|
||||
{
|
||||
_logger.Warn("Mismatched protocol, close connection");
|
||||
_logger.Warn($"Mismatched protocol Server: {RagonVersion.Parse(_protocol)} Client: {RagonVersion.Parse(_event.Data)}, close connection");
|
||||
_event.Peer.DisconnectNow(0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -109,7 +110,6 @@ namespace Ragon.Server.ENet
|
||||
|
||||
private bool IsValidProtocol(uint protocol)
|
||||
{
|
||||
Console.WriteLine($"{protocol} {_protocol}");
|
||||
return protocol == _protocol;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user