removed auth and fixed id bug
This commit is contained in:
14
Room/Room.cs
14
Room/Room.cs
@@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text.Json;
|
||||
using MauMau_Server.Mau;
|
||||
|
||||
@@ -62,13 +60,12 @@ public class Room
|
||||
private ConnectionInstance AddConnection(WebSocket socket)
|
||||
{
|
||||
var connectionId = Guid.NewGuid().ToString();
|
||||
// TODO: Why does every connection have the same connectionId?
|
||||
var connection = new ConnectionInstance(connectionId, socket);
|
||||
_connections.Add(connection);
|
||||
return connection;
|
||||
}
|
||||
|
||||
public void RemoveConnection(string socketId)
|
||||
private void RemoveConnection(string socketId)
|
||||
{
|
||||
_connections.RemoveAll(connection => connection.ConnectionId == socketId);
|
||||
}
|
||||
@@ -102,12 +99,7 @@ public class Room
|
||||
return _connections.Select(connection => connection.Socket).ToList();
|
||||
}
|
||||
|
||||
private static byte[] EmptyBuffer()
|
||||
{
|
||||
return new byte[4096];
|
||||
}
|
||||
|
||||
public bool IsEmpty()
|
||||
private bool IsEmpty()
|
||||
{
|
||||
return _connections.Count == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user