[Server] Deprecate DoesFileExist(), add DoesFilePathExist()

pull/515/head
David Cernat 6 years ago
parent 2cdabddc0e
commit 5c4d3df551

@ -47,7 +47,7 @@ void ServerFunctions::UnbanAddress(const char *ipAddress) noexcept
mwmp::Networking::getPtr()->unbanAddress(ipAddress); mwmp::Networking::getPtr()->unbanAddress(ipAddress);
} }
bool ServerFunctions::DoesFileExist(const char *filePath) noexcept bool ServerFunctions::DoesFilePathExist(const char *filePath) noexcept
{ {
return boost::filesystem::exists(filePath); return boost::filesystem::exists(filePath);
} }
@ -205,6 +205,11 @@ void ServerFunctions::AddDataFileRequirement(const char *dataFilename, const cha
// All methods below are deprecated versions of methods from above // All methods below are deprecated versions of methods from above
bool ServerFunctions::DoesFileExist(const char *filePath) noexcept
{
return DoesFilePathExist(filePath);
}
const char* ServerFunctions::GetModDir() noexcept const char* ServerFunctions::GetModDir() noexcept
{ {
return GetDataPath(); return GetDataPath();

@ -13,7 +13,7 @@
{"BanAddress", ServerFunctions::BanAddress},\ {"BanAddress", ServerFunctions::BanAddress},\
{"UnbanAddress", ServerFunctions::UnbanAddress},\ {"UnbanAddress", ServerFunctions::UnbanAddress},\
\ \
{"DoesFileExist", ServerFunctions::DoesFileExist},\ {"DoesFilePathExist", ServerFunctions::DoesFilePathExist},\
{"GetCaseInsensitiveFilename", ServerFunctions::GetCaseInsensitiveFilename},\ {"GetCaseInsensitiveFilename", ServerFunctions::GetCaseInsensitiveFilename},\
{"GetDataPath", ServerFunctions::GetDataPath},\ {"GetDataPath", ServerFunctions::GetDataPath},\
{"GetOperatingSystemType", ServerFunctions::GetOperatingSystemType},\ {"GetOperatingSystemType", ServerFunctions::GetOperatingSystemType},\
@ -38,6 +38,7 @@
\ \
{"AddDataFileRequirement", ServerFunctions::AddDataFileRequirement},\ {"AddDataFileRequirement", ServerFunctions::AddDataFileRequirement},\
\ \
{"DoesFileExist", ServerFunctions::DoesFileExist},\
{"GetModDir", ServerFunctions::GetModDir},\ {"GetModDir", ServerFunctions::GetModDir},\
{"AddPluginHash", ServerFunctions::AddPluginHash} {"AddPluginHash", ServerFunctions::AddPluginHash}
@ -102,7 +103,7 @@ public:
static void UnbanAddress(const char *ipAddress) noexcept; static void UnbanAddress(const char *ipAddress) noexcept;
/** /**
* \brief Check whether a certain file exists. * \brief Check whether a certain file path exists.
* *
* This will be a case sensitive check on case sensitive filesystems. * This will be a case sensitive check on case sensitive filesystems.
* *
@ -110,7 +111,7 @@ public:
* *
* \return Whether the file exists or not. * \return Whether the file exists or not.
*/ */
static bool DoesFileExist(const char *filePath) noexcept; static bool DoesFilePathExist(const char *filePath) noexcept;
/** /**
* \brief Get the first filename in a folder that has a case insensitive match with the filename * \brief Get the first filename in a folder that has a case insensitive match with the filename
@ -296,6 +297,7 @@ public:
// All methods below are deprecated versions of methods from above // All methods below are deprecated versions of methods from above
static bool DoesFileExist(const char *filePath) noexcept;
static const char *GetModDir() noexcept; static const char *GetModDir() noexcept;
static void AddPluginHash(const char *pluginName, const char *checksumString) noexcept; static void AddPluginHash(const char *pluginName, const char *checksumString) noexcept;
}; };

Loading…
Cancel
Save