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.119 by root, Sun Dec 31 10:28:36 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::load_map_sync (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::load_map_sync", 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);
845 retval = 0; 850 retval = 0;
846 851
847 CALL_END; 852 CALL_END;
848 853
849 return retval; 854 return retval;
855}
856
857void
858maptile::do_load_sync ()
859{
860 CALL_BEGIN (1);
861 CALL_ARG (this);
862 CALL_CALL ("cf::map::do_load_sync", G_SCALAR);
863 CALL_END;
850} 864}
851 865
852void 866void
853maptile::change_all_map_light (int change) 867maptile::change_all_map_light (int change)
854{ 868{
873 887
874///////////////////////////////////////////////////////////////////////////// 888/////////////////////////////////////////////////////////////////////////////
875 889
876struct EventAPI *watcher_base::GEventAPI; 890struct EventAPI *watcher_base::GEventAPI;
877struct CoroAPI *coroapi::GCoroAPI; 891struct CoroAPI *coroapi::GCoroAPI;
892
893int coroapi::cede_counter;
878 894
879static void iw_dispatch (pe_event *ev) 895static void iw_dispatch (pe_event *ev)
880{ 896{
881 iw *w = (iw *)ev->ext_data; 897 iw *w = (iw *)ev->ext_data;
882 w->call (*w); 898 w->call (*w);
1288 const_iv (P_BLOCKSVIEW) 1304 const_iv (P_BLOCKSVIEW)
1289 const_iv (P_PLAYER) 1305 const_iv (P_PLAYER)
1290 const_iv (P_NO_MAGIC) 1306 const_iv (P_NO_MAGIC)
1291 const_iv (P_IS_ALIVE) 1307 const_iv (P_IS_ALIVE)
1292 const_iv (P_NO_CLERIC) 1308 const_iv (P_NO_CLERIC)
1293 const_iv (P_NEED_UPDATE)
1294 const_iv (P_OUT_OF_MAP) 1309 const_iv (P_OUT_OF_MAP)
1295 const_iv (P_NEW_MAP) 1310 const_iv (P_NEW_MAP)
1311 const_iv (P_UPTODATE)
1296 1312
1297 const_iv (UP_OBJ_INSERT) 1313 const_iv (UP_OBJ_INSERT)
1298 const_iv (UP_OBJ_REMOVE) 1314 const_iv (UP_OBJ_REMOVE)
1299 const_iv (UP_OBJ_CHANGE) 1315 const_iv (UP_OBJ_CHANGE)
1300 const_iv (UP_OBJ_FACE) 1316 const_iv (UP_OBJ_FACE)
1595 case 5: RETVAL = settings.playerdir; break; 1611 case 5: RETVAL = settings.playerdir; break;
1596 case 6: RETVAL = settings.datadir ; break; 1612 case 6: RETVAL = settings.datadir ; break;
1597 } 1613 }
1598 OUTPUT: RETVAL 1614 OUTPUT: RETVAL
1599 1615
1616void abort ()
1617
1600void emergency_save () 1618void emergency_save ()
1601 1619
1602void _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
1603 1629
1604int find_animation (char *text) 1630int find_animation (char *text)
1605 PROTOTYPE: $ 1631 PROTOTYPE: $
1606 1632
1607int random_roll (int min, int max, object *op, int goodbad); 1633int random_roll (int min, int max, object *op, int goodbad);
1913 RETVAL = op->contr; 1939 RETVAL = op->contr;
1914 OUTPUT: RETVAL 1940 OUTPUT: RETVAL
1915 1941
1916void check_score (object *op) 1942void check_score (object *op)
1917 1943
1918void 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);
1919 1947
1920object *cf_player_send_inventory (object *op) 1948object *cf_player_send_inventory (object *op)
1921 1949
1922char *cf_player_get_ip (object *op) 1950char *cf_player_get_ip (object *op)
1923 ALIAS: ip = 0 1951 ALIAS: ip = 0
2177 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;
2178 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;
2179 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;
2180 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;
2181 } 2209 }
2182 OUTPUT: 2210 OUTPUT: RETVAL
2183 RETVAL
2184 2211
2185void fix_walls (maptile *map, int x, int y) 2212void fix_walls (maptile *map, int x, int y)
2186 2213
2187void 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
2188 2221
2189# worst xs function of my life 2222# worst xs function of my life
2190maptile * 2223maptile *
2191_create_random_map (\ 2224_create_random_map (\
2192 char *path,\ 2225 char *path,\
2236 assign (rmp.monsterstyle , monsterstyle); 2269 assign (rmp.monsterstyle , monsterstyle);
2237 assign (rmp.treasurestyle , treasurestyle); 2270 assign (rmp.treasurestyle , treasurestyle);
2238 assign (rmp.layoutstyle , layoutstyle); 2271 assign (rmp.layoutstyle , layoutstyle);
2239 assign (rmp.doorstyle , doorstyle); 2272 assign (rmp.doorstyle , doorstyle);
2240 assign (rmp.decorstyle , decorstyle); 2273 assign (rmp.decorstyle , decorstyle);
2241 assign (rmp.origin_map , origin_map);
2242 assign (rmp.final_map , final_map);
2243 assign (rmp.exitstyle , exitstyle); 2274 assign (rmp.exitstyle , exitstyle);
2244 assign (rmp.this_map , this_map);
2245 assign (rmp.exit_on_final_map, exit_on_final_map); 2275 assign (rmp.exit_on_final_map, exit_on_final_map);
2246 2276
2277 rmp.origin_map = origin_map;
2278 rmp.final_map = final_map;
2279 rmp.this_map = this_map;
2247 rmp.Xsize = Xsize; 2280 rmp.Xsize = Xsize;
2248 rmp.Ysize = Ysize; 2281 rmp.Ysize = Ysize;
2249 rmp.expand2x = expand2x; 2282 rmp.expand2x = expand2x;
2250 rmp.layoutoptions1 = layoutoptions1; 2283 rmp.layoutoptions1 = layoutoptions1;
2251 rmp.layoutoptions2 = layoutoptions2; 2284 rmp.layoutoptions2 = layoutoptions2;
2298 2331
2299INCLUDE: $PERL genacc partylist ../include/player.h | 2332INCLUDE: $PERL genacc partylist ../include/player.h |
2300 2333
2301MODULE = cf PACKAGE = cf::region 2334MODULE = cf PACKAGE = cf::region
2302 2335
2303region *first () 2336region *first ()
2304 PROTOTYPE: 2337 PROTOTYPE:
2305 CODE: 2338 CODE:
2306 RETVAL = first_region; 2339 RETVAL = first_region;
2340 OUTPUT: RETVAL
2341
2342region *find (char *name)
2343 PROTOTYPE: $
2344 CODE:
2345 RETVAL = get_region_by_name (name);
2307 OUTPUT: RETVAL 2346 OUTPUT: RETVAL
2308 2347
2309INCLUDE: $PERL genacc region ../include/map.h | 2348INCLUDE: $PERL genacc region ../include/map.h |
2310 2349
2311MODULE = cf PACKAGE = cf::living 2350MODULE = cf PACKAGE = cf::living

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines