From 18f1f6f38c61e51496504a900165c1a8040a7090 Mon Sep 17 00:00:00 2001 From: cialloo Date: Mon, 6 Oct 2025 18:59:15 +0800 Subject: [PATCH] Update ServerListResp to include HumanCount instead of PlayerCount --- api/ServerStatistics.api | 14 +++++++------- src/internal/logic/serverlistlogic.go | 2 +- src/internal/types/types.go | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/api/ServerStatistics.api b/api/ServerStatistics.api index a76dd5d..ca1017e 100644 --- a/api/ServerStatistics.api +++ b/api/ServerStatistics.api @@ -182,13 +182,13 @@ type ( type ( ServerListReq {} ServerListResp { - ServerName string `json:"serverName"` // Server name - ServerIP string `json:"serverIP"` // Server IP address - ServerPort int `json:"serverPort"` // Server port - Category string `json:"category"` // Server category - MapName string `json:"mapName"` // Current map name - PlayerCount int `json:"playerCount"` // Current player count - BotCount int `json:"botCount"` // Bot count + ServerName string `json:"serverName"` // Server name + ServerIP string `json:"serverIP"` // Server IP address + ServerPort int `json:"serverPort"` // Server port + Category string `json:"category"` // Server category + MapName string `json:"mapName"` // Current map name + HumanCount int `json:"humanCount"` // Current human player count + BotCount int `json:"botCount"` // Bot count } ) diff --git a/src/internal/logic/serverlistlogic.go b/src/internal/logic/serverlistlogic.go index 63df4df..a23f769 100644 --- a/src/internal/logic/serverlistlogic.go +++ b/src/internal/logic/serverlistlogic.go @@ -44,7 +44,7 @@ func (l *ServerListLogic) ServerList(req *types.ServerListReq) (resp []types.Ser &server.ServerPort, &server.Category, &server.BotCount, - &server.PlayerCount, + &server.HumanCount, &server.MapName, ) if err != nil { diff --git a/src/internal/types/types.go b/src/internal/types/types.go index 68b7517..a19d487 100644 --- a/src/internal/types/types.go +++ b/src/internal/types/types.go @@ -70,13 +70,13 @@ type ServerListReq struct { } type ServerListResp struct { - ServerName string `json:"serverName"` // Server name - ServerIP string `json:"serverIP"` // Server IP address - ServerPort int `json:"serverPort"` // Server port - Category string `json:"category"` // Server category - MapName string `json:"mapName"` // Current map name - PlayerCount int `json:"playerCount"` // Current player count - BotCount int `json:"botCount"` // Bot count + ServerName string `json:"serverName"` // Server name + ServerIP string `json:"serverIP"` // Server IP address + ServerPort int `json:"serverPort"` // Server port + Category string `json:"category"` // Server category + MapName string `json:"mapName"` // Current map name + HumanCount int `json:"humanCount"` // Current human player count + BotCount int `json:"botCount"` // Bot count } type TopKillerReq struct {