Files
the-cycle/src/Prospect.Server.Api/Services/CloudScript/Functions/RequestUsersPingRequest.cs
T
neckfireandClaude Opus 4.8 310e2bf7e9
Build & Deploy / build (push) Successful in 24s
feat(social): friends list resolution + fix ping request 500
- RequestUsersPingRequest: the client sends ping=2147483648 (int.MaxValue+1)
  for "no ping", which overflowed the int field and made every ping request
  return 500. Widened to long.
- ClientsideFriendsImport: persist the imported Steam friend ids per user.
- GetFriendList: resolve those ids to the players that exist on this server
  (batch lookup by Steam auth key) and return them as friends. Response
  shape is best-effort pending in-game confirmation.
- DbUserService.FindManyAsync: batch-resolve auth keys to players.

First step of the station lobby (see friends on the server). Squad
formation / invite flow to follow once friends are visible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 14:18:44 +02:00

46 lines
1.3 KiB
C#

using System.Text.Json.Serialization;
using Prospect.Server.Api.Services.CloudScript;
public class RegionObject
{
[JsonPropertyName("region")]
public string Region { get; set; }
[JsonPropertyName("ping")]
public long Ping { get; set; } // client sends 2147483648 (int.MaxValue+1) for "no ping" -> must be long or deserialization 500s
[JsonPropertyName("instanceType")]
public int InstanceType { get; set; }
}
public class RequestUsersPingRequestRequest
{
[JsonPropertyName("pings")]
public RegionObject[] Pings { get; set; }
[JsonPropertyName("countryCode")]
public string CountryCode { get; set; }
}
public class RequestUsersPingRequestResponse
{
// TODO: Unknown structure
}
[CloudScriptFunction("RequestUsersPingRequest")]
public class RequestUsersPingRequestFunction : ICloudScriptFunction<RequestUsersPingRequestRequest, RequestUsersPingRequestResponse>
{
private readonly ILogger<RequestUsersPingRequestFunction> _logger;
public RequestUsersPingRequestFunction(ILogger<RequestUsersPingRequestFunction> logger)
{
_logger = logger;
}
public async Task<RequestUsersPingRequestResponse> ExecuteAsync(RequestUsersPingRequestRequest request)
{
_logger.LogInformation("Processing ping request");
return new RequestUsersPingRequestResponse
{
};
}
}