3232#include " eiface.h"
3333#include " public/game/server/iplayerinfo.h"
3434#include " basehandle.h"
35- #include " modules/memory/memory_tools.h"
35+
36+ #include " utility/wrap_macros.h"
37+ #include " boost/python.hpp"
38+ using namespace boost ::python;
3639
3740// Externals
3841extern IVEngineServer* engine;
@@ -41,33 +44,13 @@ extern IPlayerInfoManager* playerinfomanager;
4144
4245
4346// ---------------------------------------------------------------------------------
44- // Returns True if the class name equals the given string.
47+ // Returns True if the class name of the given object equals the given string.
4548// ---------------------------------------------------------------------------------
4649inline bool CheckClassname (object obj, char * name)
4750{
4851 return strcmp (extract<char *>(obj.attr (" __class__" ).attr (" __name__" )), name) == 0 ;
4952}
5053
51- // ---------------------------------------------------------------------------------
52- // Converts a Python CPointer object or an integer to an unsigned long.
53- // ---------------------------------------------------------------------------------
54- inline unsigned long ExtractPyPtr (object obj)
55- {
56- // Try to get an unsigned long at first
57- try
58- {
59- return extract<unsigned long >(obj);
60- }
61- catch (...)
62- {
63- PyErr_Clear ();
64- }
65-
66- // If that fails, try to extract a CPointer representation
67- CPointer* pPtr = extract<CPointer *>(obj);
68- return pPtr->m_ulAddr ;
69- }
70-
7154
7255// ---------------------------------------------------------------------------------
7356// Helper template methods for __getitem__ and __setitem__
0 commit comments