ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/cfperl.xs
(Generate patch)

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.315 by root, Thu Jan 8 03:03:24 2009 UTC vs.
Revision 1.323 by root, Sun Oct 11 23:51:41 2009 UTC

71static int tick_pending; 71static int tick_pending;
72 72
73global gbl_ev; 73global gbl_ev;
74static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map; 74static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map;
75static SV *sv_runtime, *sv_tick_start, *sv_next_tick, *sv_now; 75static SV *sv_runtime, *sv_tick_start, *sv_next_tick, *sv_now;
76static AV *av_reflect;
76 77
77bitset<NUM_EVENT_TYPES> ev_want_event; 78bitset<NUM_EVENT_TYPES> ev_want_event;
78bitset<NUM_TYPES> ev_want_type; 79bitset<NUM_TYPES> ev_want_type;
79 80
80static HV 81static HV
317 fprintf (stderr, "P %p\n", pl); 318 fprintf (stderr, "P %p\n", pl);
318 319
319 for_all_clients (ns) 320 for_all_clients (ns)
320 if (find_backref (ptr, ns)) 321 if (find_backref (ptr, ns))
321 fprintf (stderr, "C %p\n", ns); 322 fprintf (stderr, "C %p\n", ns);
322
323} 323}
324 324
325////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 325//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
326 326
327static SV * 327static SV *
1030 1030
1031 return can; 1031 return can;
1032} 1032}
1033 1033
1034void 1034void
1035cfperl_mapscript_activate (object *ob, object *activator, int state) 1035cfperl_mapscript_activate (object *ob, int state, object *activator, object *originator)
1036{ 1036{
1037 CALL_BEGIN (3); 1037 CALL_BEGIN (4);
1038 CALL_ARG (ob); 1038 CALL_ARG (ob);
1039 CALL_ARG (state);
1039 CALL_ARG (activator); 1040 CALL_ARG (activator);
1040 CALL_ARG (state); 1041 CALL_ARG (originator);
1041 CALL_CALL ("cf::mapscript::activate", G_VOID); 1042 CALL_CALL ("cf::mapscript::activate", G_VOID);
1042 CALL_END; 1043 CALL_END;
1043} 1044}
1044 1045
1045player * 1046player *
1185 for (int i = 0; i < size; ++i) 1186 for (int i = 0; i < size; ++i)
1186 CALL_ARG ((IV)addr [i]); 1187 CALL_ARG ((IV)addr [i]);
1187 CALL_CALL ("cf::_log_backtrace", G_VOID); 1188 CALL_CALL ("cf::_log_backtrace", G_VOID);
1188 CALL_END; 1189 CALL_END;
1189#endif 1190#endif
1191}
1192
1193bool
1194is_match_expr (const char *expr)
1195{
1196 return !strncmp (expr, "match ", sizeof ("match ") - 1);
1197}
1198
1199bool
1200match (const char *expr, object *ob, object *self, object *source, object *originator)
1201{
1202 if (!strncmp (expr, "match ", sizeof ("match ") - 1))
1203 expr += sizeof ("match ") - 1;
1204
1205 CALL_BEGIN (5);
1206 CALL_ARG (expr);
1207 CALL_ARG (ob);
1208 CALL_ARG (self);
1209 CALL_ARG (source);
1210 CALL_ARG (originator);
1211 CALL_CALL ("cf::match::match", G_SCALAR);
1212
1213 bool matched = count && SvTRUE (POPs);
1214
1215 CALL_END;
1216
1217 return matched;
1190} 1218}
1191 1219
1192///////////////////////////////////////////////////////////////////////////// 1220/////////////////////////////////////////////////////////////////////////////
1193 1221
1194struct EVAPI *evapi::GEVAPI; 1222struct EVAPI *evapi::GEVAPI;
1255 cb_object = get_av ("cf::CB_OBJECT", 1); 1283 cb_object = get_av ("cf::CB_OBJECT", 1);
1256 cb_player = get_av ("cf::CB_PLAYER", 1); 1284 cb_player = get_av ("cf::CB_PLAYER", 1);
1257 cb_client = get_av ("cf::CB_CLIENT", 1); 1285 cb_client = get_av ("cf::CB_CLIENT", 1);
1258 cb_type = get_av ("cf::CB_TYPE" , 1); 1286 cb_type = get_av ("cf::CB_TYPE" , 1);
1259 cb_map = get_av ("cf::CB_MAP" , 1); 1287 cb_map = get_av ("cf::CB_MAP" , 1);
1288
1289 av_reflect = get_av ("cf::REFLECT" , 1);
1260} 1290}
1261 1291
1262MODULE = cf PACKAGE = cf PREFIX = cf_ 1292MODULE = cf PACKAGE = cf PREFIX = cf_
1263 1293
1264BOOT: 1294BOOT:
2143 2173
2144int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) 2174int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL)
2145 2175
2146int calc_skill_exp (object *who, object *op, object *skill); 2176int calc_skill_exp (object *who, object *op, object *skill);
2147 2177
2148void push_button (object *op); 2178void push_button (object *op, object *originator);
2149 2179
2150void use_trigger (object *op); 2180void use_trigger (object *op, object *originator);
2151 2181
2152void handle_apply_yield (object *op); 2182void handle_apply_yield (object *op);
2183
2184int convert_item (object *item, object *converter);
2153 2185
2154 2186
2155MODULE = cf PACKAGE = cf::object PREFIX = cf_ 2187MODULE = cf PACKAGE = cf::object PREFIX = cf_
2156 2188
2157# no clean way to get an object from an archetype - stupid idiotic 2189# no clean way to get an object from an archetype - stupid idiotic
2362 2394
2363void 2395void
2364adjust_daylight () 2396adjust_daylight ()
2365 CODE: 2397 CODE:
2366 maptile::adjust_daylight (); 2398 maptile::adjust_daylight ();
2399
2400int
2401outdoor_darkness (int darkness = 0)
2402 CODE:
2403 RETVAL = maptile::outdoor_darkness;
2404 if (items)
2405 maptile::outdoor_darkness = darkness;
2406 OUTPUT:
2407 RETVAL
2367 2408
2368void 2409void
2369maptile::instantiate () 2410maptile::instantiate ()
2370 2411
2371maptile *new () 2412maptile *new ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines