From e788ee283fe7eb8151898916f72c2cf803255fa4 Mon Sep 17 00:00:00 2001 From: ANAND Date: Sun, 4 Aug 2019 10:23:59 +0530 Subject: Client::Interact: Use InteractAction enum instead of numeric constants This replaces the magic numbers used as interaction modes both client-side and server-side, primarily for the sake of ease-of-readability. --- src/network/networkprotocol.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/network/networkprotocol.h') diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index 85436068f..0ab11ee7e 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -954,10 +954,20 @@ enum CSMRestrictionFlags : u64 { // When those are complete, this should return to only being a restriction on the // loading of client mods. CSM_RF_LOAD_CLIENT_MODS = 0x00000001, // Don't load client-provided mods or 'builtin' - 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_READ_PLAYERINFO = 0x00000020, // Disable player info lookups + 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_READ_PLAYERINFO = 0x00000020, // Disable player info lookups CSM_RF_ALL = 0xFFFFFFFF, }; + +enum InteractAction : u8 +{ + INTERACT_START_DIGGING, // 0: start digging (from undersurface) or use + INTERACT_STOP_DIGGING, // 1: stop digging (all parameters ignored) + INTERACT_DIGGING_COMPLETED, // 2: digging completed + INTERACT_PLACE, // 3: place block or item (to abovesurface) + INTERACT_USE, // 4: use item + INTERACT_ACTIVATE // 5: rightclick air ("activate") +}; -- cgit v1.2.3