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.126 by root, Thu Jan 4 16:19:32 2007 UTC

31#include <cstdarg> 31#include <cstdarg>
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
37#include <unistd.h>
38#if _POSIX_MEMLOCK
39# include <sys/mman.h>
40#endif
36 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
828 CALL_CALL ("cf::map::emergency_save", G_VOID); 833 CALL_CALL ("cf::map::emergency_save", G_VOID);
829 CALL_END; 834 CALL_END;
830} 835}
831 836
832maptile * 837maptile *
833maptile::find_map (const char *path, maptile *origin) 838maptile::find_sync (const char *path, maptile *origin)
834{ 839{
835 CALL_BEGIN (2); 840 CALL_BEGIN (2);
836 CALL_ARG (path); 841 CALL_ARG (path);
837 CALL_ARG (origin); 842 CALL_ARG (origin);
838 CALL_CALL ("cf::map::find_map", G_SCALAR); 843 CALL_CALL ("cf::map::find_sync", G_SCALAR);
839 844
840 maptile *retval; 845 maptile *retval;
841 846
842 if (count) 847 if (count)
843 sv_to (POPs, retval); 848 sv_to (POPs, retval);
848 853
849 return retval; 854 return retval;
850} 855}
851 856
852void 857void
853maptile::do_load () 858maptile::do_load_sync ()
854{ 859{
855 CALL_BEGIN (1); 860 CALL_BEGIN (1);
856 CALL_ARG (this); 861 CALL_ARG (this);
857 CALL_CALL ("cf::map::do_load", G_VOID); 862 CALL_CALL ("cf::map::do_load_sync", G_SCALAR);
858 CALL_END; 863 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} 864}
880 865
881void 866void
882maptile::change_all_map_light (int change) 867maptile::change_all_map_light (int change)
883{ 868{
902 887
903///////////////////////////////////////////////////////////////////////////// 888/////////////////////////////////////////////////////////////////////////////
904 889
905struct EventAPI *watcher_base::GEventAPI; 890struct EventAPI *watcher_base::GEventAPI;
906struct CoroAPI *coroapi::GCoroAPI; 891struct CoroAPI *coroapi::GCoroAPI;
892
893int coroapi::cede_counter;
907 894
908static void iw_dispatch (pe_event *ev) 895static void iw_dispatch (pe_event *ev)
909{ 896{
910 iw *w = (iw *)ev->ext_data; 897 iw *w = (iw *)ev->ext_data;
911 w->call (*w); 898 w->call (*w);
1317 const_iv (P_BLOCKSVIEW) 1304 const_iv (P_BLOCKSVIEW)
1318 const_iv (P_PLAYER) 1305 const_iv (P_PLAYER)
1319 const_iv (P_NO_MAGIC) 1306 const_iv (P_NO_MAGIC)
1320 const_iv (P_IS_ALIVE) 1307 const_iv (P_IS_ALIVE)
1321 const_iv (P_NO_CLERIC) 1308 const_iv (P_NO_CLERIC)
1322 const_iv (P_NEED_UPDATE)
1323 const_iv (P_OUT_OF_MAP) 1309 const_iv (P_OUT_OF_MAP)
1324 const_iv (P_NEW_MAP) 1310 const_iv (P_NEW_MAP)
1311 const_iv (P_UPTODATE)
1325 1312
1326 const_iv (UP_OBJ_INSERT) 1313 const_iv (UP_OBJ_INSERT)
1327 const_iv (UP_OBJ_REMOVE) 1314 const_iv (UP_OBJ_REMOVE)
1328 const_iv (UP_OBJ_CHANGE) 1315 const_iv (UP_OBJ_CHANGE)
1329 const_iv (UP_OBJ_FACE) 1316 const_iv (UP_OBJ_FACE)
1624 case 5: RETVAL = settings.playerdir; break; 1611 case 5: RETVAL = settings.playerdir; break;
1625 case 6: RETVAL = settings.datadir ; break; 1612 case 6: RETVAL = settings.datadir ; break;
1626 } 1613 }
1627 OUTPUT: RETVAL 1614 OUTPUT: RETVAL
1628 1615
1616void abort ()
1617
1629void emergency_save () 1618void emergency_save ()
1630 1619
1631void _exit (int status = 0) 1620void _exit (int status = 0)
1621
1622#if _POSIX_MEMLOCK
1623
1624int mlockall (int flags = MCL_CURRENT | MCL_FUTURE)
1625
1626int munlockall ()
1627
1628#endif
1632 1629
1633int find_animation (char *text) 1630int find_animation (char *text)
1634 PROTOTYPE: $ 1631 PROTOTYPE: $
1635 1632
1636int random_roll (int min, int max, object *op, int goodbad); 1633int random_roll (int min, int max, object *op, int goodbad);
1942 RETVAL = op->contr; 1939 RETVAL = op->contr;
1943 OUTPUT: RETVAL 1940 OUTPUT: RETVAL
1944 1941
1945void check_score (object *op) 1942void check_score (object *op)
1946 1943
1947void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) 1944void message (object *op, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE)
1945 CODE:
1946 new_draw_info (flags, 0, op, txt);
1948 1947
1949object *cf_player_send_inventory (object *op) 1948object *cf_player_send_inventory (object *op)
1950 1949
1951char *cf_player_get_ip (object *op) 1950char *cf_player_get_ip (object *op)
1952 ALIAS: ip = 0 1951 ALIAS: ip = 0
2206 case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; 2205 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; 2206 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; 2207 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; 2208 case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break;
2210 } 2209 }
2211 OUTPUT: 2210 OUTPUT: RETVAL
2212 RETVAL
2213 2211
2214void fix_walls (maptile *map, int x, int y) 2212void fix_walls (maptile *map, int x, int y)
2215 2213
2216void fix_walls_around (maptile *map, int x, int y) 2214void fix_walls_around (maptile *map, int x, int y)
2215
2216const char *
2217region_name (maptile *m)
2218 CODE:
2219 RETVAL = get_name_of_region_for_map (m);
2220 OUTPUT: RETVAL
2217 2221
2218# worst xs function of my life 2222# worst xs function of my life
2219maptile * 2223maptile *
2220_create_random_map (\ 2224_create_random_map (\
2221 char *path,\ 2225 char *path,\
2265 assign (rmp.monsterstyle , monsterstyle); 2269 assign (rmp.monsterstyle , monsterstyle);
2266 assign (rmp.treasurestyle , treasurestyle); 2270 assign (rmp.treasurestyle , treasurestyle);
2267 assign (rmp.layoutstyle , layoutstyle); 2271 assign (rmp.layoutstyle , layoutstyle);
2268 assign (rmp.doorstyle , doorstyle); 2272 assign (rmp.doorstyle , doorstyle);
2269 assign (rmp.decorstyle , decorstyle); 2273 assign (rmp.decorstyle , decorstyle);
2270 assign (rmp.origin_map , origin_map);
2271 assign (rmp.final_map , final_map);
2272 assign (rmp.exitstyle , exitstyle); 2274 assign (rmp.exitstyle , exitstyle);
2273 assign (rmp.this_map , this_map);
2274 assign (rmp.exit_on_final_map, exit_on_final_map); 2275 assign (rmp.exit_on_final_map, exit_on_final_map);
2275 2276
2277 rmp.origin_map = origin_map;
2278 rmp.final_map = final_map;
2279 rmp.this_map = this_map;
2276 rmp.Xsize = Xsize; 2280 rmp.Xsize = Xsize;
2277 rmp.Ysize = Ysize; 2281 rmp.Ysize = Ysize;
2278 rmp.expand2x = expand2x; 2282 rmp.expand2x = expand2x;
2279 rmp.layoutoptions1 = layoutoptions1; 2283 rmp.layoutoptions1 = layoutoptions1;
2280 rmp.layoutoptions2 = layoutoptions2; 2284 rmp.layoutoptions2 = layoutoptions2;
2323 PROTOTYPE: 2327 PROTOTYPE:
2324 CODE: 2328 CODE:
2325 RETVAL = get_firstparty (); 2329 RETVAL = get_firstparty ();
2326 OUTPUT: RETVAL 2330 OUTPUT: RETVAL
2327 2331
2328partylist *next (partylist *party) 2332INCLUDE: $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 2333
2343MODULE = cf PACKAGE = cf::region 2334MODULE = cf PACKAGE = cf::region
2344 2335
2345region *first () 2336region *first ()
2346 PROTOTYPE: 2337 PROTOTYPE:
2347 CODE: 2338 CODE:
2348 RETVAL = first_region; 2339 RETVAL = first_region;
2349 OUTPUT: RETVAL 2340 OUTPUT: RETVAL
2350 2341
2351region *next (region *reg) 2342region *find (char *name)
2343 PROTOTYPE: $
2352 CODE: 2344 CODE:
2353 RETVAL = reg->next; 2345 RETVAL = get_region_by_name (name);
2354 OUTPUT: RETVAL 2346 OUTPUT: RETVAL
2355 2347
2356const char *name (region *reg) 2348INCLUDE: $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 2349
2376MODULE = cf PACKAGE = cf::living 2350MODULE = cf PACKAGE = cf::living
2377 2351
2378INCLUDE: $PERL genacc living ../include/living.h | 2352INCLUDE: $PERL genacc living ../include/living.h |
2379 2353

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines