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.99 by root, Fri Dec 22 00:04:48 2006 UTC vs.
Revision 1.100 by root, Fri Dec 22 02:04:21 2006 UTC

361 361
362 HV *hv = (HV *)SvRV ((SV *)self); 362 HV *hv = (HV *)SvRV ((SV *)self);
363 363
364 if (SvREFCNT ((SV *)self) == 1 364 if (SvREFCNT ((SV *)self) == 1
365 && SvREFCNT ((SV *)hv) == 1 365 && SvREFCNT ((SV *)hv) == 1
366 && !HvKEYS (hv)) 366 && !HvTOTALKEYS (hv))
367 { 367 {
368 SvREFCNT_dec ((SV *)self); 368 SvREFCNT_dec ((SV *)self);
369 self = 0; 369 self = 0;
370 } 370 }
371} 371}
1008 1008
1009 switch (KLASS_OF (event)) 1009 switch (KLASS_OF (event))
1010 { 1010 {
1011 case KLASS_OBJECT: PUSHs (sv_2mortal (newSVdt (DT_OBJECT, op))); break; 1011 case KLASS_OBJECT: PUSHs (sv_2mortal (newSVdt (DT_OBJECT, op))); break;
1012 case KLASS_PLAYER: PUSHs (sv_2mortal (newSVdt (DT_PLAYER, pl))); break; 1012 case KLASS_PLAYER: PUSHs (sv_2mortal (newSVdt (DT_PLAYER, pl))); break;
1013 case KLASS_CLIENT: PUSHs (sv_2mortal (newSVdt (DT_CLIENT, pl))); break; 1013 case KLASS_CLIENT: PUSHs (sv_2mortal (newSVdt (DT_CLIENT, ns))); break;
1014 case KLASS_MAP: PUSHs (sv_2mortal (newSVdt (DT_MAP, map))); break; 1014 case KLASS_MAP: PUSHs (sv_2mortal (newSVdt (DT_MAP, map))); break;
1015 } 1015 }
1016 1016
1017 for (;;) 1017 for (;;)
1018 { 1018 {
1622 const_iv (KLASS_OBJECT) 1622 const_iv (KLASS_OBJECT)
1623 const_iv (KLASS_CLIENT) 1623 const_iv (KLASS_CLIENT)
1624 const_iv (KLASS_PLAYER) 1624 const_iv (KLASS_PLAYER)
1625 const_iv (KLASS_MAP) 1625 const_iv (KLASS_MAP)
1626 1626
1627 const_iv (CS_QUERY_YESNO)
1628 const_iv (CS_QUERY_SINGLECHAR)
1629 const_iv (CS_QUERY_HIDEINPUT)
1630
1627 const_iv (ST_DEAD) 1631 const_iv (ST_DEAD)
1628 const_iv (ST_SETUP) 1632 const_iv (ST_SETUP)
1629 const_iv (ST_PLAYING) 1633 const_iv (ST_PLAYING)
1630 const_iv (ST_CUSTOM) 1634 const_iv (ST_CUSTOM)
1631 1635
1866 PROTOTYPE: $ 1870 PROTOTYPE: $
1867 PPCODE: 1871 PPCODE:
1868{ 1872{
1869 object *o; 1873 object *o;
1870 for (o = obj->inv; o; o = o->below) 1874 for (o = obj->inv; o; o = o->below)
1871 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o))); 1875 XPUSHs (sv_2mortal (to_sv (o)));
1872} 1876}
1873 1877
1874object *find_best_object_match (object *op, const char *match) 1878object *find_best_object_match (object *op, const char *match)
1875 1879
1876object *find_marked_object (object *op) 1880object *find_marked_object (object *op)
2164 CODE: 2168 CODE:
2165{ 2169{
2166 STRLEN len; 2170 STRLEN len;
2167 char *buf = SvPVbyte (packet, len); 2171 char *buf = SvPVbyte (packet, len);
2168 2172
2173 if (pl->ns)
2169 pl->ns->send_packet (buf, len); 2174 pl->ns->send_packet (buf, len);
2170} 2175}
2171 2176
2172int 2177int
2173listening (player *pl, int new_value = -1) 2178listening (player *pl, int new_value = -1)
2174 CODE: 2179 CODE:
2193 if (y) sv_to (y, pl->bed_y); 2198 if (y) sv_to (y, pl->bed_y);
2194 2199
2195void 2200void
2196list () 2201list ()
2197 PPCODE: 2202 PPCODE:
2198{
2199 player *pl;
2200 for (pl = first_player; pl; pl = pl->next) 2203 for (player *pl = first_player; pl; pl = pl->next)
2201 XPUSHs (newSVcfapi (CFAPI_PPLAYER, pl)); 2204 XPUSHs (sv_2mortal (to_sv (pl)));
2202}
2203 2205
2204bool 2206bool
2205peaceful (player *pl, bool new_setting = 0) 2207peaceful (player *pl, bool new_setting = 0)
2206 PROTOTYPE: $;$ 2208 PROTOTYPE: $;$
2207 CODE: 2209 CODE:
2469 RETVAL = INVOKE_((event_type)event, ARG_CLIENT (ns), ARG_AV (av)); 2471 RETVAL = INVOKE_((event_type)event, ARG_CLIENT (ns), ARG_AV (av));
2470 OUTPUT: RETVAL 2472 OUTPUT: RETVAL
2471 2473
2472SV *registry (client *ns) 2474SV *registry (client *ns)
2473 2475
2476void
2477list ()
2478 PPCODE:
2479 EXTEND (SP, clients.size ());
2480 for (sockvec::iterator i = clients.begin (); i != clients.end (); ++i)
2481 PUSHs (sv_2mortal (to_sv (*i)));
2482
2474client * 2483client *
2475create (int fd, const char *peername) 2484create (int fd, const char *peername)
2476 CODE: 2485 CODE:
2477 RETVAL = client::create (fd, peername); 2486 RETVAL = client::create (fd, peername);
2478 OUTPUT: 2487 OUTPUT:
2479 RETVAL 2488 RETVAL
2480 2489
2481void 2490void
2491client::send_packet (SV *packet)
2492 CODE:
2493{
2494 STRLEN len;
2495 char *buf = SvPVbyte (packet, len);
2496
2497 THIS->send_packet (buf, len);
2498}
2499
2500void
2482client::destroy () 2501client::destroy ()
2483 2502

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines