Game seems to work
All checks were successful
Build Mau & Deploy Mau / build (push) Successful in 1m31s
Build Mau & Deploy Mau / deploy (push) Has been skipped

This commit is contained in:
DTieman
2024-05-05 17:08:02 +02:00
parent 694bc6147a
commit 90c9b0031c
20 changed files with 213 additions and 212 deletions

View File

@@ -5,21 +5,6 @@ namespace MauMau_Server.Websockets;
public static class WebsocketManager
{
public static void SendAsync(WebSocket socket, string message)
{
var bytes = Encoding.Default.GetBytes(message);
var arraySegment = new ArraySegment<byte>(bytes);
socket.SendAsync(arraySegment, WebSocketMessageType.Text, true, CancellationToken.None);
}
public static void BroadcastAsync(List<WebSocket> sockets, string message)
{
foreach (var socket in sockets)
{
SendAsync(socket, message);
}
}
public static async Task<WebSocketResponse> ReceiveAsync(WebSocket webSocket)
{
var buffer = new byte[4096];