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.411 by root, Mon Oct 29 23:37:35 2012 UTC vs.
Revision 1.414 by root, Tue Oct 30 17:07:50 2012 UTC

2638 PPCODE: 2638 PPCODE:
2639 EXTEND (SP, clients.size ()); 2639 EXTEND (SP, clients.size ());
2640 for (sockvec::iterator i = clients.begin (); i != clients.end (); ++i) 2640 for (sockvec::iterator i = clients.begin (); i != clients.end (); ++i)
2641 PUSHs (sv_2mortal (to_sv (*i))); 2641 PUSHs (sv_2mortal (to_sv (*i)));
2642 2642
2643STRLEN
2644client::inbuf_append (SV *data)
2645 CODE:
2646{
2647 STRLEN len;
2648 char *ptr = SvPVbyte (data, len);
2649
2650 min_it (len, sizeof (THIS->inbuf) - THIS->inbuf_len);
2651 memcpy (THIS->inbuf + THIS->inbuf_len, ptr, len);
2652 THIS->inbuf_len += len;
2653
2654 THIS->inbuf_handle ();
2655
2656 RETVAL = len;
2657}
2658 OUTPUT: RETVAL
2659
2643void 2660void
2644client::send_packet (SV *packet) 2661client::send_packet (SV *packet)
2645 CODE: 2662 CODE:
2646{ 2663{
2647 STRLEN len; 2664 STRLEN len;
2713 if (!strcmp (name, EMPTY_FACE_NAME )) empty_face = RETVAL; 2730 if (!strcmp (name, EMPTY_FACE_NAME )) empty_face = RETVAL;
2714 if (!strcmp (name, MAGICMOUTH_FACE_NAME)) magicmouth_face = RETVAL; 2731 if (!strcmp (name, MAGICMOUTH_FACE_NAME)) magicmouth_face = RETVAL;
2715} 2732}
2716 OUTPUT: RETVAL 2733 OUTPUT: RETVAL
2717 2734
2735faceidx faces_size ()
2736 CODE:
2737 RETVAL = faces.size ();
2738 OUTPUT: RETVAL
2739
2718void set_type (faceidx idx, int value) 2740void set_type (faceidx idx, int value)
2719 ALIAS: 2741 ALIAS:
2720 set_type = 0 2742 set_type = 0
2721 set_visibility = 1 2743 set_visibility = 1
2722 set_magicmap = 2 2744 set_magicmap = 2
2782 if (!d) XSRETURN_UNDEF; 2804 if (!d) XSRETURN_UNDEF;
2783 RETVAL = newSVpvn ((char *)d->chksum, d->chksum_len); 2805 RETVAL = newSVpvn ((char *)d->chksum, d->chksum_len);
2784 OUTPUT: 2806 OUTPUT:
2785 RETVAL 2807 RETVAL
2786 2808
2809int get_type (faceidx idx)
2810 CODE:
2811 faceinfo *f = face_info (idx);
2812 if (!f) XSRETURN_UNDEF;
2813 RETVAL = f->type;
2814 OUTPUT:
2815 RETVAL
2816
2787SV *get_data (faceidx idx, int faceset = 0) 2817SV *get_data (faceidx idx, int faceset = 0)
2788 CODE: 2818 CODE:
2789 facedata *d = face_data (idx, faceset); 2819 facedata *d = face_data (idx, faceset);
2790 if (!d) XSRETURN_UNDEF; 2820 if (!d) XSRETURN_UNDEF;
2791 RETVAL = newSVpvn (d->data, d->data.size ()); 2821 RETVAL = newSVpvn (d->data, d->data.size ());
2820 OUTPUT: RETVAL 2850 OUTPUT: RETVAL
2821 2851
2822animidx set (utf8_string name, SV *frames, int facings = 1) 2852animidx set (utf8_string name, SV *frames, int facings = 1)
2823 CODE: 2853 CODE:
2824{ 2854{
2825 if (!SvROK (frames) && SvTYPE (SvRV (frames)) != SVt_PVAV) 2855 if (!SvROK (frames) && SvTYPE (SvRV (frames)) != SVt_PVAV)
2826 croak ("frames must be an arrayref"); 2856 croak ("frames must be an arrayref");
2827 2857
2828 AV *av = (AV *)SvRV (frames); 2858 AV *av = (AV *)SvRV (frames);
2829 2859
2830 animation *anim = &animation::find (name); 2860 animation *anim = &animation::find (name);
2831 if (anim->number) 2861 if (anim->number)
2832 { 2862 {
2833 anim->resize (av_len (av) + 1); 2863 anim->resize (av_len (av) + 1);
2834 anim->facings = facings; 2864 anim->facings = facings;
2835 } 2865 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines