@@ -25,7 +25,7 @@ namespace gameanalytics
2525
2626 std::string _sessionId;
2727
28- int _sessionNum = 0 ;
28+ int _sessionNum = 0 ;
2929 int64_t _sessionLength = 0 ;
3030 int64_t _totalSessionLength = 0 ;
3131
@@ -67,13 +67,19 @@ namespace gameanalytics
6767 std::string getCustomDimension2 () const ;
6868 std::string getCustomDimension3 () const ;
6969
70+ // returns the last value and increments the transaction count for this player
7071 int getTransactionNum ();
7172
73+ // returns true if this is the 1st player session
7274 bool isNewUser () const ;
7375
76+ // returns true if the user has an active session
7477 bool isActive () const ;
7578
76- bool deserialize (std::string const & data);
79+ // deserializes a player from the given json
80+ bool deserialize (std::string const & jsonData);
81+
82+ // serializes a player to a json string
7783 std::string serialize () const ;
7884
7985 // called when the player joins the server
@@ -82,9 +88,10 @@ namespace gameanalytics
8288 // called when the player logs off
8389 void onExit ();
8490
85- // playtime during the current session
91+ // get the playtime during the current session
8692 int64_t currentSessionPlaytime () const ;
8793
94+ // return playtime of the last session, valid only after onExit has been called
8895 int64_t getLastSessionLength () const ;
8996
9097 // total session playtime
0 commit comments