From 61e761fdc2bfa5c77002d68bb24e0470def37b48 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sat, 29 Nov 2014 00:36:15 -0800 Subject: issue 1253 - prevent multiple logins with same username --- src/Server.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index 022794bbc..91e6e5c45 100644 --- a/src/Server.h +++ b/src/Server.h @@ -67,6 +67,12 @@ public: // tolua_export int GetNumPlayers(void) const; void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; } + // Get the users waiting to be put into the World. + std::list GetUsernames(void); + + // Can login more than once with same username. + bool isAllowMultiLogin(void) { return m_bAllowMultiLogin; } + // Hardcore mode or not: bool IsHardcore(void) const { return m_bIsHardcore; } @@ -216,6 +222,9 @@ private: int m_MaxPlayers; bool m_bIsHardcore; + /** True - allow same username to login more than once False - only once */ + bool m_bAllowMultiLogin; + cTickThread m_TickThread; cEvent m_RestartEvent; -- cgit v1.2.3 From a7bf2725c8bd5f8ec3e03584af87a7055cb15a60 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sat, 29 Nov 2014 11:22:03 -0800 Subject: fixed naming of strings and changed from i to I --- src/Server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index 91e6e5c45..c9741bb7b 100644 --- a/src/Server.h +++ b/src/Server.h @@ -68,10 +68,10 @@ public: // tolua_export void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; } // Get the users waiting to be put into the World. - std::list GetUsernames(void); + std::list GetUsernames(void); // Can login more than once with same username. - bool isAllowMultiLogin(void) { return m_bAllowMultiLogin; } + bool IsAllowMultiLogin(void) { return m_bAllowMultiLogin; } // Hardcore mode or not: bool IsHardcore(void) const { return m_bIsHardcore; } -- cgit v1.2.3 From 6de07d4a39096f19c075695824aa87a1907e4edc Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 8 Dec 2014 00:45:29 -0800 Subject: Fixed compile errors --- src/Server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index c9741bb7b..e329b5c65 100644 --- a/src/Server.h +++ b/src/Server.h @@ -67,8 +67,8 @@ public: // tolua_export int GetNumPlayers(void) const; void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; } - // Get the users waiting to be put into the World. - std::list GetUsernames(void); + // Check if the player is queued to be transferred to a World. + bool IsPlayerInQueue(AString a_Username); // Can login more than once with same username. bool IsAllowMultiLogin(void) { return m_bAllowMultiLogin; } -- cgit v1.2.3 From 12c012fa01e719c7c103e36ae0407294a0d11bfb Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 8 Dec 2014 14:33:59 -0800 Subject: Changed CheckMultiLogin() to not have main body wrapped in an if statement. Added in indent to cPlayerListCallBack in cCallback class inside CheckMultiLogin(). Added doxy-comment for DoWithPlayer(). Changed comments on IsPlayerInQueue() and IsAllowMultiLogin() to doxy-comments. --- src/Server.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index e329b5c65..a93e8df75 100644 --- a/src/Server.h +++ b/src/Server.h @@ -67,10 +67,12 @@ public: // tolua_export int GetNumPlayers(void) const; void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; } - // Check if the player is queued to be transferred to a World. + /** Check if the player is queued to be transferred to a World. + Returns true is Player is found in queue. */ bool IsPlayerInQueue(AString a_Username); - // Can login more than once with same username. + /** Can login more than once with same username. + Returns false if it is not allowed, true otherwise. */ bool IsAllowMultiLogin(void) { return m_bAllowMultiLogin; } // Hardcore mode or not: -- cgit v1.2.3 From 4b08ca261bed5ec2fd70f64ee96104ba6bee6927 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 9 Dec 2014 03:06:25 -0800 Subject: Fixed indent problems and added return definitions to CheckMultiLogin(). Changed from IsAllowMultiLogin() to DoesAllowMultiLogin(). Fixed CheckMultiLogin() to not run to the end without returning a value. --- src/Server.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index a93e8df75..39a5a1a71 100644 --- a/src/Server.h +++ b/src/Server.h @@ -68,12 +68,12 @@ public: // tolua_export void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; } /** Check if the player is queued to be transferred to a World. - Returns true is Player is found in queue. */ + Returns true is Player is found in queue. */ bool IsPlayerInQueue(AString a_Username); /** Can login more than once with same username. - Returns false if it is not allowed, true otherwise. */ - bool IsAllowMultiLogin(void) { return m_bAllowMultiLogin; } + Returns false if it is not allowed, true otherwise. */ + bool DoesAllowMultiLogin(void) { return m_bAllowMultiLogin; } // Hardcore mode or not: bool IsHardcore(void) const { return m_bIsHardcore; } -- cgit v1.2.3 From 33c6ff872e72563b6e888476b66c4e9c19f8c840 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 11 Dec 2014 14:34:09 +0100 Subject: Cosmetic touchups. Removed trailing whitespace, added cast to remove warning, added file seeking in case of corrupt files. --- src/Server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Server.h') diff --git a/src/Server.h b/src/Server.h index 39a5a1a71..aab47987f 100644 --- a/src/Server.h +++ b/src/Server.h @@ -71,7 +71,7 @@ public: // tolua_export Returns true is Player is found in queue. */ bool IsPlayerInQueue(AString a_Username); - /** Can login more than once with same username. + /** Can login more than once with same username. Returns false if it is not allowed, true otherwise. */ bool DoesAllowMultiLogin(void) { return m_bAllowMultiLogin; } @@ -225,7 +225,7 @@ private: bool m_bIsHardcore; /** True - allow same username to login more than once False - only once */ - bool m_bAllowMultiLogin; + bool m_bAllowMultiLogin; cTickThread m_TickThread; cEvent m_RestartEvent; -- cgit v1.2.3