only default to IPv4 when parsing

update postgres target version to 12.9
This commit is contained in:
RaidMax 2022-02-01 14:27:16 -06:00
parent 3b532cf1f7
commit 6ca94f8da8
2 changed files with 6 additions and 3 deletions

View File

@ -94,7 +94,7 @@ namespace IW4MAdmin.Application.Extensions
postgresqlOptions => postgresqlOptions =>
{ {
postgresqlOptions.EnableRetryOnFailure(); postgresqlOptions.EnableRetryOnFailure();
postgresqlOptions.SetPostgresVersion(new Version("9.4")); postgresqlOptions.SetPostgresVersion(new Version("12.9"));
}) })
.UseLoggerFactory(sp.GetRequiredService<ILoggerFactory>()).Options); .UseLoggerFactory(sp.GetRequiredService<ILoggerFactory>()).Options);
return services; return services;

View File

@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
@ -25,7 +26,6 @@ using Data.Models;
using Data.Models.Server; using Data.Models.Server;
using IW4MAdmin.Application.Commands; using IW4MAdmin.Application.Commands;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using SharedLibraryCore.Formatting;
using static Data.Models.Client.EFClient; using static Data.Models.Client.EFClient;
namespace IW4MAdmin namespace IW4MAdmin
@ -1076,7 +1076,10 @@ namespace IW4MAdmin
{ {
try try
{ {
ResolvedIpEndPoint = new IPEndPoint((await Dns.GetHostAddressesAsync(IP)).First(), Port); ResolvedIpEndPoint =
new IPEndPoint(
(await Dns.GetHostAddressesAsync(IP)).First(address =>
address.AddressFamily == AddressFamily.InterNetwork), Port);
} }
catch (Exception ex) catch (Exception ex)
{ {