Extend size of serverInfo_t.hostName (handle longer server names)

This commit is contained in:
Tim Angus 2025-10-04 20:15:15 +01:00
parent 0d2348f936
commit 12ae6973a6
3 changed files with 3 additions and 2 deletions

View File

@ -3833,7 +3833,7 @@ static void CL_SetServerInfo(serverInfo_t *server, const char *info, int ping) {
if (server) {
if (info) {
server->clients = atoi(Info_ValueForKey(info, "clients"));
Q_strncpyz(server->hostName,Info_ValueForKey(info, "hostname"), MAX_NAME_LENGTH);
Q_strncpyz(server->hostName,Info_ValueForKey(info, "hostname"), MAX_HOSTNAME_LENGTH);
Q_strncpyz(server->mapName, Info_ValueForKey(info, "mapname"), MAX_NAME_LENGTH);
server->maxClients = atoi(Info_ValueForKey(info, "sv_maxclients"));
Q_strncpyz(server->game,Info_ValueForKey(info, "game"), MAX_NAME_LENGTH);

View File

@ -288,7 +288,7 @@ typedef struct {
typedef struct {
netadr_t adr;
char hostName[MAX_NAME_LENGTH];
char hostName[MAX_HOSTNAME_LENGTH];
char mapName[MAX_NAME_LENGTH];
char game[MAX_NAME_LENGTH];
int netType;

View File

@ -253,6 +253,7 @@ typedef int clipHandle_t;
#endif
#define MAX_NAME_LENGTH 32 // max length of a client name
#define MAX_HOSTNAME_LENGTH 80 // max length of a host name
#define MAX_SAY_TEXT 150