mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add option to disable ghost map hash check.
This commit is contained in:
parent
92206044d1
commit
c79e4c2de5
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <engine/console.h>
|
||||
#include <engine/shared/compression.h>
|
||||
#include <engine/shared/config.h>
|
||||
#include <engine/shared/network.h>
|
||||
#include <engine/storage.h>
|
||||
|
||||
|
@ -220,9 +221,10 @@ int CGhostLoader::Load(const char *pFilename, const char *pMap, SHA256_DIGEST Ma
|
|||
m_File = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(m_Header.m_Version >= 6)
|
||||
{
|
||||
if(m_Header.m_MapSha256 != MapSha256)
|
||||
if(m_Header.m_MapSha256 != MapSha256 && g_Config.m_ClRaceGhostStrictMap)
|
||||
{
|
||||
char aGhostSha256[SHA256_MAXSTRSIZE];
|
||||
sha256_str(m_Header.m_MapSha256, aGhostSha256, sizeof(aGhostSha256));
|
||||
|
@ -240,7 +242,7 @@ int CGhostLoader::Load(const char *pFilename, const char *pMap, SHA256_DIGEST Ma
|
|||
{
|
||||
io_skip(m_File, -(int)sizeof(SHA256_DIGEST));
|
||||
unsigned GhostMapCrc = bytes_be_to_uint(m_Header.m_aZeroes);
|
||||
if(str_comp(m_Header.m_aMap, pMap) != 0 || GhostMapCrc != MapCrc)
|
||||
if((str_comp(m_Header.m_aMap, pMap) != 0 || GhostMapCrc != MapCrc) && g_Config.m_ClRaceGhostStrictMap)
|
||||
{
|
||||
char aBuf[256];
|
||||
str_format(aBuf, sizeof(aBuf), "ghost map '%s' crc mismatch, wanted=%08x ghost=%08x", pMap, MapCrc, GhostMapCrc);
|
||||
|
@ -380,14 +382,15 @@ bool CGhostLoader::GetGhostInfo(const char *pFilename, CGhostInfo *pGhostInfo, c
|
|||
{
|
||||
return false;
|
||||
}
|
||||
if(Header.m_Version >= 6)
|
||||
|
||||
if(Header.m_Version >= 6 && g_Config.m_ClRaceGhostStrictMap)
|
||||
{
|
||||
if(Header.m_MapSha256 != MapSha256)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(g_Config.m_ClRaceGhostStrictMap)
|
||||
{
|
||||
unsigned GhostMapCrc = bytes_be_to_uint(Header.m_aZeroes);
|
||||
if(GhostMapCrc != MapCrc)
|
||||
|
|
|
@ -322,6 +322,7 @@ MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_S
|
|||
MACRO_CONFIG_INT(ClRaceGhostServerControl, cl_race_ghost_server_control, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Let the server start the ghost")
|
||||
MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ghost")
|
||||
MACRO_CONFIG_INT(ClRaceSaveGhost, cl_race_save_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Save ghost")
|
||||
MACRO_CONFIG_INT(ClRaceGhostStrictMap, cl_race_ghost_strict_map, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Strict map checking when loading ghosts")
|
||||
|
||||
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Enable DDRace Scoreboard")
|
||||
MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether the weapons are reset on passing the start tile or not")
|
||||
|
|
Loading…
Reference in a new issue