fix query dispatch & gateway

This commit is contained in:
Naruse
2025-06-18 00:12:33 +08:00
parent 09c1d7726c
commit f7d9020470
3 changed files with 13 additions and 110 deletions

View File

@@ -13,9 +13,10 @@ public class QueryDispatchController : ControllerBase
public IActionResult QueryDispatch([FromQuery] DispatchQuery query, Logger logger)
{
var version = HotfixContainer.ExtractVersionNumber(query.Version);
if (!ConfigManager.Hotfix.Hotfixes.ContainsKey(version))
var hotfix_version = query.Version!;
if (!ConfigManager.Hotfix.Hotfixes.ContainsKey(hotfix_version))
{
logger.Warn($"Client sent requesting unsupported game version: {version}");
logger.Warn($"Client sent requesting unsupported game version: {hotfix_version}");
return BadRequest();
}

View File

@@ -14,10 +14,11 @@ public class QueryGatewayController : ControllerBase
public IActionResult QueryGateway([FromQuery] DispatchQuery query, Logger logger)
{
var version = HotfixContainer.ExtractVersionNumber(query.Version);
var hotfix_version = query.Version!;
if (!ConfigManager.Hotfix.Hotfixes.TryGetValue(version, out var hotfix))
if (!ConfigManager.Hotfix.Hotfixes.TryGetValue(hotfix_version, out var hotfix))
{
logger.Warn($"Client sent requesting unsupported game version: {version}");
logger.Warn($"Client sent requesting unsupported game version: {hotfix_version}");
return BadRequest();
}