From 6ccb5835ff55d85156be91473c598eca9d6cb9a6 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 4 Nov 2020 16:57:41 +0100 Subject: Revert "Make Lint Happy" This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4. --- src/clientiface.h | 156 ++++++++++++++++++++++++++---------------------------- 1 file changed, 74 insertions(+), 82 deletions(-) (limited to 'src/clientiface.h') diff --git a/src/clientiface.h b/src/clientiface.h index e629066c4..83fa6fe99 100644 --- a/src/clientiface.h +++ b/src/clientiface.h @@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once -#include "irr_v3d.h" // for irrlicht datatypes +#include "irr_v3d.h" // for irrlicht datatypes #include "constants.h" -#include "serialization.h" // for SER_FMT_VER_INVALID +#include "serialization.h" // for SER_FMT_VER_INVALID #include "network/networkpacket.h" #include "network/networkprotocol.h" #include "porting.h" @@ -41,49 +41,49 @@ class EmergeManager; Start (peer connect) - | - v + | + v /-----------------\ | | | Created | | | \-----------------/ - | depending of the incoming packet - ---------------------------------------- - v - +-----------------------------+ - |IN: | - | TOSERVER_INIT | - +-----------------------------+ - | invalid playername - | or denied by mod - v - +-----------------------------+ - |OUT: | - | TOCLIENT_HELLO | - +-----------------------------+ - | - | - v + | depending of the incoming packet + ---------------------------------------- + v + +-----------------------------+ + |IN: | + | TOSERVER_INIT | + +-----------------------------+ + | invalid playername + | or denied by mod + v + +-----------------------------+ + |OUT: | + | TOCLIENT_HELLO | + +-----------------------------+ + | + | + v /-----------------\ /-----------------\ | | | | | AwaitingInit2 |<--------- | HelloSent | | | | | | \-----------------/ | \-----------------/ - | | | + | | | +-----------------------------+ | *-----------------------------* Auth fails |IN: | | |Authentication, depending on |------------------ | TOSERVER_INIT2 | | | packet sent by client | | +-----------------------------+ | *-----------------------------* | - | | | | - | | | Authentication | - v | | successful | + | | | | + | | | Authentication | + v | | successful | /-----------------\ | v | | | | +-----------------------------+ | | InitDone | | |OUT: | | | | | | TOCLIENT_AUTH_ACCEPT | | \-----------------/ | +-----------------------------+ | - | | | | + | | | | +-----------------------------+ --------------------- | |OUT: | | | TOCLIENT_MOVEMENT | | @@ -93,25 +93,25 @@ class EmergeManager; | TOCLIENT_DETACHED_INVENTORY | | | TOCLIENT_TIME_OF_DAY | | +-----------------------------+ | - | | - | | - | ----------------------------- | - v | | | + | | + | | + | ----------------------------- | + v | | | /-----------------\ v | | | +-----------------------------+ | | DefinitionsSent | |IN: | | | | | TOSERVER_REQUEST_MEDIA | | \-----------------/ | | | - | +-----------------------------+ | - | ^ | | - | ----------------------------- | - v v + | +-----------------------------+ | + | ^ | | + | ----------------------------- | + v v +-----------------------------+ --------------------------------+ |IN: | | ^ | TOSERVER_CLIENT_READY | v | +-----------------------------+ +------------------------+ | - | |OUT: | | - v | TOCLIENT_ACCESS_DENIED | | + | |OUT: | | + v | TOCLIENT_ACCESS_DENIED | | +-----------------------------+ +------------------------+ | |OUT: | | | | TOCLIENT_MOVE_PLAYER | v | @@ -123,8 +123,8 @@ class EmergeManager; | TOCLIENT_BREATH | | | TOCLIENT_DEATHSCREEN | | +-----------------------------+ | - | | - v | + | | + v | /-----------------\ async mod action (ban, kick) | | |--------------------------------------------------------------- ---->| Active | @@ -159,14 +159,14 @@ class EmergeManager; | | +-----------------------------+ | | sets password accordingly |IN: | -------------------+-------------------------------| TOSERVER_FIRST_SRP | - +-----------------------------+ + +-----------------------------+ */ -namespace con -{ -class Connection; +namespace con { + class Connection; } + // Also make sure to update the ClientInterface::statenames // array when modifying these enums @@ -205,14 +205,13 @@ enum ClientStateEvent */ struct PrioritySortedBlockTransfer { - PrioritySortedBlockTransfer( - float a_priority, const v3s16 &a_pos, session_t a_peer_id) + PrioritySortedBlockTransfer(float a_priority, const v3s16 &a_pos, session_t a_peer_id) { priority = a_priority; pos = a_pos; peer_id = a_peer_id; } - bool operator<(const PrioritySortedBlockTransfer &other) const + bool operator < (const PrioritySortedBlockTransfer &other) const { return priority < other.priority; } @@ -237,13 +236,15 @@ public: /* Authentication information */ std::string enc_pwd = ""; bool create_player_on_auth_success = false; - AuthMechanism chosen_mech = AUTH_MECHANISM_NONE; + AuthMechanism chosen_mech = AUTH_MECHANISM_NONE; void *auth_data = nullptr; u32 allowed_auth_mechs = 0; u32 allowed_sudo_mechs = 0; - bool isSudoMechAllowed(AuthMechanism mech) { return allowed_sudo_mechs & mech; } - bool isMechAllowed(AuthMechanism mech) { return allowed_auth_mechs & mech; } + bool isSudoMechAllowed(AuthMechanism mech) + { return allowed_sudo_mechs & mech; } + bool isMechAllowed(AuthMechanism mech) + { return allowed_auth_mechs & mech; } RemoteClient(); ~RemoteClient() = default; @@ -253,15 +254,15 @@ public: Environment should be locked when this is called. dtime is used for resetting send radius at slow interval */ - void GetNextBlocks(ServerEnvironment *env, EmergeManager *emerge, float dtime, - std::vector &dest); + void GetNextBlocks(ServerEnvironment *env, EmergeManager* emerge, + float dtime, std::vector &dest); void GotBlock(v3s16 p); void SentBlock(v3s16 p); void SetBlockNotSent(v3s16 p); - void SetBlocksNotSent(std::map &blocks); + void SetBlocksNotSent(std::map &blocks); /** * tell client about this block being modified right now. @@ -281,15 +282,16 @@ public: // Increments timeouts and removes timed-out blocks from list // NOTE: This doesn't fix the server-not-sending-block bug // because it is related to emerging, not sending. - // void RunSendingTimeouts(float dtime, float timeout); + //void RunSendingTimeouts(float dtime, float timeout); void PrintInfo(std::ostream &o) { - o << "RemoteClient " << peer_id << ": " - << "m_blocks_sent.size()=" << m_blocks_sent.size() - << ", m_blocks_sending.size()=" << m_blocks_sending.size() - << ", m_nearest_unsent_d=" << m_nearest_unsent_d - << ", m_excess_gotblocks=" << m_excess_gotblocks << std::endl; + o<<"RemoteClient "<