From 35b79e5d710862f957bc494638a8d8906992665d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 10 Jun 2014 20:43:27 +0100 Subject: Portal improvements and suggestions --- src/Root.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index d2a4d1eed..1b56b4528 100644 --- a/src/Root.h +++ b/src/Root.h @@ -44,7 +44,7 @@ public: cServer * GetServer(void) { return m_Server; } // tolua_export cWorld * GetDefaultWorld(void); // tolua_export cWorld * GetWorld(const AString & a_WorldName); // tolua_export - cWorld * CreateAndInitializeWorld(const AString & a_WorldName); // tolua_export + cWorld * CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_OverworldName = ""); // tolua_export /// Calls the callback for each world; returns true if the callback didn't abort (return true) bool ForEachWorld(cWorldListCallback & a_Callback); // >> Exported in ManualBindings << -- cgit v1.2.3 From 4e24f711abd3d6a93f01ee7c297eb67c8aedbd37 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 14 Jul 2014 19:49:31 +0100 Subject: Player properties are now retrieved --- src/Root.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index d2a4d1eed..a9e985656 100644 --- a/src/Root.h +++ b/src/Root.h @@ -89,7 +89,7 @@ public: void KickUser(int a_ClientID, const AString & a_Reason); /// Called by cAuthenticator to auth the specified user - void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID); + void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const AString & a_Properties = ""); /// Executes commands queued in the command queue void TickCommands(void); -- cgit v1.2.3 From 1f6854792cdd6792b27c4f9f3d7d857df9dd64bf Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 16 Jul 2014 00:03:47 +0100 Subject: Store properties as Json::Value --- src/Root.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index a9e985656..4a3c205d3 100644 --- a/src/Root.h +++ b/src/Root.h @@ -26,6 +26,11 @@ class cCompositeChat; typedef cItemCallback cPlayerListCallback; typedef cItemCallback cWorldListCallback; +namespace Json +{ + class Value; +} + @@ -89,7 +94,7 @@ public: void KickUser(int a_ClientID, const AString & a_Reason); /// Called by cAuthenticator to auth the specified user - void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const AString & a_Properties = ""); + void AuthenticateUser(int a_ClientID, const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties); /// Executes commands queued in the command queue void TickCommands(void); -- cgit v1.2.3 From 993fd14ddfc881cf5be951df77da0338124d68cc Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 16:33:09 +0200 Subject: Fixed basic whitespace problems. Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines. --- src/Root.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index 4a3c205d3..acd3e9754 100644 --- a/src/Root.h +++ b/src/Root.h @@ -36,20 +36,24 @@ namespace Json /// The root of the object hierarchy -class cRoot // tolua_export -{ // tolua_export +// tolua_begin +class cRoot +{ public: - static cRoot * Get() { return s_Root; } // tolua_export + static cRoot * Get() { return s_Root; } + // tolua_end cRoot(void); ~cRoot(); void Start(void); - cServer * GetServer(void) { return m_Server; } // tolua_export - cWorld * GetDefaultWorld(void); // tolua_export - cWorld * GetWorld(const AString & a_WorldName); // tolua_export - cWorld * CreateAndInitializeWorld(const AString & a_WorldName); // tolua_export + // tolua_begin + cServer * GetServer(void) { return m_Server; } + cWorld * GetDefaultWorld(void); + cWorld * GetWorld(const AString & a_WorldName); + cWorld * CreateAndInitializeWorld(const AString & a_WorldName); + // tolua_end /// Calls the callback for each world; returns true if the callback didn't abort (return true) bool ForEachWorld(cWorldListCallback & a_Callback); // >> Exported in ManualBindings << @@ -106,13 +110,13 @@ public: void SaveAllChunks(void); // tolua_export /// Reloads all the groups - void ReloadGroups(void); // tolua_export + void ReloadGroups(void); // tolua_export /// Calls the callback for each player in all worlds - bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << + bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << /// Finds a player from a partial or complete player name and calls the callback - case-insensitive - bool FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << + bool FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << // tolua_begin @@ -202,8 +206,8 @@ private: static void InputThread(void* a_Params); - static cRoot* s_Root; -}; // tolua_export + static cRoot* s_Root; +}; // tolua_export -- cgit v1.2.3 From ed01e12ed732fc9e3516ed263ebb73978b6f82f6 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 14:50:01 -0700 Subject: main.cpp: Fixed warnings with g_TERMINATE_EVENT_RAISED and g_SERVER_TERMINATED --- src/Root.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index acd3e9754..b31059e71 100644 --- a/src/Root.h +++ b/src/Root.h @@ -40,6 +40,8 @@ namespace Json class cRoot { public: + static bool g_TERMINATE_EVENT_RAISED; + static cRoot * Get() { return s_Root; } // tolua_end -- cgit v1.2.3 From 14826b660649c87c002b4ba23a255007f141dab4 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 15:44:19 -0700 Subject: main.cpp: field style fixes --- src/Root.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index b31059e71..08aafe3c9 100644 --- a/src/Root.h +++ b/src/Root.h @@ -40,7 +40,7 @@ namespace Json class cRoot { public: - static bool g_TERMINATE_EVENT_RAISED; + static bool m_TerminateEventRaised; static cRoot * Get() { return s_Root; } // tolua_end -- cgit v1.2.3 From 6ab9afd0fd808fad99cd8387c72ce461c37aef80 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 20 Jul 2014 10:46:45 +0100 Subject: Bug and crash fixes * Fixes end portals' solidity * Fixed crashes to do with multithreading and removing an entity from the wrong world * Fixed crashes due to bad merge * Fixed crashes due to an object being deleted twice * Simplified cWorld::Start() and added comments to configuration files --- src/Root.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index c3aca37f9..4e3fcf080 100644 --- a/src/Root.h +++ b/src/Root.h @@ -51,8 +51,17 @@ public: // tolua_begin cServer * GetServer(void) { return m_Server; } cWorld * GetDefaultWorld(void); - cWorld * GetWorld(const AString & a_WorldName); - cWorld * CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_OverworldName = ""); + + /** Returns a pointer to the world specified + If no world of that name was currently loaded and a_SearchForFolder was true, it will consult cFile::IsFolder() to see if a world folder of that name exists and if so, initialise a world based on that name + */ + cWorld * GetWorld(const AString & a_WorldName, bool a_SearchForFolder = false); + + /** Returns a pointer to a world of specified name - will search loaded worlds first, then create anew if not found + The dimension parameter is used to create a world with a specific dimension + a_OverworldName should be set for non-overworld dimensions if one wishes that world to link back to an overworld via portals + */ + cWorld * CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_OverworldName = ""); // tolua_end /// Calls the callback for each world; returns true if the callback didn't abort (return true) -- cgit v1.2.3