mirror of
https://github.com/MeowCraftMC/CrystalConnector
synced 2025-05-22 02:43:00 +00:00
@@ -29,10 +29,12 @@ public class WebSocketHandler
|
||||
if (!webSocket.GetConnectionInfo().Authenticated)
|
||||
{
|
||||
var secret = reader.ReadTextString();
|
||||
var name = reader.ReadTextString();
|
||||
if (secret == Config.GetSecretKey())
|
||||
{
|
||||
Logger.LogInformation("Client {Id} authorized", webSocket.GetConnectionInfo().Id);
|
||||
Logger.LogInformation("Client {Name}({Id}) authorized", name, webSocket.GetConnectionInfo().Id);
|
||||
webSocket.GetConnectionInfo().Authenticated = true;
|
||||
webSocket.GetConnectionInfo().Name = name;
|
||||
await webSocket.Send(new S2CAuthenticatedPacket().Write);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user