From 5b3286c2a6de48fd028ca758a15f884a9b8ddb9d Mon Sep 17 00:00:00 2001 From: Nick Blakely Date: Sun, 4 Sep 2022 20:29:59 -0700 Subject: [PATCH] Merge missing commits from 1.5.0.x branch. --- Giants.Launcher/Forms/LauncherForm.cs | 24 +++- Giants.Launcher/Forms/OptionsForm.cs | 32 +++-- Giants.Launcher/Native/NativeMethods.cs | 6 +- Giants.Launcher/Native/RendererInterop.cs | 2 + .../Properties/Resources.Designer.cs | 9 ++ Giants.Launcher/Properties/Resources.resx | 3 + Giants.Services/Core/Entities/ServerInfo.cs | 4 +- .../Services/IServerRegistryService.cs | 2 + .../Services/ServerRegistryService.cs | 37 +++++- .../Store/CosmosDbServerRegistryStore.cs | 115 +++++++++++------- Giants.Services/Store/IServerRegistryStore.cs | 2 - .../Controllers/CommunityController.cs | 1 + .../Controllers/CrashReportsController.cs | 1 + .../Controllers/ServersController.cs | 12 ++ .../Controllers/VersionController.cs | 1 + Giants.WebApi/appsettings.json | 1 + NavMeshGenerator/NavMeshGenerator.vcxproj | 3 + ServerConsoleExample/ServerConsole.rc | Bin 10702 -> 10712 bytes ServerConsoleExample/ServerConsole.vcxproj | 4 +- ServerConsoleExample/ServerConsoleApp.cpp | 1 - ServerConsoleExample/ServerDialog.cpp | 6 +- ServerConsoleExample/Utils.cpp | 12 -- ServerConsoleExample/Utils.h | 5 - Shaders/Shaders.vcxproj | 3 + 24 files changed, 191 insertions(+), 95 deletions(-) delete mode 100644 ServerConsoleExample/Utils.cpp delete mode 100644 ServerConsoleExample/Utils.h diff --git a/Giants.Launcher/Forms/LauncherForm.cs b/Giants.Launcher/Forms/LauncherForm.cs index 2f26608..95057dd 100644 --- a/Giants.Launcher/Forms/LauncherForm.cs +++ b/Giants.Launcher/Forms/LauncherForm.cs @@ -16,7 +16,6 @@ namespace Giants.Launcher public partial class LauncherForm : Form { // Constant settings - private const string GameName = "Giants: Citizen Kabuto"; private const string GamePath = "GiantsMain.exe"; private const string RegistryKey = @"HKEY_CURRENT_USER\Software\PlanetMoon\Giants"; private const string RegistryValue = "DestDir"; @@ -38,7 +37,7 @@ namespace Giants.Launcher this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); // Set window title - this.Text = GameName; + this.SetTitle(); // Read newer file-based game settings this.config = new Config(); @@ -97,7 +96,7 @@ namespace Giants.Launcher private void btnOptions_Click(object sender, EventArgs e) { - OptionsForm form = new OptionsForm(GameName + " Options", this.gamePath); + OptionsForm form = new OptionsForm(Resources.AppName + " Options", this.gamePath); form.StartPosition = FormStartPosition.CenterParent; form.ShowDialog(); @@ -116,7 +115,7 @@ namespace Giants.Launcher if (this.gamePath == null || !File.Exists(this.gamePath)) { - string message = string.Format(Resources.AppNotFound, GameName); + string message = string.Format(Resources.AppNotFound, Resources.AppName); MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); return; @@ -131,7 +130,7 @@ namespace Giants.Launcher Version gameVersion = VersionHelper.GetGameVersion(this.gamePath); if (gameVersion == null) { - string message = string.Format(Resources.AppNotFound, GameName); + string message = string.Format(Resources.AppNotFound, Resources.AppName); MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } @@ -330,6 +329,21 @@ namespace Giants.Launcher } Process.Start(this.communityAppUri); + } + + private void SetTitle() + { + string title = Resources.AppName; + +#if DEBUG + title += " DEBUG"; +#endif + +#if BETA + title += " BETA"; +#endif + + this.Text = title; } } } diff --git a/Giants.Launcher/Forms/OptionsForm.cs b/Giants.Launcher/Forms/OptionsForm.cs index 3ae6b7e..37a1bb7 100644 --- a/Giants.Launcher/Forms/OptionsForm.cs +++ b/Giants.Launcher/Forms/OptionsForm.cs @@ -22,6 +22,7 @@ namespace Giants.Launcher { // Must come first as other options depend on it this.PopulateRenderers(); + this.SetRenderer(); this.PopulateResolution(); this.PopulateAnisotropy(); @@ -40,6 +41,24 @@ namespace Giants.Launcher .ToArray()); } + private void SetRenderer() + { + string selectedRenderer = GameSettings.Get(RegistryKeys.Renderer); + RendererInfo renderer = + GameSettings.CompatibleRenderers.Find( + r => Path.GetFileName(r.FilePath).Equals(selectedRenderer, StringComparison.OrdinalIgnoreCase)); + + if (renderer != null) + { + this.cmbRenderer.SelectedItem = renderer; + } + else + { + renderer = GameSettings.CompatibleRenderers.Find(r => r.FileName == "gg_dx7r.dll"); + this.cmbRenderer.SelectedItem = renderer; + } + } + private void SetOptions() { var resolutions = (List)this.cmbResolution.DataSource; @@ -53,19 +72,6 @@ namespace Giants.Launcher this.cmbAntialiasing.SelectedIndex = 0; this.chkUpdates.Checked = GameSettings.Get(RegistryKeys.NoAutoUpdate) != 1; - - RendererInfo renderer = GameSettings.CompatibleRenderers.Find( - r => StringComparer.OrdinalIgnoreCase.Compare(Path.GetFileName(r.FilePath), GameSettings.Get(RegistryKeys.Renderer)) == 0); - - if (renderer != null) - { - this.cmbRenderer.SelectedItem = renderer; - } - else - { - renderer = GameSettings.CompatibleRenderers.Find(r => r.FileName == "gg_dx7r.dll"); - this.cmbRenderer.SelectedItem = renderer; - } } private void PopulateAntialiasing() diff --git a/Giants.Launcher/Native/NativeMethods.cs b/Giants.Launcher/Native/NativeMethods.cs index 4d92538..0236db9 100644 --- a/Giants.Launcher/Native/NativeMethods.cs +++ b/Giants.Launcher/Native/NativeMethods.cs @@ -6,9 +6,13 @@ namespace Giants.Launcher { static class NativeMethods { - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", SetLastError = true)] public static extern IntPtr LoadLibrary(string dllToLoad); + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetDllDirectory(string lpPathName); + [DllImport("kernel32.dll")] public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); diff --git a/Giants.Launcher/Native/RendererInterop.cs b/Giants.Launcher/Native/RendererInterop.cs index 772fd6e..97bf5e3 100644 --- a/Giants.Launcher/Native/RendererInterop.cs +++ b/Giants.Launcher/Native/RendererInterop.cs @@ -58,6 +58,8 @@ namespace Giants.Launcher { try { + NativeMethods.SetDllDirectory(Environment.CurrentDirectory); + // Make interop call to native renderer DLLs to get capability info var interopCaps = new RendererInterop.GFXCapabilityInfo(); string path = Path.Combine(file.DirectoryName, file.Name); diff --git a/Giants.Launcher/Properties/Resources.Designer.cs b/Giants.Launcher/Properties/Resources.Designer.cs index fe22c7f..07075c4 100644 --- a/Giants.Launcher/Properties/Resources.Designer.cs +++ b/Giants.Launcher/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ namespace Giants.Launcher { } } + /// + /// Looks up a localized string similar to Giants: Citizen Kabuto. + /// + internal static string AppName { + get { + return ResourceManager.GetString("AppName", resourceCulture); + } + } + /// /// Looks up a localized string similar to Could not locate an installation of {0}. The launcher will now exit.. /// diff --git a/Giants.Launcher/Properties/Resources.resx b/Giants.Launcher/Properties/Resources.resx index 0447d91..1a3bb72 100644 --- a/Giants.Launcher/Properties/Resources.resx +++ b/Giants.Launcher/Properties/Resources.resx @@ -205,4 +205,7 @@ Settings file {0} was not found. + + Giants: Citizen Kabuto + \ No newline at end of file diff --git a/Giants.Services/Core/Entities/ServerInfo.cs b/Giants.Services/Core/Entities/ServerInfo.cs index 4fa3530..6072e23 100644 --- a/Giants.Services/Core/Entities/ServerInfo.cs +++ b/Giants.Services/Core/Entities/ServerInfo.cs @@ -4,7 +4,7 @@ public class ServerInfo : DataContract.V1.ServerInfo, IIdentifiable { - public string id => this.HostIpAddress; + public string id => $"{this.HostIpAddress}-{this.GameName}-{this.Port}"; public string DocumentType => nameof(ServerInfo); @@ -17,6 +17,8 @@ return obj is ServerInfo info && base.Equals(obj) && this.HostIpAddress == info.HostIpAddress && + this.Port == info.Port && + this.GameName == info.GameName && this.DocumentType == info.DocumentType; } diff --git a/Giants.Services/Services/IServerRegistryService.cs b/Giants.Services/Services/IServerRegistryService.cs index 1db18e0..0022715 100644 --- a/Giants.Services/Services/IServerRegistryService.cs +++ b/Giants.Services/Services/IServerRegistryService.cs @@ -7,6 +7,8 @@ { Task DeleteServer(string ipAddress); + Task DeleteServer(string ipAddress, string gameName, int port); + Task> GetAllServers(); Task AddServer(ServerInfo server); diff --git a/Giants.Services/Services/ServerRegistryService.cs b/Giants.Services/Services/ServerRegistryService.cs index dcf13a5..b8d11f5 100644 --- a/Giants.Services/Services/ServerRegistryService.cs +++ b/Giants.Services/Services/ServerRegistryService.cs @@ -4,16 +4,18 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; + using AutoMapper; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; public class ServerRegistryService : IServerRegistryService { - private static readonly string[] SupportedGameNames = new[] { "Giants" }; + private static readonly string[] SupportedGameNames = new[] { "Giants", "Giants Beta", "Giants Beta Dedicated", "Giants Dedicated" }; private readonly ILogger logger; private readonly IServerRegistryStore registryStore; private readonly IConfiguration configuration; private readonly int maxServerCount; + private readonly int maxServersPerIp; public ServerRegistryService( ILogger logger, @@ -24,6 +26,7 @@ this.registryStore = registryStore; this.configuration = configuration; this.maxServerCount = Convert.ToInt32(this.configuration["MaxServerCount"]); + this.maxServersPerIp = Convert.ToInt32(this.configuration["MaxServersPerIp"]); } public async Task AddServer( @@ -32,11 +35,19 @@ ArgumentUtility.CheckForNull(serverInfo, nameof(serverInfo)); ArgumentUtility.CheckStringForNullOrEmpty(serverInfo.HostIpAddress, nameof(serverInfo.HostIpAddress)); + string gameName = serverInfo.GameName.Replace("Dedicated", string.Empty).Trim(); + serverInfo.GameName = gameName; if (!SupportedGameNames.Contains(serverInfo.GameName, StringComparer.OrdinalIgnoreCase)) { throw new ArgumentException($"Unsupported game name {serverInfo.GameName}", nameof(serverInfo)); } + var existingServers = await this.registryStore.GetServerInfos(whereExpression: x => x.HostIpAddress == serverInfo.HostIpAddress); + if (existingServers.GroupBy(g => new { g.HostIpAddress }).Any(g => g.Count() > this.maxServersPerIp)) + { + throw new InvalidOperationException("Exceeded maximum servers per IP."); + } + await this.registryStore.UpsertServerInfo(serverInfo); } @@ -46,16 +57,36 @@ .Take(this.maxServerCount); } + // Old API, soon to be deprecated public async Task DeleteServer(string ipAddress) { ArgumentUtility.CheckStringForNullOrEmpty(ipAddress, nameof(ipAddress)); - ServerInfo serverInfo = await this.registryStore.GetServerInfo(ipAddress); + var serverInfos = await this.registryStore.GetServerInfos(whereExpression: x => x.HostIpAddress == ipAddress); - if (serverInfo != null) + foreach (var serverInfo in serverInfos) { await this.registryStore.DeleteServer(serverInfo.id); } } + + public async Task DeleteServer(string ipAddress, string gameName, int port) + { + ArgumentUtility.CheckStringForNullOrEmpty(ipAddress, nameof(ipAddress)); + ArgumentUtility.CheckStringForNullOrEmpty(gameName, nameof(gameName)); + ArgumentUtility.CheckForNonnegativeInt(port, nameof(port)); + + var existingServerInfo = (await this.registryStore.GetServerInfos( + whereExpression: + x => x.HostIpAddress == ipAddress && + x.Port == port && + x.GameName.Equals(gameName, StringComparison.OrdinalIgnoreCase))) + .FirstOrDefault(); + + if (existingServerInfo != null) + { + await this.registryStore.DeleteServer(existingServerInfo.id); + } + } } } diff --git a/Giants.Services/Store/CosmosDbServerRegistryStore.cs b/Giants.Services/Store/CosmosDbServerRegistryStore.cs index f16d4b1..9a0c746 100644 --- a/Giants.Services/Store/CosmosDbServerRegistryStore.cs +++ b/Giants.Services/Store/CosmosDbServerRegistryStore.cs @@ -41,10 +41,11 @@ bool includeExpired = false, string partitionKey = null) { - ConcurrentDictionary serverInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); + ConcurrentDictionary> serverInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); IQueryable serverInfoQuery = serverInfo .Values + .SelectMany(s => s) .AsQueryable(); if (whereExpression != null) @@ -67,10 +68,11 @@ Expression> whereExpression = null, string partitionKey = null) { - ConcurrentDictionary serverInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); + ConcurrentDictionary> serverInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); IQueryable serverInfoQuery = serverInfo .Values + .SelectMany(s => s) .AsQueryable(); if (serverInfoQuery != null) @@ -88,65 +90,55 @@ .ToList(); } - public async Task GetServerInfo(string ipAddress) - { - ArgumentUtility.CheckStringForNullOrEmpty(ipAddress, nameof(ipAddress)); - - ConcurrentDictionary serverInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); - if (serverInfo.ContainsKey(ipAddress)) - { - try - { - return serverInfo[ipAddress]; - } - catch (Exception e) - { - this.logger.LogInformation("Cached server for {IPAddress} no longer found: {Exception}", ipAddress, e.ToString()); - // May have been removed from the cache by another thread. Ignore and query DB instead. - } - } - - return await this.client.GetItemById(ipAddress); - } - public async Task UpsertServerInfo(ServerInfo serverInfo) { ArgumentUtility.CheckForNull(serverInfo, nameof(serverInfo)); // Check cache before we write to store - ConcurrentDictionary allServerInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); + ConcurrentDictionary> allServerInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); if (allServerInfo.ContainsKey(serverInfo.HostIpAddress)) { - ServerInfo existingServerInfo = allServerInfo[serverInfo.HostIpAddress]; + IList serverInfoForHostIp = allServerInfo[serverInfo.HostIpAddress]; + ServerInfo existingServerInfo = FindExistingServerForHostIp(serverInfoForHostIp, serverInfo); // DDOS protection: skip write to Cosmos if parameters have not changed, // or it's not been long enough. - if (existingServerInfo.Equals(serverInfo) - && Math.Abs((existingServerInfo.LastHeartbeat - serverInfo.LastHeartbeat).TotalMinutes) < ServerRefreshIntervalInMinutes) + if (existingServerInfo != null && Math.Abs((existingServerInfo.LastHeartbeat - serverInfo.LastHeartbeat).TotalMinutes) < ServerRefreshIntervalInMinutes) { this.logger.LogInformation("State for {IPAddress} is unchanged. Skipping write to store.", serverInfo.HostIpAddress); return; } + + this.logger.LogInformation("State for {IPAddress} has changed. Committing update to store.", serverInfo.HostIpAddress); + await this.client.UpsertItem( + item: serverInfo, + partitionKey: new PartitionKey(serverInfo.DocumentType)); + + // Update cache + if (existingServerInfo != null) + { + var newServerInfo = serverInfoForHostIp.Where(s => !s.Equals(serverInfo)).ToList(); + newServerInfo.Add(serverInfo); + allServerInfo[serverInfo.HostIpAddress] = newServerInfo; + + this.logger.LogInformation("Updating cache for request from {IPAddress} (replaced existing server).", serverInfo.HostIpAddress); + } else { - this.logger.LogInformation("State for {IPAddress} has changed. Committing update to store.", serverInfo.HostIpAddress); + allServerInfo[serverInfo.HostIpAddress].Add(serverInfo); + this.logger.LogInformation("Updating cache for request from {IPAddress} (added new server).", serverInfo.HostIpAddress); } } - - await this.client.UpsertItem( - item: serverInfo, - partitionKey: new PartitionKey(serverInfo.DocumentType)); - - this.logger.LogInformation("Updating cache for request from {IPAddress}.", serverInfo.HostIpAddress); - - if (allServerInfo.ContainsKey(serverInfo.HostIpAddress)) - { - allServerInfo[serverInfo.HostIpAddress] = serverInfo; - } else { - allServerInfo.TryAdd(serverInfo.HostIpAddress, serverInfo); + // Update cache + await this.client.UpsertItem( + item: serverInfo, + partitionKey: new PartitionKey(serverInfo.DocumentType)); + + this.logger.LogInformation("Updating cache for request from {IPAddress} (no existing servers).", serverInfo.HostIpAddress); + allServerInfo.TryAdd(serverInfo.HostIpAddress, new List() { serverInfo }); } } @@ -155,8 +147,21 @@ await this.client.DeleteItem(id, partitionKey); // Remove from cache - ConcurrentDictionary allServerInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); - allServerInfo.TryRemove(id, out ServerInfo _); + ConcurrentDictionary> allServerInfo = await this.memoryCache.GetOrCreateAsync(CacheKeys.ServerInfo, this.PopulateCache); + if (allServerInfo.ContainsKey(id)) + { + var serverInfoCopy = allServerInfo[id].Where(s => s.id != id).ToList(); + if (!serverInfoCopy.Any()) + { + // No remaining servers, remove the key + allServerInfo.TryRemove(id, out IList _); + } + else + { + // Shallow-copy and replace to keep thread safety guarantee + allServerInfo[id] = serverInfoCopy; + } + } } public async Task DeleteServers(IEnumerable ids, string partitionKey = null) @@ -182,15 +187,31 @@ await this.client.Initialize(); } - private async Task> PopulateCache(ICacheEntry entry) + private async Task>> PopulateCache(ICacheEntry entry) { entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1); - IDictionary serverInfo = - (await this.client.GetItems()) - .ToDictionary(x => x.HostIpAddress, y => y); + var allServerInfo = (await this.client.GetItems()); + var serverInfoDictionary = new ConcurrentDictionary>(); - return new ConcurrentDictionary(serverInfo); + foreach (var serverInfo in allServerInfo) + { + if (!serverInfoDictionary.ContainsKey(serverInfo.HostIpAddress)) + { + serverInfoDictionary[serverInfo.HostIpAddress] = new List() { serverInfo }; + } + else + { + serverInfoDictionary[serverInfo.HostIpAddress].Add(serverInfo); + } + } + + return serverInfoDictionary; + } + + private static ServerInfo FindExistingServerForHostIp(IList serverInfoForHostIp, ServerInfo candidateServerInfo) + { + return serverInfoForHostIp.FirstOrDefault(s => s.Equals(candidateServerInfo)); } } } \ No newline at end of file diff --git a/Giants.Services/Store/IServerRegistryStore.cs b/Giants.Services/Store/IServerRegistryStore.cs index 9fcf522..a2a699a 100644 --- a/Giants.Services/Store/IServerRegistryStore.cs +++ b/Giants.Services/Store/IServerRegistryStore.cs @@ -13,8 +13,6 @@ Task DeleteServers(IEnumerable ids, string partitionKey = null); - Task GetServerInfo(string ipAddress); - Task> GetServerInfos(Expression> whereExpression = null, bool includeExpired = false, string partitionKey = null); Task> GetServerInfos( diff --git a/Giants.WebApi/Controllers/CommunityController.cs b/Giants.WebApi/Controllers/CommunityController.cs index 35b3633..268f9fe 100644 --- a/Giants.WebApi/Controllers/CommunityController.cs +++ b/Giants.WebApi/Controllers/CommunityController.cs @@ -6,6 +6,7 @@ [ApiController] [ApiVersion("1.0")] + [ApiVersion("1.1")] [Route("api/[controller]")] public class CommunityController : ControllerBase { diff --git a/Giants.WebApi/Controllers/CrashReportsController.cs b/Giants.WebApi/Controllers/CrashReportsController.cs index b4e5724..b68148a 100644 --- a/Giants.WebApi/Controllers/CrashReportsController.cs +++ b/Giants.WebApi/Controllers/CrashReportsController.cs @@ -13,6 +13,7 @@ [ApiController] [ApiVersion("1.0")] + [ApiVersion("1.1")] [Route("api/[controller]")] public class CrashReportsController : ControllerBase { diff --git a/Giants.WebApi/Controllers/ServersController.cs b/Giants.WebApi/Controllers/ServersController.cs index 7bd54fe..44bac58 100644 --- a/Giants.WebApi/Controllers/ServersController.cs +++ b/Giants.WebApi/Controllers/ServersController.cs @@ -14,6 +14,7 @@ namespace Giants.Web.Controllers { [ApiController] [ApiVersion("1.0")] + [ApiVersion("1.1")] [Route("api/[controller]")] public class ServersController : ControllerBase { @@ -44,6 +45,17 @@ namespace Giants.Web.Controllers await this.serverRegistryService.DeleteServer(requestIpAddress); } + [HttpDelete] + [MapToApiVersion("1.1")] + public async Task DeleteServer(string gameName, int port) + { + string requestIpAddress = this.GetRequestIpAddress(); + + this.logger.LogInformation("Deleting server from {IPAddress}", requestIpAddress); + + await this.serverRegistryService.DeleteServer(requestIpAddress, gameName, port); + } + [HttpGet] public async Task> GetServers() { diff --git a/Giants.WebApi/Controllers/VersionController.cs b/Giants.WebApi/Controllers/VersionController.cs index 35635c5..8882a51 100644 --- a/Giants.WebApi/Controllers/VersionController.cs +++ b/Giants.WebApi/Controllers/VersionController.cs @@ -7,6 +7,7 @@ namespace Giants.WebApi.Controllers { [ApiController] [ApiVersion("1.0")] + [ApiVersion("1.1")] [Route("api/[controller]")] public class VersionController : ControllerBase { diff --git a/Giants.WebApi/appsettings.json b/Giants.WebApi/appsettings.json index b3e3b1e..f82cc71 100644 --- a/Giants.WebApi/appsettings.json +++ b/Giants.WebApi/appsettings.json @@ -12,6 +12,7 @@ "ServerTimeoutPeriodInMinutes": "7", "ServerCleanupIntervalInMinutes": "1", "MaxServerCount": 1000, + "MaxServersPerIp": 5, "DiscordUri": "https://discord.gg/Avj4azU", "BlobConnectionString": "", "CrashBlobContainerName": "crashes" diff --git a/NavMeshGenerator/NavMeshGenerator.vcxproj b/NavMeshGenerator/NavMeshGenerator.vcxproj index 01e6707..71d3add 100644 --- a/NavMeshGenerator/NavMeshGenerator.vcxproj +++ b/NavMeshGenerator/NavMeshGenerator.vcxproj @@ -82,6 +82,9 @@ false + + false + Level3 diff --git a/ServerConsoleExample/ServerConsole.rc b/ServerConsoleExample/ServerConsole.rc index 3ea14696c5028ca0d9113111aed649cfa6782d18..95290df2544cf29a9d38233d0c21770870af47d4 100644 GIT binary patch delta 71 zcmX>Xd?R>61wV5VgTZ7*A@RvugylAG;8$XkRA8uKP+$mW2xf=};z%I&WpHKiV+fsm YQB<7UogtGUks*(vgrRsdv)E~20IjwWr2qf` delta 79 zcmcZ+d@guH1wXSBgTZ7*A@RvugylAG;8$WZ2)zJceQ*nZuB}nOE$zFaY>-5qtrue stdcpplatest MultiThreadedDebugDLL + true Windows @@ -165,6 +166,7 @@ true stdcpplatest MultiThreadedDLL + true Windows @@ -220,7 +222,6 @@ - @@ -233,7 +234,6 @@ - diff --git a/ServerConsoleExample/ServerConsoleApp.cpp b/ServerConsoleExample/ServerConsoleApp.cpp index 4fc5f39..2531f48 100644 --- a/ServerConsoleExample/ServerConsoleApp.cpp +++ b/ServerConsoleExample/ServerConsoleApp.cpp @@ -1,5 +1,4 @@ #include "pch.h" -#include #include "ServerConsoleApp.h" #include "ServerDialog.h" diff --git a/ServerConsoleExample/ServerDialog.cpp b/ServerConsoleExample/ServerDialog.cpp index eb01e83..75f5b92 100644 --- a/ServerConsoleExample/ServerDialog.cpp +++ b/ServerConsoleExample/ServerDialog.cpp @@ -2,7 +2,6 @@ #include "ServerConsoleApp.h" #include "ServerDialog.h" -#include "Utils.h" IMPLEMENT_DYNAMIC(ServerDialog, CDialogEx) @@ -110,10 +109,11 @@ void ServerDialog::OnOK() void ServerDialog::OnCancel() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); - - KillTimer((UINT_PTR)this); + ShowWindow(SW_HIDE); DestroyWindow(); + KillTimer((UINT_PTR)this); + m_pParentWnd->SendMessage(WM_CLOSE, 0, 0); } void ServerDialog::RefreshPlayers() diff --git a/ServerConsoleExample/Utils.cpp b/ServerConsoleExample/Utils.cpp deleted file mode 100644 index 471bbea..0000000 --- a/ServerConsoleExample/Utils.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "pch.h" - -#include - -#include "Utils.h" - -std::wstring to_wstring(const std::string_view& sourceString) -{ - std::wstring_convert> converter; - - return converter.from_bytes(sourceString.data()); -} \ No newline at end of file diff --git a/ServerConsoleExample/Utils.h b/ServerConsoleExample/Utils.h deleted file mode 100644 index cb59597..0000000 --- a/ServerConsoleExample/Utils.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -std::wstring to_wstring(const std::string_view& sourceString); diff --git a/Shaders/Shaders.vcxproj b/Shaders/Shaders.vcxproj index 257a5cb..2a2023f 100644 --- a/Shaders/Shaders.vcxproj +++ b/Shaders/Shaders.vcxproj @@ -38,6 +38,9 @@ + + false + Effect