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.125 by root, Thu Jan 4 00:53:54 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::load_map_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::load_map_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);
845 retval = 0; 850 retval = 0;
846 851
847 CALL_END; 852 CALL_END;
848 853
849 return retval; 854 return retval;
850}
851
852void
853maptile::do_load ()
854{
855 CALL_BEGIN (1);
856 CALL_ARG (this);
857 CALL_CALL ("cf::map::do_load", G_VOID);
858 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} 855}
880 856
881void 857void
882maptile::change_all_map_light (int change) 858maptile::change_all_map_light (int change)
883{ 859{
902 878
903///////////////////////////////////////////////////////////////////////////// 879/////////////////////////////////////////////////////////////////////////////
904 880
905struct EventAPI *watcher_base::GEventAPI; 881struct EventAPI *watcher_base::GEventAPI;
906struct CoroAPI *coroapi::GCoroAPI; 882struct CoroAPI *coroapi::GCoroAPI;
883
884int coroapi::cede_counter;
907 885
908static void iw_dispatch (pe_event *ev) 886static void iw_dispatch (pe_event *ev)
909{ 887{
910 iw *w = (iw *)ev->ext_data; 888 iw *w = (iw *)ev->ext_data;
911 w->call (*w); 889 w->call (*w);
1317 const_iv (P_BLOCKSVIEW) 1295 const_iv (P_BLOCKSVIEW)
1318 const_iv (P_PLAYER) 1296 const_iv (P_PLAYER)
1319 const_iv (P_NO_MAGIC) 1297 const_iv (P_NO_MAGIC)
1320 const_iv (P_IS_ALIVE) 1298 const_iv (P_IS_ALIVE)
1321 const_iv (P_NO_CLERIC) 1299 const_iv (P_NO_CLERIC)
1322 const_iv (P_NEED_UPDATE)
1323 const_iv (P_OUT_OF_MAP) 1300 const_iv (P_OUT_OF_MAP)
1324 const_iv (P_NEW_MAP) 1301 const_iv (P_NEW_MAP)
1302 const_iv (P_UPTODATE)
1325 1303
1326 const_iv (UP_OBJ_INSERT) 1304 const_iv (UP_OBJ_INSERT)
1327 const_iv (UP_OBJ_REMOVE) 1305 const_iv (UP_OBJ_REMOVE)
1328 const_iv (UP_OBJ_CHANGE) 1306 const_iv (UP_OBJ_CHANGE)
1329 const_iv (UP_OBJ_FACE) 1307 const_iv (UP_OBJ_FACE)
1624 case 5: RETVAL = settings.playerdir; break; 1602 case 5: RETVAL = settings.playerdir; break;
1625 case 6: RETVAL = settings.datadir ; break; 1603 case 6: RETVAL = settings.datadir ; break;
1626 } 1604 }
1627 OUTPUT: RETVAL 1605 OUTPUT: RETVAL
1628 1606
1607void abort ()
1608
1629void emergency_save () 1609void emergency_save ()
1630 1610
1631void _exit (int status = 0) 1611void _exit (int status = 0)
1612
1613#if _POSIX_MEMLOCK
1614
1615int mlockall (int flags = MCL_CURRENT | MCL_FUTURE)
1616
1617int munlockall ()
1618
1619#endif
1632 1620
1633int find_animation (char *text) 1621int find_animation (char *text)
1634 PROTOTYPE: $ 1622 PROTOTYPE: $
1635 1623
1636int random_roll (int min, int max, object *op, int goodbad); 1624int random_roll (int min, int max, object *op, int goodbad);
1942 RETVAL = op->contr; 1930 RETVAL = op->contr;
1943 OUTPUT: RETVAL 1931 OUTPUT: RETVAL
1944 1932
1945void check_score (object *op) 1933void check_score (object *op)
1946 1934
1947void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) 1935void message (object *op, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE)
1936 CODE:
1937 new_draw_info (flags, 0, op, txt);
1948 1938
1949object *cf_player_send_inventory (object *op) 1939object *cf_player_send_inventory (object *op)
1950 1940
1951char *cf_player_get_ip (object *op) 1941char *cf_player_get_ip (object *op)
1952 ALIAS: ip = 0 1942 ALIAS: ip = 0
2206 case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; 2196 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; 2197 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; 2198 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; 2199 case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break;
2210 } 2200 }
2211 OUTPUT: 2201 OUTPUT: RETVAL
2212 RETVAL
2213 2202
2214void fix_walls (maptile *map, int x, int y) 2203void fix_walls (maptile *map, int x, int y)
2215 2204
2216void fix_walls_around (maptile *map, int x, int y) 2205void fix_walls_around (maptile *map, int x, int y)
2206
2207const char *
2208region_name (maptile *m)
2209 CODE:
2210 RETVAL = get_name_of_region_for_map (m);
2211 OUTPUT: RETVAL
2217 2212
2218# worst xs function of my life 2213# worst xs function of my life
2219maptile * 2214maptile *
2220_create_random_map (\ 2215_create_random_map (\
2221 char *path,\ 2216 char *path,\
2265 assign (rmp.monsterstyle , monsterstyle); 2260 assign (rmp.monsterstyle , monsterstyle);
2266 assign (rmp.treasurestyle , treasurestyle); 2261 assign (rmp.treasurestyle , treasurestyle);
2267 assign (rmp.layoutstyle , layoutstyle); 2262 assign (rmp.layoutstyle , layoutstyle);
2268 assign (rmp.doorstyle , doorstyle); 2263 assign (rmp.doorstyle , doorstyle);
2269 assign (rmp.decorstyle , decorstyle); 2264 assign (rmp.decorstyle , decorstyle);
2270 assign (rmp.origin_map , origin_map);
2271 assign (rmp.final_map , final_map);
2272 assign (rmp.exitstyle , exitstyle); 2265 assign (rmp.exitstyle , exitstyle);
2273 assign (rmp.this_map , this_map);
2274 assign (rmp.exit_on_final_map, exit_on_final_map); 2266 assign (rmp.exit_on_final_map, exit_on_final_map);
2275 2267
2268 rmp.origin_map = origin_map;
2269 rmp.final_map = final_map;
2270 rmp.this_map = this_map;
2276 rmp.Xsize = Xsize; 2271 rmp.Xsize = Xsize;
2277 rmp.Ysize = Ysize; 2272 rmp.Ysize = Ysize;
2278 rmp.expand2x = expand2x; 2273 rmp.expand2x = expand2x;
2279 rmp.layoutoptions1 = layoutoptions1; 2274 rmp.layoutoptions1 = layoutoptions1;
2280 rmp.layoutoptions2 = layoutoptions2; 2275 rmp.layoutoptions2 = layoutoptions2;
2323 PROTOTYPE: 2318 PROTOTYPE:
2324 CODE: 2319 CODE:
2325 RETVAL = get_firstparty (); 2320 RETVAL = get_firstparty ();
2326 OUTPUT: RETVAL 2321 OUTPUT: RETVAL
2327 2322
2328partylist *next (partylist *party) 2323INCLUDE: $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 2324
2343MODULE = cf PACKAGE = cf::region 2325MODULE = cf PACKAGE = cf::region
2344 2326
2345region *first () 2327region *first ()
2346 PROTOTYPE: 2328 PROTOTYPE:
2347 CODE: 2329 CODE:
2348 RETVAL = first_region; 2330 RETVAL = first_region;
2349 OUTPUT: RETVAL 2331 OUTPUT: RETVAL
2350 2332
2351region *next (region *reg) 2333region *find (char *name)
2334 PROTOTYPE: $
2352 CODE: 2335 CODE:
2353 RETVAL = reg->next; 2336 RETVAL = get_region_by_name (name);
2354 OUTPUT: RETVAL 2337 OUTPUT: RETVAL
2355 2338
2356const char *name (region *reg) 2339INCLUDE: $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 2340
2376MODULE = cf PACKAGE = cf::living 2341MODULE = cf PACKAGE = cf::living
2377 2342
2378INCLUDE: $PERL genacc living ../include/living.h | 2343INCLUDE: $PERL genacc living ../include/living.h |
2379 2344

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines