summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authorElNounch <ElNounch@users.noreply.github.com>2016-08-22 19:43:43 +0200
committerMattes D <github@xoft.cz>2016-08-22 19:43:43 +0200
commite9d1a942d14de642ae9dae5974bffa0e5fdd6ec6 (patch)
treec76e8a614c71d688dfb2342b030af235f916e91b /src/World.h
parentWebAdmin: Report opened ports. (#3333) (diff)
downloadcuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.tar
cuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.tar.gz
cuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.tar.bz2
cuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.tar.lz
cuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.tar.xz
cuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.tar.zst
cuberite-e9d1a942d14de642ae9dae5974bffa0e5fdd6ec6.zip
Diffstat (limited to '')
-rw-r--r--src/World.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/World.h b/src/World.h
index c1794b159..a00e181b6 100644
--- a/src/World.h
+++ b/src/World.h
@@ -61,6 +61,7 @@ class cBroadcaster;
typedef std::list< cPlayer * > cPlayerList;
+typedef std::list< std::pair< cPlayer *, cWorld * > > cAwaitingPlayerList;
typedef SharedPtr<cSetChunkData> cSetChunkDataPtr; // TODO: Change to unique_ptr once we go C++11
typedef std::vector<cSetChunkDataPtr> cSetChunkDataPtrs;
@@ -262,8 +263,9 @@ public:
/** Adds the player to the world.
Uses a queue to store the player object until the Tick thread processes the addition event.
- Also adds the player as an entity in the chunkmap, and the player's ClientHandle, if any, for ticking. */
- void AddPlayer(cPlayer * a_Player);
+ Also adds the player as an entity in the chunkmap, and the player's ClientHandle, if any, for ticking.
+ If a_OldWorld is provided, a corresponding ENTITY_CHANGED_WORLD event is triggerred after the addition. */
+ void AddPlayer(cPlayer * a_Player, cWorld * a_OldWorld = nullptr);
/** Removes the player from the world.
Removes the player from the addition queue, too, if appropriate.
@@ -1006,7 +1008,7 @@ private:
cCriticalSection m_CSPlayersToAdd;
/** List of players that are scheduled for adding, waiting for the Tick thread to add them. */
- cPlayerList m_PlayersToAdd;
+ cAwaitingPlayerList m_PlayersToAdd;
/** CS protecting m_SetChunkDataQueue. */
cCriticalSection m_CSSetChunkDataQueue;