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.139 by root, Thu Jan 11 23:17:05 2007 UTC vs.
Revision 1.144 by root, Fri Jan 19 15:55:27 2007 UTC

243 243
244 // now bless the object _once_ 244 // now bless the object _once_
245 return sv_bless (newRV_inc ((SV *)obj->self), stash); 245 return sv_bless (newRV_inc ((SV *)obj->self), stash);
246 } 246 }
247 else 247 else
248 {
248 return newRV_inc ((SV *)obj->self); 249 SV *sv = newRV_inc ((SV *)obj->self);
250
251 if (Gv_AMG (stash)) // handle overload correctly, as the perl core does not
252 SvAMAGIC_on (sv);
253
254 return sv;
255 }
249} 256}
250 257
251static void 258static void
252clearSVptr (SV *sv) 259clearSVptr (SV *sv)
253{ 260{
1545 1552
1546NV floor (NV x) 1553NV floor (NV x)
1547 1554
1548NV ceil (NV x) 1555NV ceil (NV x)
1549 1556
1557NV rndm (...)
1558 CODE:
1559 switch (items)
1560 {
1561 case 0: RETVAL = rndm (); break;
1562 case 1: RETVAL = rndm (SvUV (ST (0))); break;
1563 case 2: RETVAL = rndm (SvIV (ST (0)), SvIV (ST (1))); break;
1564 default: croak ("cf::rndm requires none, one or two parameters."); break;
1565 }
1566 OUTPUT:
1567 RETVAL
1568
1550void server_tick () 1569void server_tick ()
1551 CODE: 1570 CODE:
1552 runtime = SvNVx (sv_runtime); 1571 runtime = SvNVx (sv_runtime);
1553 server_tick (); 1572 server_tick ();
1554 1573
1600 } 1619 }
1601 OUTPUT: RETVAL 1620 OUTPUT: RETVAL
1602 1621
1603void abort () 1622void abort ()
1604 1623
1624void fork_abort (char *cause = "cf::fork_abort")
1625
1605void cleanup (const char *cause, bool make_core = false) 1626void cleanup (const char *cause, bool make_core = false)
1606 1627
1607void emergency_save () 1628void emergency_save ()
1608 1629
1609void _exit (int status = 0) 1630void _exit (int status = 0)
1833 1854
1834void drop (object *who, object *op) 1855void drop (object *who, object *op)
1835 1856
1836void pick_up (object *who, object *op) 1857void pick_up (object *who, object *op)
1837 1858
1838object *cf_object_insert_object (object *op, object *container)
1839
1840object *cf_object_insert_in_ob (object *ob, object *where)
1841
1842int cf_object_teleport (object *op, maptile *map, int x, int y) 1859int cf_object_teleport (object *op, maptile *map, int x, int y)
1843 1860
1844void update_object (object *op, int action) 1861void update_object (object *op, int action)
1845 1862
1846object *cf_create_object_by_name (const char *name) 1863object *cf_create_object_by_name (const char *name)
1964 1981
1965void esrv_update_item (object *op, int what, object *item) 1982void esrv_update_item (object *op, int what, object *item)
1966 C_ARGS: what, op, item 1983 C_ARGS: what, op, item
1967 1984
1968void clear_los (object *op) 1985void clear_los (object *op)
1969
1970int command_teleport (object *op, char *params)
1971 1986
1972int command_summon (object *op, char *params) 1987int command_summon (object *op, char *params)
1973 1988
1974int command_arrest (object *op, char *params) 1989int command_arrest (object *op, char *params)
1975 1990
2118 2133
2119object* cf_map_present_arch_by_name (maptile *map, const char* str, int nx, int ny) 2134object* cf_map_present_arch_by_name (maptile *map, const char* str, int nx, int ny)
2120 C_ARGS: str, map, nx, ny 2135 C_ARGS: str, map, nx, ny
2121 2136
2122void 2137void
2123cf_map_normalise (maptile *map, int x, int y) 2138get_map_flags (maptile *map, int x, int y)
2124 PPCODE: 2139 PPCODE:
2125{ 2140{
2126 maptile *nmap = 0; 2141 maptile *nmap = 0;
2127 I16 nx = 0, ny = 0; 2142 I16 nx = 0, ny = 0;
2128 int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); 2143 int flags = get_map_flags (map, &nmap, x, y, &nx, &ny);
2190 CODE: 2205 CODE:
2191 RETVAL = get_name_of_region_for_map (m); 2206 RETVAL = get_name_of_region_for_map (m);
2192 OUTPUT: RETVAL 2207 OUTPUT: RETVAL
2193 2208
2194# worst xs function of my life 2209# worst xs function of my life
2195maptile * 2210bool
2196_create_random_map (\ 2211_create_random_map (\
2197 char *path,\ 2212 maptile *self,\
2198 char *wallstyle,\ 2213 char *wallstyle,\
2199 char *wall_name,\ 2214 char *wall_name,\
2200 char *floorstyle,\ 2215 char *floorstyle,\
2201 char *monsterstyle,\ 2216 char *monsterstyle,\
2202 char *treasurestyle,\ 2217 char *treasurestyle,\
2272 rmp.treasureoptions = treasureoptions; 2287 rmp.treasureoptions = treasureoptions;
2273 rmp.symmetry_used = symmetry_used; 2288 rmp.symmetry_used = symmetry_used;
2274 rmp.region = region; 2289 rmp.region = region;
2275 rmp.custom = custom; 2290 rmp.custom = custom;
2276 2291
2277 RETVAL = generate_random_map (path, &rmp); 2292 RETVAL = self->generate_random_map (&rmp);
2278} 2293}
2279 OUTPUT: 2294 OUTPUT:
2280 RETVAL 2295 RETVAL
2281 2296
2282MODULE = cf PACKAGE = cf::arch 2297MODULE = cf PACKAGE = cf::arch

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines