EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ClientSession.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Bloody.Rabbit
24  Updates: Allan
25 */
26 
27 #ifndef __CLIENT_SESSION_H__INCL__
28 #define __CLIENT_SESSION_H__INCL__
29 
30 #include "eve-server.h"
38 {
39 public:
40  ClientSession();
42 
43  bool isDirty() const { return mDirty; }
44 
45  // PyInt
46  void SetInt( const char* name, int32 value );
47  int32 GetLastInt( const char* name ) const;
48  int32 GetCurrentInt( const char* name ) const;
49  // PyLong
50  void SetLong( const char* name, int64 value );
51  int64 GetLastLong( const char* name ) const;
52  int64 GetCurrentLong( const char* name ) const;
53  // PyString
54  void SetString( const char* name, const char* value );
55  std::string GetLastString( const char* name ) const;
56  std::string GetCurrentString( const char* name ) const;
57 
58  void Clear( const char* name );
59 
66  void EncodeChanges( PyDict* into );
67 
74  void EncodeInitialState (PyDict* into);
75 
77 
78 protected:
79  PyRep* _GetLast( const char* name ) const;
80  PyRep* _GetCurrent( const char* name ) const;
81  PyTuple* _GetValueTuple( const char* name ) const;
82 
83  void _Set( const char* name, PyRep* value );
84 
85  PyDict* const mSession;
86 
87 private:
88  bool mDirty;
89 
91 };
92 
93 #endif /* !__CLIENT_SESSION_H__INCL__ */
std::string GetLastString(const char *name) const
int64 GetLastLong(const char *name) const
Base Python wire object.
Definition: PyRep.h:66
std::string GetCurrentString(const char *name) const
Python's dictionary.
Definition: PyRep.h:719
void SetLong(const char *name, int64 value)
PyTuple * _GetValueTuple(const char *name) const
Python tuple.
Definition: PyRep.h:567
void Clear(const char *name)
signed __int32 int32
Definition: eve-compat.h:49
Value keeper for single EVE session.
Definition: ClientSession.h:37
int64 GetSessionID()
Definition: ClientSession.h:76
int64 GetCurrentLong(const char *name) const
bool isDirty() const
Definition: ClientSession.h:43
PyRep * _GetLast(const char *name) const
int32 GetCurrentInt(const char *name) const
PyRep * _GetCurrent(const char *name) const
signed __int64 int64
Definition: eve-compat.h:51
void SetString(const char *name, const char *value)
PyDict *const mSession
Definition: ClientSession.h:85
void _Set(const char *name, PyRep *value)
int32 GetLastInt(const char *name) const
void SetInt(const char *name, int32 value)
void EncodeChanges(PyDict *into)
void EncodeInitialState(PyDict *into)