1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include "nel/misc/types_nl.h"
18 #include "game_share/r2_basic_types.h"
19 //#include "game_share/r2_types.h"
20 #include "persistent_data.h"
23 #ifndef NL_FAR_POSITION_H
24 #define NL_FAR_POSITION_H
29 /** Define the online state of a character */
30 enum TCharConnectionState
32 /// the character is offline
34 /// the character is online on the same shard
36 /// the character is online, but on another shard in the domain.
42 * \author Stephane Coutelas
43 * \author Nevrax France
46 class COfflineEntityState
49 // Start by declaring methods for persistent load/ save operations
50 // The following macro is defined in persistent_data.h
51 // At time of writing it evaluated to:
52 // void store(CPersistentDataRecord &pdr) const;
53 // void apply(CPersistentDataRecord &pdr);
55 DECLARE_PERSISTENCE_METHODS
79 COfflineEntityState(const CEntityState
& state
);
82 bool operator== (const COfflineEntityState
&other
) const;
85 COfflineEntityState
& operator= (const COfflineEntityState
&src
)
90 Heading
= src
.Heading
;
97 void serial(NLMISC::IStream
&f
)
106 std::string
toString() const;
111 * Session identifier.
112 * On a mainland shard, there is a main fixed TSessionId for the whole EGS.
113 * On a ring shard (adventures, outlands), the DSS manages several sessions.
114 * Each character is in a session.
116 //typedef uint32 TSessionId;
118 // Special value to force saving the position stack without updating it from the outside anymore
119 const TSessionId
SessionLockPositionStack(~0u);
123 * Session Id + Entity State (X,Y,Z,Theta)
124 * \author Olivier Cado
125 * \author Nevrax France
132 DECLARE_PERSISTENCE_METHODS
134 TSessionId SessionId
;
135 COfflineEntityState PosState
;
140 bool operator== (const CFarPosition
&other
) const;
143 CFarPosition
& operator= (const CFarPosition
&src
)
145 SessionId
= src
.SessionId
;
146 PosState
= src
.PosState
;
153 void serial(NLMISC::IStream
&f
)
163 #endif // NL_FAR_POSITION_H
165 /* End of far_position.h */