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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines