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.118 by root, Sat Dec 30 20:32:30 2006 UTC vs.
Revision 1.127 by root, Thu Jan 4 20:15:16 2007 UTC

32#include <sproto.h> 32#include <sproto.h>
33 33
34#include "cfperl.h" 34#include "cfperl.h"
35#include "shstr.h" 35#include "shstr.h"
36 36
37#include <unistd.h>
38#if _POSIX_MEMLOCK
39# include <sys/mman.h>
40#endif
41
37#include <EXTERN.h> 42#include <EXTERN.h>
38#include <perl.h> 43#include <perl.h>
39#include <XSUB.h> 44#include <XSUB.h>
40 45
41#include "CoroAPI.h" 46#include "CoroAPI.h"
140 145
141void 146void
142attachable::do_destroy () 147attachable::do_destroy ()
143{ 148{
144 invoke (EVENT_ATTACHABLE_DESTROY, DT_END); 149 invoke (EVENT_ATTACHABLE_DESTROY, DT_END);
150
151 if (self)
152 hv_clear (self);
145 153
146 //TODO: call generic destroy callback 154 //TODO: call generic destroy callback
147 mortals.push_back (this); 155 mortals.push_back (this);
148} 156}
149 157
828 CALL_CALL ("cf::map::emergency_save", G_VOID); 836 CALL_CALL ("cf::map::emergency_save", G_VOID);
829 CALL_END; 837 CALL_END;
830} 838}
831 839
832maptile * 840maptile *
833maptile::find_map (const char *path, maptile *origin) 841maptile::find_sync (const char *path, maptile *origin)
834{ 842{
835 CALL_BEGIN (2); 843 CALL_BEGIN (2);
836 CALL_ARG (path); 844 CALL_ARG (path);
837 CALL_ARG (origin); 845 CALL_ARG (origin);
838 CALL_CALL ("cf::map::find_map", G_SCALAR); 846 CALL_CALL ("cf::map::find_sync", G_SCALAR);
839 847
840 maptile *retval; 848 maptile *retval;
841 849
842 if (count) 850 if (count)
843 sv_to (POPs, retval); 851 sv_to (POPs, retval);
848 856
849 return retval; 857 return retval;
850} 858}
851 859
852void 860void
853maptile::do_load () 861maptile::do_load_sync ()
854{ 862{
855 CALL_BEGIN (1); 863 CALL_BEGIN (1);
856 CALL_ARG (this); 864 CALL_ARG (this);
857 CALL_CALL ("cf::map::do_load", G_VOID); 865 CALL_CALL ("cf::map::do_load_sync", G_SCALAR);
858 CALL_END; 866 CALL_END;
859}
860
861maptile *
862maptile::customise_for (object *op)
863{
864 CALL_BEGIN (2);
865 CALL_ARG (this);
866 CALL_ARG (op);
867 CALL_CALL ("cf::map::customise_for", G_SCALAR);
868
869 maptile *retval;
870
871 if (count)
872 sv_to (POPs, retval);
873 else
874 retval = 0;
875
876 CALL_END;
877
878 return retval ? retval : this;
879} 867}
880 868
881void 869void
882maptile::change_all_map_light (int change) 870maptile::change_all_map_light (int change)
883{ 871{
902 890
903///////////////////////////////////////////////////////////////////////////// 891/////////////////////////////////////////////////////////////////////////////
904 892
905struct EventAPI *watcher_base::GEventAPI; 893struct EventAPI *watcher_base::GEventAPI;
906struct CoroAPI *coroapi::GCoroAPI; 894struct CoroAPI *coroapi::GCoroAPI;
895
896int coroapi::cede_counter;
907 897
908static void iw_dispatch (pe_event *ev) 898static void iw_dispatch (pe_event *ev)
909{ 899{
910 iw *w = (iw *)ev->ext_data; 900 iw *w = (iw *)ev->ext_data;
911 w->call (*w); 901 w->call (*w);
1317 const_iv (P_BLOCKSVIEW) 1307 const_iv (P_BLOCKSVIEW)
1318 const_iv (P_PLAYER) 1308 const_iv (P_PLAYER)
1319 const_iv (P_NO_MAGIC) 1309 const_iv (P_NO_MAGIC)
1320 const_iv (P_IS_ALIVE) 1310 const_iv (P_IS_ALIVE)
1321 const_iv (P_NO_CLERIC) 1311 const_iv (P_NO_CLERIC)
1322 const_iv (P_NEED_UPDATE)
1323 const_iv (P_OUT_OF_MAP) 1312 const_iv (P_OUT_OF_MAP)
1324 const_iv (P_NEW_MAP) 1313 const_iv (P_NEW_MAP)
1314 const_iv (P_UPTODATE)
1325 1315
1326 const_iv (UP_OBJ_INSERT) 1316 const_iv (UP_OBJ_INSERT)
1327 const_iv (UP_OBJ_REMOVE) 1317 const_iv (UP_OBJ_REMOVE)
1328 const_iv (UP_OBJ_CHANGE) 1318 const_iv (UP_OBJ_CHANGE)
1329 const_iv (UP_OBJ_FACE) 1319 const_iv (UP_OBJ_FACE)
1624 case 5: RETVAL = settings.playerdir; break; 1614 case 5: RETVAL = settings.playerdir; break;
1625 case 6: RETVAL = settings.datadir ; break; 1615 case 6: RETVAL = settings.datadir ; break;
1626 } 1616 }
1627 OUTPUT: RETVAL 1617 OUTPUT: RETVAL
1628 1618
1619void abort ()
1620
1629void emergency_save () 1621void emergency_save ()
1630 1622
1631void _exit (int status = 0) 1623void _exit (int status = 0)
1624
1625#if _POSIX_MEMLOCK
1626
1627int mlockall (int flags = MCL_CURRENT | MCL_FUTURE)
1628
1629int munlockall ()
1630
1631#endif
1632 1632
1633int find_animation (char *text) 1633int find_animation (char *text)
1634 PROTOTYPE: $ 1634 PROTOTYPE: $
1635 1635
1636int random_roll (int min, int max, object *op, int goodbad); 1636int random_roll (int min, int max, object *op, int goodbad);
1942 RETVAL = op->contr; 1942 RETVAL = op->contr;
1943 OUTPUT: RETVAL 1943 OUTPUT: RETVAL
1944 1944
1945void check_score (object *op) 1945void check_score (object *op)
1946 1946
1947void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) 1947void message (object *op, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE)
1948 CODE:
1949 new_draw_info (flags, 0, op, txt);
1948 1950
1949object *cf_player_send_inventory (object *op) 1951object *cf_player_send_inventory (object *op)
1950 1952
1951char *cf_player_get_ip (object *op) 1953char *cf_player_get_ip (object *op)
1952 ALIAS: ip = 0 1954 ALIAS: ip = 0
2206 case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; 2208 case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break;
2207 case 5: RETVAL = newSVuv ( GET_MAP_MOVE_SLOW (obj, x, y)); break; 2209 case 5: RETVAL = newSVuv ( GET_MAP_MOVE_SLOW (obj, x, y)); break;
2208 case 6: RETVAL = newSVuv ( GET_MAP_MOVE_ON (obj, x, y)); break; 2210 case 6: RETVAL = newSVuv ( GET_MAP_MOVE_ON (obj, x, y)); break;
2209 case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break; 2211 case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break;
2210 } 2212 }
2211 OUTPUT: 2213 OUTPUT: RETVAL
2212 RETVAL
2213 2214
2214void fix_walls (maptile *map, int x, int y) 2215void fix_walls (maptile *map, int x, int y)
2215 2216
2216void fix_walls_around (maptile *map, int x, int y) 2217void fix_walls_around (maptile *map, int x, int y)
2218
2219const char *
2220region_name (maptile *m)
2221 CODE:
2222 RETVAL = get_name_of_region_for_map (m);
2223 OUTPUT: RETVAL
2217 2224
2218# worst xs function of my life 2225# worst xs function of my life
2219maptile * 2226maptile *
2220_create_random_map (\ 2227_create_random_map (\
2221 char *path,\ 2228 char *path,\
2265 assign (rmp.monsterstyle , monsterstyle); 2272 assign (rmp.monsterstyle , monsterstyle);
2266 assign (rmp.treasurestyle , treasurestyle); 2273 assign (rmp.treasurestyle , treasurestyle);
2267 assign (rmp.layoutstyle , layoutstyle); 2274 assign (rmp.layoutstyle , layoutstyle);
2268 assign (rmp.doorstyle , doorstyle); 2275 assign (rmp.doorstyle , doorstyle);
2269 assign (rmp.decorstyle , decorstyle); 2276 assign (rmp.decorstyle , decorstyle);
2270 assign (rmp.origin_map , origin_map);
2271 assign (rmp.final_map , final_map);
2272 assign (rmp.exitstyle , exitstyle); 2277 assign (rmp.exitstyle , exitstyle);
2273 assign (rmp.this_map , this_map);
2274 assign (rmp.exit_on_final_map, exit_on_final_map); 2278 assign (rmp.exit_on_final_map, exit_on_final_map);
2275 2279
2280 rmp.origin_map = origin_map;
2281 rmp.final_map = final_map;
2282 rmp.this_map = this_map;
2276 rmp.Xsize = Xsize; 2283 rmp.Xsize = Xsize;
2277 rmp.Ysize = Ysize; 2284 rmp.Ysize = Ysize;
2278 rmp.expand2x = expand2x; 2285 rmp.expand2x = expand2x;
2279 rmp.layoutoptions1 = layoutoptions1; 2286 rmp.layoutoptions1 = layoutoptions1;
2280 rmp.layoutoptions2 = layoutoptions2; 2287 rmp.layoutoptions2 = layoutoptions2;
2323 PROTOTYPE: 2330 PROTOTYPE:
2324 CODE: 2331 CODE:
2325 RETVAL = get_firstparty (); 2332 RETVAL = get_firstparty ();
2326 OUTPUT: RETVAL 2333 OUTPUT: RETVAL
2327 2334
2328partylist *next (partylist *party) 2335INCLUDE: $PERL genacc partylist ../include/player.h |
2329 CODE:
2330 RETVAL = party->next;
2331 OUTPUT: RETVAL
2332
2333const char *name (partylist *party)
2334 CODE:
2335 RETVAL = party->partyname;
2336 OUTPUT: RETVAL
2337
2338const char *password (partylist *party)
2339 CODE:
2340 RETVAL = party->passwd;
2341 OUTPUT: RETVAL
2342 2336
2343MODULE = cf PACKAGE = cf::region 2337MODULE = cf PACKAGE = cf::region
2344 2338
2345region *first () 2339region *first ()
2346 PROTOTYPE: 2340 PROTOTYPE:
2347 CODE: 2341 CODE:
2348 RETVAL = first_region; 2342 RETVAL = first_region;
2349 OUTPUT: RETVAL 2343 OUTPUT: RETVAL
2350 2344
2351region *next (region *reg) 2345region *find (char *name)
2346 PROTOTYPE: $
2352 CODE: 2347 CODE:
2353 RETVAL = reg->next; 2348 RETVAL = get_region_by_name (name);
2354 OUTPUT: RETVAL 2349 OUTPUT: RETVAL
2355 2350
2356const char *name (region *reg) 2351INCLUDE: $PERL genacc region ../include/map.h |
2357 CODE:
2358 RETVAL = reg->name;
2359 OUTPUT: RETVAL
2360
2361region *parent (region *reg)
2362 CODE:
2363 RETVAL = reg->parent;
2364 OUTPUT: RETVAL
2365
2366const char *longname (region *reg)
2367 CODE:
2368 RETVAL = reg->longname;
2369 OUTPUT: RETVAL
2370
2371const char *msg (region *reg)
2372 CODE:
2373 RETVAL = reg->msg;
2374 OUTPUT: RETVAL
2375 2352
2376MODULE = cf PACKAGE = cf::living 2353MODULE = cf PACKAGE = cf::living
2377 2354
2378INCLUDE: $PERL genacc living ../include/living.h | 2355INCLUDE: $PERL genacc living ../include/living.h |
2379 2356

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines