Skip to content
Snippets Groups Projects
Commit ddf8a189 authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Increase size of mapname in serverinfo_pak

parent a2e08d95
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ packet versions. ...@@ -26,7 +26,7 @@ packet versions.
If you change the struct or the meaning of a field If you change the struct or the meaning of a field
therein, increment this number. therein, increment this number.
*/ */
#define PACKETVERSION 5 #define PACKETVERSION 6
// Network play related stuff. // Network play related stuff.
// There is a data struct that stores network // There is a data struct that stores network
...@@ -226,7 +226,7 @@ typedef struct ...@@ -226,7 +226,7 @@ typedef struct
tic_t time; tic_t time;
tic_t leveltime; tic_t leveltime;
char servername[MAXSERVERNAME]; char servername[MAXSERVERNAME];
char mapname[8]; char mapname[24];
char maptitle[33]; char maptitle[33];
unsigned char mapmd5[16]; unsigned char mapmd5[16];
UINT8 actnum; UINT8 actnum;
......
...@@ -114,15 +114,15 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) ...@@ -114,15 +114,15 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
netbuffer->u.serverinfo.refusereason = GetRefuseReason(node); netbuffer->u.serverinfo.refusereason = GetRefuseReason(node);
strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype], strlcpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype],
sizeof netbuffer->u.serverinfo.gametypename); sizeof netbuffer->u.serverinfo.gametypename);
netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame; netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame;
netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled();
netbuffer->u.serverinfo.flags = (dedicated ? SV_DEDICATED : 0); netbuffer->u.serverinfo.flags = (dedicated ? SV_DEDICATED : 0);
strncpy(netbuffer->u.serverinfo.servername, cv_servername.string, strlcpy(netbuffer->u.serverinfo.servername, cv_servername.string,
MAXSERVERNAME); MAXSERVERNAME);
strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7); // [mapnames] FIXME
strlcpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), sizeof netbuffer->u.serverinfo.mapname);
M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16);
memset(netbuffer->u.serverinfo.maptitle, 0, sizeof netbuffer->u.serverinfo.maptitle); memset(netbuffer->u.serverinfo.maptitle, 0, sizeof netbuffer->u.serverinfo.maptitle);
...@@ -142,7 +142,6 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) ...@@ -142,7 +142,6 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
read++; read++;
} }
*writ = '\0'; *writ = '\0';
//strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33);
} }
else else
strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 32); strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 32);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment