Rename public plug-in config data members

This commit is contained in:
Hielke Morsink 2022-10-16 17:56:19 +02:00
parent 0ca7bb058f
commit f9d1f024c2
No known key found for this signature in database
GPG Key ID: FE0B343DF883E7F2
4 changed files with 10 additions and 10 deletions

View File

@ -553,8 +553,8 @@ namespace Config
if (reader->ReadSection("plugin")) if (reader->ReadSection("plugin"))
{ {
auto model = &gConfigPlugin; auto model = &gConfigPlugin;
model->enable_hot_reloading = reader->GetBoolean("enable_hot_reloading", false); model->EnableHotReloading = reader->GetBoolean("enable_hot_reloading", false);
model->allowed_hosts = reader->GetString("allowed_hosts", ""); model->AllowedHosts = reader->GetString("allowed_hosts", "");
} }
} }
@ -562,8 +562,8 @@ namespace Config
{ {
auto model = &gConfigPlugin; auto model = &gConfigPlugin;
writer->WriteSection("plugin"); writer->WriteSection("plugin");
writer->WriteBoolean("enable_hot_reloading", model->enable_hot_reloading); writer->WriteBoolean("enable_hot_reloading", model->EnableHotReloading);
writer->WriteString("allowed_hosts", model->allowed_hosts); writer->WriteString("allowed_hosts", model->AllowedHosts);
} }
static bool SetDefaults() static bool SetDefaults()

View File

@ -216,8 +216,8 @@ struct FontConfiguration
struct PluginConfiguration struct PluginConfiguration
{ {
bool enable_hot_reloading; bool EnableHotReloading;
std::string allowed_hosts; std::string AllowedHosts;
}; };
enum class Sort : int32_t enum class Sort : int32_t

View File

@ -555,7 +555,7 @@ void ScriptEngine::RefreshPlugins()
} }
// Turn on hot reload if not already enabled // Turn on hot reload if not already enabled
if (!_hotReloadingInitialised && gConfigPlugin.enable_hot_reloading && network_get_mode() == NETWORK_MODE_NONE) if (!_hotReloadingInitialised && gConfigPlugin.EnableHotReloading && network_get_mode() == NETWORK_MODE_NONE)
{ {
SetupHotReloading(); SetupHotReloading();
} }

View File

@ -90,15 +90,15 @@ namespace OpenRCT2::Scripting
constexpr char delimiter = ','; constexpr char delimiter = ',';
size_t start_pos = 0; size_t start_pos = 0;
size_t end_pos = 0; size_t end_pos = 0;
while ((end_pos = gConfigPlugin.allowed_hosts.find(delimiter, start_pos)) != std::string::npos) while ((end_pos = gConfigPlugin.AllowedHosts.find(delimiter, start_pos)) != std::string::npos)
{ {
if (host == gConfigPlugin.allowed_hosts.substr(start_pos, end_pos - start_pos)) if (host == gConfigPlugin.AllowedHosts.substr(start_pos, end_pos - start_pos))
{ {
return true; return true;
} }
start_pos = end_pos + 1; start_pos = end_pos + 1;
} }
return host == gConfigPlugin.allowed_hosts.substr(start_pos, gConfigPlugin.allowed_hosts.length() - start_pos); return host == gConfigPlugin.AllowedHosts.substr(start_pos, gConfigPlugin.AllowedHosts.length() - start_pos);
} }
public: public: