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.362 by root, Thu Apr 8 19:31:22 2010 UTC vs.
Revision 1.369 by root, Wed Apr 14 02:31:24 2010 UTC

230 do_destroy (); 230 do_destroy ();
231 sever_self (); 231 sever_self ();
232} 232}
233 233
234void 234void
235attachable::do_delete ()
236{
237 delete this;
238}
239
240void
235attachable::check_mortals () 241attachable::check_mortals ()
236{ 242{
237 static int i = 0; 243 static int i = 0;
238 244
239 for (;;) 245 for (;;)
252 258
253 if (0) 259 if (0)
254 { 260 {
255 for (int j = 0; j < mortals.size (); ++j)//D 261 for (int j = 0; j < mortals.size (); ++j)//D
256 fprintf (stderr, "%d:%s %p ", j, &((object *)mortals[j])->name, mortals[j]);//D 262 fprintf (stderr, "%d:%s %p ", j, &((object *)mortals[j])->name, mortals[j]);//D
263
257 fprintf (stderr, "\n");//D 264 fprintf (stderr, "\n");//D
258 } 265 }
259 } 266 }
260 } 267 }
261 268
281 } 288 }
282 else 289 else
283 { 290 {
284 mortals.erase (i); 291 mortals.erase (i);
285 obj->sever_self (); 292 obj->sever_self ();
286 delete obj; 293 obj->do_delete ();
287 } 294 }
288 } 295 }
289} 296}
290 297
291void 298void
1132 1139
1133 return retval; 1140 return retval;
1134} 1141}
1135 1142
1136maptile * 1143maptile *
1137find_style (const_utf8_string dirname, const_utf8_string stylename, int difficulty) 1144find_style (const_utf8_string dirname, const_utf8_string stylename, int difficulty, bool recurse)
1138{ 1145{
1139 CALL_BEGIN (3); 1146 CALL_BEGIN (4);
1140 CALL_ARG (dirname); 1147 CALL_ARG (dirname);
1141 CALL_ARG (stylename); 1148 CALL_ARG (stylename);
1142 CALL_ARG (difficulty); 1149 CALL_ARG (difficulty);
1150 CALL_ARG (recurse);
1143 CALL_CALL ("ext::map_random::find_style", G_SCALAR); 1151 CALL_CALL ("ext::map_random::find_style", G_SCALAR);
1144 1152
1145 maptile *retval = 0; 1153 maptile *retval = 0;
1146 if (count) sv_to (POPs, retval); 1154 if (count) sv_to (POPs, retval);
1147 1155
1224object::ref () const 1232object::ref () const
1225{ 1233{
1226 if (type == PLAYER) 1234 if (type == PLAYER)
1227 return format ("player/<1.%llx>/%s", (unsigned long long)uuid.seq, &name); 1235 return format ("player/<1.%llx>/%s", (unsigned long long)uuid.seq, &name);
1228 else 1236 else
1237 // TODO: should be able to save references within the same map, at least
1229 return 0; 1238 return 0;
1230} 1239}
1231 1240
1232object * 1241object *
1233object::deref (const_utf8_string ref) 1242object::deref (const_utf8_string ref)
1656 switch (items) 1665 switch (items)
1657 { 1666 {
1658 case 0: RETVAL = gen (); break; 1667 case 0: RETVAL = gen (); break;
1659 case 1: RETVAL = gen (SvUV (ST (0))); break; 1668 case 1: RETVAL = gen (SvUV (ST (0))); break;
1660 case 2: RETVAL = gen (SvIV (ST (0)), SvIV (ST (1))); break; 1669 case 2: RETVAL = gen (SvIV (ST (0)), SvIV (ST (1))); break;
1661 default: croak ("cf::rndm requires none, one or two parameters."); break; 1670 default: croak ("cf::rndm requires zero, one or two parameters."); break;
1662 } 1671 }
1663} 1672}
1664 OUTPUT: 1673 OUTPUT:
1665 RETVAL 1674 RETVAL
1666 1675
1682 PROTOTYPE: @ 1691 PROTOTYPE: @
1683 CODE: 1692 CODE:
1684 while (items > 0) 1693 while (items > 0)
1685 sv_rvweaken (ST (--items)); 1694 sv_rvweaken (ST (--items));
1686 1695
1687void 1696void log_suspend ()
1697
1698void log_resume ()
1699
1688log_backtrace (utf8_string msg) 1700void log_backtrace (utf8_string msg)
1689 1701
1690void
1691LOG (int flags, utf8_string msg) 1702void LOG (int flags, utf8_string msg)
1692 PROTOTYPE: $$ 1703 PROTOTYPE: $$
1693 C_ARGS: flags, "%s", msg 1704 C_ARGS: flags, "%s", msg
1694 1705
1695octet_string path_combine (octet_string base, octet_string path) 1706octet_string path_combine (octet_string base, octet_string path)
1696 PROTOTYPE: $$ 1707 PROTOTYPE: $$
2156 PROTOTYPE: $$;$ 2167 PROTOTYPE: $$;$
2157 PPCODE: 2168 PPCODE:
2158{ 2169{
2159 rv_vector rv; 2170 rv_vector rv;
2160 2171
2161 PUTBACK;
2162 get_rangevector (ob, other, &rv, flags); 2172 get_rangevector (ob, other, &rv, flags);
2163 SPAGAIN;
2164 2173
2165 EXTEND (SP, 5); 2174 EXTEND (SP, 5);
2166 PUSHs (newSVuv (rv.distance)); 2175 PUSHs (sv_2mortal (newSVuv (rv.distance)));
2167 PUSHs (newSViv (rv.distance_x)); 2176 PUSHs (sv_2mortal (newSViv (rv.distance_x)));
2168 PUSHs (newSViv (rv.distance_y)); 2177 PUSHs (sv_2mortal (newSViv (rv.distance_y)));
2169 PUSHs (newSViv (rv.direction)); 2178 PUSHs (sv_2mortal (newSViv (rv.direction)));
2170 PUSHs (to_sv (rv.part)); 2179 PUSHs (sv_2mortal (to_sv (rv.part)));
2171} 2180}
2172 2181
2173bool on_same_map_as (object *ob, object *other) 2182bool on_same_map_as (object *ob, object *other)
2174 CODE: 2183 CODE:
2175 RETVAL = on_same_map (ob, other); 2184 RETVAL = on_same_map (ob, other);
2799 while (!RETVAL); // crude way to leave index 0 2808 while (!RETVAL); // crude way to leave index 0
2800 2809
2801 faces [RETVAL].name = name; 2810 faces [RETVAL].name = name;
2802 facehash.insert (std::make_pair (faces [RETVAL].name, RETVAL)); 2811 facehash.insert (std::make_pair (faces [RETVAL].name, RETVAL));
2803 2812
2804 if (!strcmp (name, BLANK_FACE_NAME)) blank_face = RETVAL; 2813 if (!strcmp (name, BLANK_FACE_NAME )) blank_face = RETVAL;
2805 if (!strcmp (name, EMPTY_FACE_NAME)) empty_face = RETVAL; 2814 if (!strcmp (name, EMPTY_FACE_NAME )) empty_face = RETVAL;
2815 if (!strcmp (name, MAGICMOUTH_FACE_NAME)) magicmouth_face = RETVAL;
2806} 2816}
2807 OUTPUT: RETVAL 2817 OUTPUT: RETVAL
2808 2818
2809void set_type (faceidx idx, int value) 2819void set_type (faceidx idx, int value)
2810 ALIAS: 2820 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines