mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Merge branch 'infopoke' into 'master'
MS Info packet tweaks (resolves #300) Closes #300 See merge request STJr/SRB2Internal!499
This commit is contained in:
commit
e9ca39d3bc
1 changed files with 21 additions and 4 deletions
|
@ -1301,10 +1301,23 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
|
||||
M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16);
|
||||
|
||||
if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, ""))
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33);
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl)
|
||||
{
|
||||
char *read = mapheaderinfo[gamemap-1]->lvlttl, *writ = netbuffer->u.serverinfo.maptitle;
|
||||
while (writ < (netbuffer->u.serverinfo.maptitle+32) && *read != '\0')
|
||||
{
|
||||
if (!(*read & 0x80))
|
||||
{
|
||||
*writ = toupper(*read);
|
||||
writ++;
|
||||
}
|
||||
read++;
|
||||
}
|
||||
*writ = '\0';
|
||||
//strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33);
|
||||
}
|
||||
else
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 33);
|
||||
strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 32);
|
||||
|
||||
netbuffer->u.serverinfo.maptitle[32] = '\0';
|
||||
|
||||
|
@ -1358,7 +1371,11 @@ static void SV_SendPlayerInfo(INT32 node)
|
|||
|
||||
netbuffer->u.playerinfo[i].score = LONG(players[i].score);
|
||||
netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE));
|
||||
netbuffer->u.playerinfo[i].skin = (UINT8)players[i].skin;
|
||||
netbuffer->u.playerinfo[i].skin = (UINT8)(players[i].skin
|
||||
#ifdef DEVELOP // it's safe to do this only because PLAYERINFO isn't read by the game itself
|
||||
% 3
|
||||
#endif
|
||||
);
|
||||
|
||||
// Extra data
|
||||
netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor;
|
||||
|
|
Loading…
Reference in a new issue