feat: websockets

This commit is contained in:
2022-12-20 12:20:52 -08:00
parent ab85578ccf
commit a5a67963be
24 changed files with 276 additions and 69 deletions
+1 -1
View File
@@ -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");
}
+2 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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}");
}
+2 -2
View File
@@ -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);
}
}