32
32
#include " eiface.h"
33
33
#include " public/game/server/iplayerinfo.h"
34
34
#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;
36
39
37
40
// Externals
38
41
extern IVEngineServer* engine;
@@ -41,33 +44,13 @@ extern IPlayerInfoManager* playerinfomanager;
41
44
42
45
43
46
// ---------------------------------------------------------------------------------
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.
45
48
// ---------------------------------------------------------------------------------
46
49
inline bool CheckClassname (object obj, char * name)
47
50
{
48
51
return strcmp (extract<char *>(obj.attr (" __class__" ).attr (" __name__" )), name) == 0 ;
49
52
}
50
53
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
-
71
54
72
55
// ---------------------------------------------------------------------------------
73
56
// Helper template methods for __getitem__ and __setitem__
0 commit comments