chore(game-server): merge main (emulator fixes: contracts, shop, fortuna, friends, admin, presence) #16
@@ -18,11 +18,13 @@ public class GetSignalRConnection : ICloudScriptFunction<FYGetSignalRConnection,
|
||||
|
||||
private readonly PlayFabSettings _settings;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly ILogger<GetSignalRConnection> _logger;
|
||||
|
||||
public GetSignalRConnection(IOptions<PlayFabSettings> settings, IHttpContextAccessor httpContextAccessor)
|
||||
public GetSignalRConnection(IOptions<PlayFabSettings> settings, IHttpContextAccessor httpContextAccessor, ILogger<GetSignalRConnection> logger)
|
||||
{
|
||||
_settings = settings.Value;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task<FYGetSignalRConnectionResult> ExecuteAsync(FYGetSignalRConnection request)
|
||||
@@ -31,7 +33,8 @@ public class GetSignalRConnection : ICloudScriptFunction<FYGetSignalRConnection,
|
||||
var url = _settings.SignalRURL;
|
||||
|
||||
var remote = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress;
|
||||
if (remote != null && IsLan(remote))
|
||||
var lan = remote != null && IsLan(remote);
|
||||
if (lan)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -40,6 +43,8 @@ public class GetSignalRConnection : ICloudScriptFunction<FYGetSignalRConnection,
|
||||
catch { /* keep the configured URL on any parsing issue */ }
|
||||
}
|
||||
|
||||
_logger.LogInformation("GetSignalRConnection: remoteIp={Remote} lan={Lan} -> {Url}", remote, lan, url);
|
||||
|
||||
return Task.FromResult(new FYGetSignalRConnectionResult
|
||||
{
|
||||
Url = url,
|
||||
|
||||
Reference in New Issue
Block a user