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.369 by root, Wed Apr 14 02:31:24 2010 UTC vs.
Revision 1.373 by root, Thu Apr 15 04:56:47 2010 UTC

51#include <perl.h> 51#include <perl.h>
52#include <XSUB.h> 52#include <XSUB.h>
53 53
54#include "CoroAPI.h" 54#include "CoroAPI.h"
55#include "perlxsi.c" 55#include "perlxsi.c"
56
57extern sint64 *levels; // the experience table
58 56
59typedef object_thawer &object_thawer_ref; 57typedef object_thawer &object_thawer_ref;
60typedef object_freezer &object_freezer_ref; 58typedef object_freezer &object_freezer_ref;
61 59
62typedef std::string std__string; 60typedef std::string std__string;
1799 1797
1800int random_roll (int min, int max, object *op, int goodbad); 1798int random_roll (int min, int max, object *op, int goodbad);
1801 1799
1802const_utf8_string cost_string_from_value(uint64 cost, int approx = 0) 1800const_utf8_string cost_string_from_value(uint64 cost, int approx = 0)
1803 1801
1804int
1805exp_to_level (val64 exp) 1802int exp_to_level (val64 exp)
1806 CODE:
1807{
1808 int i = 0;
1809 1803
1810 RETVAL = settings.max_level;
1811
1812 for (i = 1; i <= settings.max_level; i++)
1813 {
1814 if (levels[i] > exp)
1815 {
1816 RETVAL = i - 1;
1817 break;
1818 }
1819 }
1820}
1821 OUTPUT: RETVAL
1822
1823val64
1824level_to_min_exp (int level) 1804val64 level_to_min_exp (int level)
1825 CODE:
1826 if (level > settings.max_level)
1827 RETVAL = levels[settings.max_level];
1828 else if (level < 1)
1829 RETVAL = 0;
1830 else
1831 RETVAL = levels[level];
1832 OUTPUT: RETVAL
1833 1805
1834SV * 1806SV *
1835resistance_to_string (int atnr) 1807resistance_to_string (int atnr)
1836 CODE: 1808 CODE:
1837 if (atnr >= 0 && atnr < NROFATTACKS) 1809 if (atnr >= 0 && atnr < NROFATTACKS)
2028} 2000}
2029 OUTPUT: 2001 OUTPUT:
2030 RETVAL 2002 RETVAL
2031 2003
2032object *find_best_object_match (object *op, utf8_string match) 2004object *find_best_object_match (object *op, utf8_string match)
2033
2034object *find_marked_object (object *op)
2035
2036int need_identify (object *obj);
2037 2005
2038int apply_shop_mat (object *shop_mat, object *op); 2006int apply_shop_mat (object *shop_mat, object *op);
2039 2007
2040int move (object *op, int dir, object *originator = op) 2008int move (object *op, int dir, object *originator = op)
2041 CODE: 2009 CODE:
2954 sv_to (sv, self); 2922 sv_to (sv, self);
2955 delete self; 2923 delete self;
2956 2924
2957MODULE = cf PACKAGE = cf::object::thawer 2925MODULE = cf PACKAGE = cf::object::thawer
2958 2926
2959INCLUDE: $PERL $srcdir/genacc object_thawer $srcdir/../include/cfperl.h | 2927INCLUDE: $PERL $srcdir/genacc object_thawer $srcdir/../include/freezethaw.h |
2960 2928
2961SV * 2929SV *
2962new_from_file (char *klass, octet_string path) 2930new_from_file (char *klass, octet_string path)
2963 CODE: 2931 CODE:
2964 object_thawer *f = new object_thawer (path); 2932 object_thawer *f = new object_thawer (path);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines