From 2c19d51409ca903021e0b508e5bc15299c4e51dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 22 Jan 2017 11:17:41 +0100 Subject: [CSM] sound_play & sound_stop support + client_lua_api doc (#5096) * squashed: CSM: Implement register_globalstep * Re-use fatal error mechanism from server to disconnect client on CSM error * Little client functions cleanups * squashed: CSM: add core.after function * core.after is shared code between client & server * ModApiUtil get_us_time feature enabled for client --- src/client.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index 21aeb0575..ff8aea591 100644 --- a/src/client.h +++ b/src/client.h @@ -488,13 +488,19 @@ public: // Get event from queue. CE_NONE is returned if queue is empty. ClientEvent getClientEvent(); - bool accessDenied() - { return m_access_denied; } + bool accessDenied() const { return m_access_denied; } - bool reconnectRequested() { return m_access_denied_reconnect; } + bool reconnectRequested() const { return m_access_denied_reconnect; } - std::string accessDeniedReason() - { return m_access_denied_reason; } + void setFatalError(const std::string &reason) + { + m_access_denied = true; + m_access_denied_reason = reason; + } + + // Renaming accessDeniedReason to better name could be good as it's used to + // disconnect client when CSM failed. + const std::string &accessDeniedReason() const { return m_access_denied_reason; } bool itemdefReceived() { return m_itemdef_received; } -- cgit v1.2.3