OpenTTD Source  20241108-master-g80f628063a
script_scanner.cpp File Reference

Allows scanning for scripts. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../string_func.h"
#include "../settings_type.h"
#include "../script/squirrel.hpp"
#include "script_scanner.hpp"
#include "script_info.hpp"
#include "script_fatalerror.hpp"
#include "../network/network_content.h"
#include "../3rdparty/md5/md5.h"
#include "../tar_type.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  ScriptFileChecksumCreator
 Helper for creating a MD5sum of all files within of a script. More...
 

Functions

static bool IsSameScript (const ContentInfo *ci, bool md5sum, ScriptInfo *info, Subdirectory dir)
 Check whether the script given in info is the same as in ci based on the shortname and md5 sum. More...
 

Detailed Description

Allows scanning for scripts.

Definition in file script_scanner.cpp.

Function Documentation

◆ IsSameScript()

static bool IsSameScript ( const ContentInfo ci,
bool  md5sum,
ScriptInfo info,
Subdirectory  dir 
)
static

Check whether the script given in info is the same as in ci based on the shortname and md5 sum.

Parameters
ciThe information to compare to.
md5sumWhether to check the MD5 checksum.
infoThe script to get the shortname and md5 sum from.
Returns
True iff they're the same.

Definition at line 198 of file script_scanner.cpp.

References ScriptInfo::GetShortName(), ScriptInfo::GetTarFile(), and ContentInfo::unique_id.

Referenced by ScriptScanner::FindMainScript(), and ScriptScanner::HasScript().