mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Rename CSM flavours to restrictions
& Satisfy LINT
This commit is contained in:
parent
7bdf5eae05
commit
db42542e27
13 changed files with 65 additions and 54 deletions
|
@ -66,7 +66,7 @@ const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES] =
|
|||
{ "TOCLIENT_INVENTORY", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Inventory }, // 0x27
|
||||
null_command_handler,
|
||||
{ "TOCLIENT_TIME_OF_DAY", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_TimeOfDay }, // 0x29
|
||||
{ "TOCLIENT_CSM_FLAVOUR_LIMITS", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_CSMFlavourLimits }, // 0x2A
|
||||
{ "TOCLIENT_CSM_RESTRICTION_FLAGS", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_CSMRestrictionFlags }, // 0x2A
|
||||
null_command_handler,
|
||||
null_command_handler,
|
||||
null_command_handler,
|
||||
|
|
|
@ -1333,11 +1333,11 @@ void Client::handleCommand_FormspecPrepend(NetworkPacket *pkt)
|
|||
*pkt >> player->formspec_prepend;
|
||||
}
|
||||
|
||||
void Client::handleCommand_CSMFlavourLimits(NetworkPacket *pkt)
|
||||
void Client::handleCommand_CSMRestrictionFlags(NetworkPacket *pkt)
|
||||
{
|
||||
*pkt >> m_csm_flavour_limits >> m_csm_noderange_limit;
|
||||
*pkt >> m_csm_restriction_flags >> m_csm_restriction_noderange;
|
||||
|
||||
// Now we have flavours, load mods if it's enabled
|
||||
// Restrictions were received -> load mods if it's enabled
|
||||
// Note: this should be moved after mods receptions from server instead
|
||||
loadMods();
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
* sender
|
||||
* type (RAW, NORMAL, ANNOUNCE, SYSTEM)
|
||||
* content
|
||||
Add TOCLIENT_CSM_FLAVOUR_LIMITS to define which CSM flavour should be
|
||||
Add TOCLIENT_CSM_RESTRICTION_FLAGS to define which CSM features should be
|
||||
limited
|
||||
Add settable player collisionbox. Breaks compatibility with older
|
||||
clients as a 1-node vertical offset has been removed from player's
|
||||
|
@ -283,9 +283,9 @@ enum ToClientCommand
|
|||
f1000 time_speed
|
||||
*/
|
||||
|
||||
TOCLIENT_CSM_FLAVOUR_LIMITS = 0x2A,
|
||||
TOCLIENT_CSM_RESTRICTION_FLAGS = 0x2A,
|
||||
/*
|
||||
u32 CSMFlavourLimits byteflag
|
||||
u32 CSMRestrictionFlags byteflag
|
||||
*/
|
||||
|
||||
// (oops, there is some gap here)
|
||||
|
@ -928,12 +928,12 @@ enum PlayerListModifer: u8
|
|||
PLAYER_LIST_REMOVE,
|
||||
};
|
||||
|
||||
enum CSMFlavourLimit : u64 {
|
||||
CSM_FL_NONE = 0x00000000,
|
||||
CSM_FL_LOAD_CLIENT_MODS = 0x00000001, // Disable mods provided by clients
|
||||
CSM_FL_CHAT_MESSAGES = 0x00000002, // Disable chat message sending from CSM
|
||||
CSM_FL_READ_ITEMDEFS = 0x00000004, // Disable itemdef lookups
|
||||
CSM_FL_READ_NODEDEFS = 0x00000008, // Disable nodedef lookups
|
||||
CSM_FL_LOOKUP_NODES = 0x00000010, // Limit node lookups
|
||||
CSM_FL_ALL = 0xFFFFFFFF,
|
||||
enum CSMRestrictionFlags : u64 {
|
||||
CSM_RF_NONE = 0x00000000,
|
||||
CSM_RF_LOAD_CLIENT_MODS = 0x00000001, // Disable mods provided by clients
|
||||
CSM_RF_CHAT_MESSAGES = 0x00000002, // Disable chat message sending from CSM
|
||||
CSM_RF_READ_ITEMDEFS = 0x00000004, // Disable itemdef lookups
|
||||
CSM_RF_READ_NODEDEFS = 0x00000008, // Disable nodedef lookups
|
||||
CSM_RF_LOOKUP_NODES = 0x00000010, // Limit node lookups
|
||||
CSM_RF_ALL = 0xFFFFFFFF,
|
||||
};
|
||||
|
|
|
@ -155,7 +155,7 @@ const ClientCommandFactory clientCommandFactoryTable[TOCLIENT_NUM_MSG_TYPES] =
|
|||
{ "TOCLIENT_INVENTORY", 0, true }, // 0x27
|
||||
null_command_factory,
|
||||
{ "TOCLIENT_TIME_OF_DAY", 0, true }, // 0x29
|
||||
{ "TOCLIENT_CSM_FLAVOUR_LIMITS", 0, true }, // 0x2A
|
||||
{ "TOCLIENT_CSM_RESTRICTION_FLAGS", 0, true }, // 0x2A
|
||||
null_command_factory,
|
||||
null_command_factory,
|
||||
null_command_factory,
|
||||
|
|
|
@ -320,7 +320,7 @@ void Server::handleCommand_Init2(NetworkPacket* pkt)
|
|||
float time_speed = g_settings->getFloat("time_speed");
|
||||
SendTimeOfDay(pkt->getPeerId(), time, time_speed);
|
||||
|
||||
SendCSMFlavourLimits(pkt->getPeerId());
|
||||
SendCSMRestrictionFlags(pkt->getPeerId());
|
||||
|
||||
// Warnings about protocol version can be issued here
|
||||
if (getClient(pkt->getPeerId())->net_proto_version < LATEST_PROTOCOL_VERSION) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue