--- deliantra/server/include/cfperl.h 2006/12/11 22:56:57 1.33 +++ deliantra/server/include/cfperl.h 2006/12/14 05:09:32 1.35 @@ -35,6 +35,7 @@ { KLASS_NONE, KLASS_GLOBAL, + KLASS_SOCKET, KLASS_PLAYER, KLASS_OBJECT, KLASS_MAP, @@ -61,6 +62,7 @@ #define ARG_ARCH(o) DT_ARCH , (void *)static_cast (o) #define ARG_PARTY(o) DT_PARTY , (void *)static_cast (o) #define ARG_REGION(o) DT_REGION, (void *)static_cast (o) +#define ARG_SOCKET(o) DT_SOCKET, (void *)static_cast (o) // the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension @@ -70,6 +72,7 @@ #define INVOKE(klass, event, ...) INVOKE_(EVENT_ ## klass ## _ ## event, ## __VA_ARGS__) #define INVOKE_GLOBAL(event, ...) INVOKE_(EVENT_ ## GLOBAL ## _ ## event, ## __VA_ARGS__) #define INVOKE_OBJECT(event, op, ...) INVOKE_(EVENT_ ## OBJECT ## _ ## event, ARG_OBJECT (op), ## __VA_ARGS__) +#define INVOKE_SOCKET(event, ns, ...) INVOKE_(EVENT_ ## SOCKET ## _ ## event, ARG_SOCKET (ns), ## __VA_ARGS__) #define INVOKE_PLAYER(event, pl, ...) INVOKE_(EVENT_ ## PLAYER ## _ ## event, ARG_PLAYER (pl), ## __VA_ARGS__) #define INVOKE_MAP(event, map, ...) INVOKE_(EVENT_ ## MAP ## _ ## event, ARG_MAP (map) , ## __VA_ARGS__) @@ -79,13 +82,13 @@ #define RESULT_INT(idx) RESULT(idx, INT) bool cfperl_invoke (event_type event, ...); -int cfperl_result_DOUBLE (int idx); -int cfperl_result_INT (int idx); +double cfperl_result_DOUBLE (int idx); +int cfperl_result_INT (int idx); struct attachable_base { - SV *self; - AV *cb; // CF+ perl self and callback + SV *self; // CF+ perl self + AV *cb; // CF+ callbacks shstr attach; // generic extension attachment information void clear (); // called when free'ing objects @@ -114,11 +117,11 @@ { } - attachable_base &operator = (const attachable_base &src) + attachable_base &operator =(const attachable_base &src) { - clear (); - attach = src.attach; - return *this; + clear (); + attach = src.attach; + return *this; } };