Remove unnecessary game command ids

This commit is contained in:
ζeh Matt 2021-11-11 16:43:39 +02:00
parent 91d6338db5
commit 54af81450e
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
3 changed files with 5 additions and 15 deletions

View File

@ -18,10 +18,6 @@ struct rct_s6_data;
enum class GameCommand : int32_t
{
PasswordlessLogin = -3,
ToggleSceneryCluster = -2,
Chat = -1,
SetRideAppearance, // GA
SetLandHeight, // GA
TogglePause, // GA

View File

@ -51,9 +51,7 @@ const std::array<NetworkAction, static_cast<size_t>(NetworkPermission::Count)> N
NetworkAction{
STR_ACTION_CHAT,
"PERMISSION_CHAT",
{
GameCommand::Chat,
},
{},
},
NetworkAction{
STR_ACTION_TERRAFORM,
@ -244,16 +242,12 @@ const std::array<NetworkAction, static_cast<size_t>(NetworkPermission::Count)> N
NetworkAction{
STR_ACTION_TOGGLE_SCENERY_CLUSTER,
"PERMISSION_TOGGLE_SCENERY_CLUSTER",
{
GameCommand::ToggleSceneryCluster,
},
{},
},
NetworkAction{
STR_ACTION_PASSWORDLESS_LOGIN,
"PERMISSION_PASSWORDLESS_LOGIN",
{
GameCommand::PasswordlessLogin,
},
{},
},
NetworkAction{
STR_ACTION_MODIFY_TILE,

View File

@ -2578,7 +2578,7 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke
if (connection.AuthStatus == NetworkAuth::Verified)
{
const NetworkGroup* group = GetGroupByID(GetGroupIDByHash(connection.Key.PublicKeyHash()));
passwordless = group->CanPerformCommand(GameCommand::PasswordlessLogin);
passwordless = group->CanPerformAction(NetworkPermission::PasswordlessLogin);
}
if (gameversion != network_get_version())
{
@ -2885,7 +2885,7 @@ void NetworkBase::Server_Handle_CHAT(NetworkConnection& connection, NetworkPacke
if (connection.Player != nullptr)
{
NetworkGroup* group = GetGroupByID(connection.Player->Group);
if (group == nullptr || !group->CanPerformCommand(GameCommand::Chat))
if (group == nullptr || !group->CanPerformAction(NetworkPermission::Chat))
{
return;
}