mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
feat: Add PlayerReputation handling and WebSocket handshake for 2018 client
This commit is contained in:
@@ -26,5 +26,6 @@ public static class Player2018Mapper
|
||||
ProfileImageName = p.ProfileImageName ?? string.Empty,
|
||||
JuniorProfile = p.IsJunior,
|
||||
HasBirthday = p.Birthday.HasValue,
|
||||
PlayerReputation = new PlayerReputation2018 { Noteriety = p.Reputation },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -37,6 +37,17 @@ public class NotificationController(
|
||||
|
||||
using var ws = await HttpContext.WebSockets.AcceptWebSocketAsync();
|
||||
log.LogInformation("[notify] 2018 client opened notification WebSocket");
|
||||
|
||||
// HANDSHAKE: on connect the 2018 client enters PerformingHandshake and
|
||||
// blocks ("Connecting to RecNet") until the SERVER sends a handshake
|
||||
// message — any valid JSON object marks the channel Connected
|
||||
// (RecNet.cs:49616-49620, JFBBMEIDBNA just needs dict != null). Without
|
||||
// it both sides wait for each other ~35s, then the client aborts the
|
||||
// channel and shows "Failed to connect to RecNet". Send {} immediately.
|
||||
var handshake = System.Text.Encoding.UTF8.GetBytes("{}");
|
||||
await ws.SendAsync(handshake, WebSocketMessageType.Text, endOfMessage: true,
|
||||
HttpContext.RequestAborted);
|
||||
|
||||
var buf = new byte[4096];
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user