mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 23:33:04 +01:00
Change plugin type to just local and remote
This commit is contained in:
@@ -1483,7 +1483,7 @@ void Network::Server_Send_SCRIPTS(NetworkConnection& connection) const
|
|||||||
for (const auto& plugin : plugins)
|
for (const auto& plugin : plugins)
|
||||||
{
|
{
|
||||||
const auto& metadata = plugin->GetMetadata();
|
const auto& metadata = plugin->GetMetadata();
|
||||||
if (metadata.Type == OpenRCT2::Scripting::PluginType::ServerClient)
|
if (metadata.Type == OpenRCT2::Scripting::PluginType::Remote)
|
||||||
{
|
{
|
||||||
pluginsToSend.push_back(plugin);
|
pluginsToSend.push_back(plugin);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,12 +158,10 @@ PluginMetadata Plugin::GetMetadata(const DukValue& dukMetadata)
|
|||||||
|
|
||||||
PluginType Plugin::ParsePluginType(const std::string_view& type)
|
PluginType Plugin::ParsePluginType(const std::string_view& type)
|
||||||
{
|
{
|
||||||
if (type == "server")
|
if (type == "local")
|
||||||
return PluginType::Server;
|
return PluginType::Local;
|
||||||
if (type == "client")
|
if (type == "remote")
|
||||||
return PluginType::Client;
|
return PluginType::Remote;
|
||||||
if (type == "server_client")
|
|
||||||
return PluginType::ServerClient;
|
|
||||||
throw std::invalid_argument("Unknown plugin type.");
|
throw std::invalid_argument("Unknown plugin type.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,21 +23,16 @@ namespace OpenRCT2::Scripting
|
|||||||
enum class PluginType
|
enum class PluginType
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Scripts that can run on any client with no impact on the game state.
|
* Scripts that can run on servers or clients with no impact on the game state and will not
|
||||||
*/
|
|
||||||
Client,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scripts that can run on servers with no impact on the game state and will not
|
|
||||||
* be uploaded to clients.
|
* be uploaded to clients.
|
||||||
*/
|
*/
|
||||||
Server,
|
Local,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scripts that can run on servers and will be uploaded to clients with ability to
|
* Scripts that can run on servers and will be uploaded to clients with ability to
|
||||||
* modify game state in certain contexts.
|
* modify game state in certain contexts.
|
||||||
*/
|
*/
|
||||||
ServerClient,
|
Remote,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PluginMetadata
|
struct PluginMetadata
|
||||||
|
|||||||
@@ -271,14 +271,9 @@ bool ScriptEngine::ShouldStartPlugin(const std::shared_ptr<Plugin>& plugin)
|
|||||||
{
|
{
|
||||||
// Only client plugins and plugins downloaded from server should be started
|
// Only client plugins and plugins downloaded from server should be started
|
||||||
const auto& metadata = plugin->GetMetadata();
|
const auto& metadata = plugin->GetMetadata();
|
||||||
if (metadata.Type == PluginType::Server)
|
if (metadata.Type == PluginType::Remote && plugin->HasPath())
|
||||||
{
|
{
|
||||||
LogPluginInfo(plugin, "Server plugin not started");
|
LogPluginInfo(plugin, "Remote plugin not started");
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (metadata.Type == PluginType::ServerClient && plugin->HasPath())
|
|
||||||
{
|
|
||||||
LogPluginInfo(plugin, "Server / client plugin not started");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user