# Enable random user input (only used for testing).
random_input (Random input) bool false
-# Continuous forward movement, toggled by autoforward key.
+# Continuous forward movement, toggled by autoforward key.
# Press the autoforward key again or the backwards movement to disable.
continuous_forward (Continuous forward) bool false
# CHAT_MESSAGES: 2 (disable send_chat_message call client-side)
# READ_ITEMDEFS: 4 (disable get_item_def call client-side)
# READ_NODEDEFS: 8 (disable get_node_def call client-side)
-# LOOKUP_NODES_LIMIT: 16 (limits get_node call client-side to csm_flavour_noderange_limit)
-# type: int
-csm_flavour_limits (Client side modding flavour limits) int 18
+# LOOKUP_NODES_LIMIT: 16 (limits get_node call client-side to csm_restriction_noderange)
+csm_restriction_flags (Client side modding restrictions) int 18
-# If the CSM flavour for node range is enabled, get_node is limited to
-# this many nodes from the player.
-csm_flavour_noderange_limit (Client side noderange flavour limit) int 8
+# If the CSM restriction for node range is enabled, get_node calls are limited
+# to this distance from the player to the node.
+csm_restriction_noderange (Client side node lookup range restriction) int 8
[*Security]
# Changes the main menu UI:
# - Full: Multple singleplayer worlds, game choice, texture pack chooser, etc.
# - Simple: One singleplayer world, no game or texture pack choosers. May be necessary for smaller screens.
-# - Auto: Simple on Android, full on everything else.
+# - Auto: Simple on Android, full on everything else.
main_menu_style (Main menu style) enum auto auto,full,simple
# Replaces the default main menu with a custom one.
return;
}
- // If modding is not enabled or flavour disable it, don't load mods, just builtin
+ // If modding is not enabled or CSM restrictions disable it
+ // don't load CSM mods, only builtin
if (!m_modding_enabled) {
warningstream << "Client side mods are disabled by configuration." << std::endl;
return;
}
- if (checkCSMFlavourLimit(CSMFlavourLimit::CSM_FL_LOAD_CLIENT_MODS)) {
+ if (checkCSMRestrictionFlag(CSMRestrictionFlags::CSM_RF_LOAD_CLIENT_MODS)) {
warningstream << "Client side mods are disabled by server." << std::endl;
// If mods loading is disabled and builtin integrity is wrong, disconnect user.
if (!checkBuiltinIntegrity()) {
/**
* Helper function for Client Side Modding
- * Flavour is applied there, this should not be used for core engine
+ * CSM restrictions are applied there, this should not be used for core engine
* @param p
* @param is_valid_position
* @return
*/
MapNode Client::getNode(v3s16 p, bool *is_valid_position)
{
- if (checkCSMFlavourLimit(CSMFlavourLimit::CSM_FL_LOOKUP_NODES)) {
+ if (checkCSMRestrictionFlag(CSMRestrictionFlags::CSM_RF_LOOKUP_NODES)) {
v3s16 ppos = floatToInt(m_env.getLocalPlayer()->getPosition(), BS);
- if ((u32) ppos.getDistanceFrom(p) > m_csm_noderange_limit) {
+ if ((u32) ppos.getDistanceFrom(p) > m_csm_restriction_noderange) {
*is_valid_position = false;
return {};
}
void handleCommand_ModChannelSignal(NetworkPacket *pkt);
void handleCommand_SrpBytesSandB(NetworkPacket *pkt);
void handleCommand_FormspecPrepend(NetworkPacket *pkt);
- void handleCommand_CSMFlavourLimits(NetworkPacket *pkt);
+ void handleCommand_CSMRestrictionFlags(NetworkPacket *pkt);
void ProcessData(NetworkPacket *pkt);
/**
* Helper function for Client Side Modding
- * Flavour is applied there, this should not be used for core engine
+ * CSM restrictions are applied there, this should not be used for core engine
* @param p
* @param is_valid_position
* @return
return m_address_name;
}
- inline bool checkCSMFlavourLimit(CSMFlavourLimit flag) const
+ inline bool checkCSMRestrictionFlag(CSMRestrictionFlags flag) const
{
- return m_csm_flavour_limits & flag;
+ return m_csm_restriction_flags & flag;
}
u32 getCSMNodeRangeLimit() const
{
- return m_csm_noderange_limit;
+ return m_csm_restriction_noderange;
}
inline std::unordered_map<u32, u32> &getHUDTranslationMap()
bool m_shutdown = false;
- // CSM flavour limits byteflag
- u64 m_csm_flavour_limits = CSMFlavourLimit::CSM_FL_NONE;
- u32 m_csm_noderange_limit = 8;
+ // CSM restrictions byteflag
+ u64 m_csm_restriction_flags = CSMRestrictionFlags::CSM_RF_NONE;
+ u32 m_csm_restriction_noderange = 8;
std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
};
settings->setDefault("max_block_send_distance", "9");
settings->setDefault("block_send_optimize_distance", "4");
settings->setDefault("server_side_occlusion_culling", "true");
- settings->setDefault("csm_flavour_limits", "18");
- settings->setDefault("csm_flavour_noderange_limit", "8");
+ settings->setDefault("csm_restriction_flags", "18");
+ settings->setDefault("csm_restriction_noderange", "8");
settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096");
settings->setDefault("time_speed", "72");
settings->setDefault("world_start_time", "5250");
{ "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,
*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();
}
* 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
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)
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,
};
{ "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,
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) {
return 0;
// If server disabled this API, discard
- if (getClient(L)->checkCSMFlavourLimit(CSMFlavourLimit::CSM_FL_CHAT_MESSAGES))
+
+ // clang-format off
+ if (getClient(L)->checkCSMRestrictionFlag(
+ CSMRestrictionFlags::CSM_RF_CHAT_MESSAGES))
return 0;
+ // clang-format on
std::string message = luaL_checkstring(L, 1);
getClient(L)->sendChatMessage(utf8_to_wide(message));
IItemDefManager *idef = gdef->idef();
assert(idef);
- if (getClient(L)->checkCSMFlavourLimit(CSMFlavourLimit::CSM_FL_READ_ITEMDEFS))
+ // clang-format off
+ if (getClient(L)->checkCSMRestrictionFlag(
+ CSMRestrictionFlags::CSM_RF_READ_ITEMDEFS))
return 0;
+ // clang-format on
if (!lua_isstring(L, 1))
return 0;
if (!lua_isstring(L, 1))
return 0;
- if (getClient(L)->checkCSMFlavourLimit(CSMFlavourLimit::CSM_FL_READ_NODEDEFS))
+ // clang-format off
+ if (getClient(L)->checkCSMRestrictionFlag(
+ CSMRestrictionFlags::CSM_RF_READ_NODEDEFS))
return 0;
+ // clang-format on
const std::string &name = lua_tostring(L, 1);
const ContentFeatures &cf = ndef->get(ndef->getId(name));
#ifndef SERVER
// Client API limitations
if (getClient(L) &&
- getClient(L)->checkCSMFlavourLimit(CSMFlavourLimit::CSM_FL_LOOKUP_NODES)) {
+ getClient(L)->checkCSMRestrictionFlag(
+ CSMRestrictionFlags::CSM_RF_LOOKUP_NODES)) {
radius = std::max<int>(radius, getClient(L)->getCSMNodeRangeLimit());
}
#endif
m_liquid_transform_every = g_settings->getFloat("liquid_update");
m_max_chatmessage_length = g_settings->getU16("chat_message_max_size");
- m_csm_flavour_limits = g_settings->getU64("csm_flavour_limits");
- m_csm_noderange_limit = g_settings->getU32("csm_flavour_noderange_limit");
+ m_csm_restriction_flags = g_settings->getU64("csm_restriction_flags");
+ m_csm_restriction_noderange = g_settings->getU32("csm_restriction_noderange");
}
void Server::start()
&pkt, reliable);
}
-void Server::SendCSMFlavourLimits(session_t peer_id)
+void Server::SendCSMRestrictionFlags(session_t peer_id)
{
- NetworkPacket pkt(TOCLIENT_CSM_FLAVOUR_LIMITS,
- sizeof(m_csm_flavour_limits) + sizeof(m_csm_noderange_limit), peer_id);
- pkt << m_csm_flavour_limits << m_csm_noderange_limit;
+ NetworkPacket pkt(TOCLIENT_CSM_RESTRICTION_FLAGS,
+ sizeof(m_csm_restriction_flags) + sizeof(m_csm_restriction_noderange), peer_id);
+ pkt << m_csm_restriction_flags << m_csm_restriction_noderange;
Send(&pkt);
}
u32 SendActiveObjectRemoveAdd(session_t peer_id, const std::string &datas);
void SendActiveObjectMessages(session_t peer_id, const std::string &datas,
bool reliable = true);
- void SendCSMFlavourLimits(session_t peer_id);
+ void SendCSMRestrictionFlags(session_t peer_id);
/*
Something random
std::unordered_map<std::string, ModMetadata *> m_mod_storages;
float m_mod_storage_save_timer = 10.0f;
- // CSM flavour limits byteflag
- u64 m_csm_flavour_limits = CSMFlavourLimit::CSM_FL_NONE;
- u32 m_csm_noderange_limit = 8;
+ // CSM restrictions byteflag
+ u64 m_csm_restriction_flags = CSMRestrictionFlags::CSM_RF_NONE;
+ u32 m_csm_restriction_noderange = 8;
// ModChannel manager
std::unique_ptr<ModChannelMgr> m_modchannel_mgr;