--- deliantra/server/include/cfperl.h 2006/08/27 17:59:26 1.10 +++ deliantra/server/include/cfperl.h 2006/08/28 07:07:41 1.11 @@ -16,6 +16,7 @@ enum data_type { DT_END, // no further arguments + DT_AV, // perl-only av that needs to be flattened out DT_INT, DT_INT64, DT_DOUBLE, @@ -27,13 +28,13 @@ DT_ARCH, DT_PARTY, DT_REGION, - DT_AV, // av that needs to be flattened out NUM_DATA_TYPES }; enum event_klass { + KLASS_NONE, KLASS_GLOBAL, KLASS_PLAYER, KLASS_OBJECT, @@ -48,6 +49,7 @@ NUM_EVENT_TYPES }; +#define ARG_AV(o) DT_AV , static_cast (o) #define ARG_INT(v) DT_INT , static_cast (v) #define ARG_INT64(v) DT_INT64 , static_cast (v) #define ARG_DOUBLE(v) DT_DOUBLE, static_cast (v) @@ -109,17 +111,16 @@ { const char *filename; void *av; - int idx; object_freezer (const char *filename); ~object_freezer (); - void put (attachable_base *ext); + void put (FILE *fp, attachable_base *ext); template - void put (attachable *obj) + void put (FILE *fp, attachable *obj) { - put ((attachable_base *)obj); + put (fp, (attachable_base *)obj); } void finish (); @@ -128,18 +129,17 @@ struct object_thawer { void *av; - int idx; object_thawer (const char *filename = 0); ~object_thawer (); - void get (data_type type, void *obj, attachable_base *ext); + void get (data_type type, void *obj, attachable_base *ext, int oid); template - void get (attachable *obj) + void get (attachable *obj, int oid) { if (av) - get (subclass::get_dt (), (subclass *)obj, obj); + get (subclass::get_dt (), (subclass *)obj, obj, oid); } void finish ();