… | |
… | |
136 | inline SV *to_sv (unsigned long v) { return newSVuv (v); } |
136 | inline SV *to_sv (unsigned long v) { return newSVuv (v); } |
137 | inline SV *to_sv ( signed long long v) { return newSVval64 (v); } |
137 | inline SV *to_sv ( signed long long v) { return newSVval64 (v); } |
138 | inline SV *to_sv (unsigned long long v) { return newSVval64 (v); } |
138 | inline SV *to_sv (unsigned long long v) { return newSVval64 (v); } |
139 | inline SV *to_sv (float v) { return newSVnv (v); } |
139 | inline SV *to_sv (float v) { return newSVnv (v); } |
140 | inline SV *to_sv (double v) { return newSVnv (v); } |
140 | inline SV *to_sv (double v) { return newSVnv (v); } |
|
|
141 | inline SV *to_sv (client_socket *v) { return newSVattachable (v, "cf::client_socket::wrap"); } |
141 | inline SV *to_sv (player * v) { return newSVattachable (v, "cf::player::wrap"); } |
142 | inline SV *to_sv (player * v) { return newSVattachable (v, "cf::player::wrap"); } |
142 | inline SV *to_sv (object * v) { return newSVattachable (v, v && v->type == PLAYER ? "cf::object::player::wrap" : "cf::object::wrap"); } |
143 | inline SV *to_sv (object * v) { return newSVattachable (v, v && v->type == PLAYER ? "cf::object::player::wrap" : "cf::object::wrap"); } |
143 | inline SV *to_sv (maptile * v) { return newSVattachable (v, "cf::map::wrap"); } |
144 | inline SV *to_sv (maptile * v) { return newSVattachable (v, "cf::map::wrap"); } |
144 | inline SV *to_sv (archetype * v) { return newSVptr (v, "cf::arch::wrap"); } |
145 | inline SV *to_sv (archetype * v) { return newSVptr (v, "cf::arch::wrap"); } |
145 | inline SV *to_sv (partylist * v) { return newSVptr (v, "cf::party::wrap"); } |
146 | inline SV *to_sv (partylist * v) { return newSVptr (v, "cf::party::wrap"); } |
… | |
… | |
173 | inline void sv_to (SV *sv, unsigned long &v) { v = SvUV (sv); } |
174 | inline void sv_to (SV *sv, unsigned long &v) { v = SvUV (sv); } |
174 | inline void sv_to (SV *sv, signed long long &v) { v = ( signed long long)SvVAL64 (sv); } |
175 | inline void sv_to (SV *sv, signed long long &v) { v = ( signed long long)SvVAL64 (sv); } |
175 | inline void sv_to (SV *sv, unsigned long long &v) { v = (unsigned long long)SvVAL64 (sv); } |
176 | inline void sv_to (SV *sv, unsigned long long &v) { v = (unsigned long long)SvVAL64 (sv); } |
176 | inline void sv_to (SV *sv, float &v) { v = SvNV (sv); } |
177 | inline void sv_to (SV *sv, float &v) { v = SvNV (sv); } |
177 | inline void sv_to (SV *sv, double &v) { v = SvNV (sv); } |
178 | inline void sv_to (SV *sv, double &v) { v = SvNV (sv); } |
|
|
179 | inline void sv_to (SV *sv, client_socket *&v) { v = (client_socket *)SvPTR_ornull (sv, "cf::client_socket"); } |
178 | inline void sv_to (SV *sv, player * &v) { v = (player *)SvPTR_ornull (sv, "cf::player"); } |
180 | inline void sv_to (SV *sv, player * &v) { v = (player *)SvPTR_ornull (sv, "cf::player"); } |
179 | inline void sv_to (SV *sv, object * &v) { v = (object *)SvPTR_ornull (sv, "cf::object"); } |
181 | inline void sv_to (SV *sv, object * &v) { v = (object *)SvPTR_ornull (sv, "cf::object"); } |
180 | inline void sv_to (SV *sv, archetype * &v) { v = (archetype *)SvPTR_ornull (sv, "cf::arch"); } |
182 | inline void sv_to (SV *sv, archetype * &v) { v = (archetype *)SvPTR_ornull (sv, "cf::arch"); } |
181 | inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)SvPTR_ornull (sv, "cf::map"); } |
183 | inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)SvPTR_ornull (sv, "cf::map"); } |
182 | inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } |
184 | inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } |
… | |
… | |
239 | break; |
241 | break; |
240 | |
242 | |
241 | case DT_MAP: |
243 | case DT_MAP: |
242 | // va_arg (object *) when void * is passed is an XSI extension |
244 | // va_arg (object *) when void * is passed is an XSI extension |
243 | sv = to_sv (va_arg (ap, maptile *)); |
245 | sv = to_sv (va_arg (ap, maptile *)); |
|
|
246 | break; |
|
|
247 | |
|
|
248 | case DT_SOCKET: |
|
|
249 | sv = to_sv (va_arg (ap, client_socket *)); |
244 | break; |
250 | break; |
245 | |
251 | |
246 | case DT_PLAYER: |
252 | case DT_PLAYER: |
247 | sv = to_sv (va_arg (ap, player *)); |
253 | sv = to_sv (va_arg (ap, player *)); |
248 | break; |
254 | break; |
… | |
… | |
309 | } |
315 | } |
310 | |
316 | |
311 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
317 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
312 | |
318 | |
313 | SV * |
319 | SV * |
314 | registry_of (attachable_base *ext) |
320 | registry (attachable_base *ext) |
315 | { |
321 | { |
316 | if (!ext->cb) |
322 | if (!ext->cb) |
317 | ext->cb = newAV (); |
323 | ext->cb = newAV (); |
318 | |
324 | |
319 | return newRV_inc ((SV *)ext->cb); |
325 | return newRV_inc ((SV *)ext->cb); |
… | |
… | |
1043 | cfperl_result_INT (int idx) |
1049 | cfperl_result_INT (int idx) |
1044 | { |
1050 | { |
1045 | return SvIV (cfperl_result (idx)); |
1051 | return SvIV (cfperl_result (idx)); |
1046 | } |
1052 | } |
1047 | |
1053 | |
1048 | int |
1054 | double |
1049 | cfperl_result_DOUBLE (int idx) |
1055 | cfperl_result_DOUBLE (int idx) |
1050 | { |
1056 | { |
1051 | return SvNV (cfperl_result (idx)); |
1057 | return SvNV (cfperl_result (idx)); |
1052 | } |
1058 | } |
1053 | |
1059 | |
… | |
… | |
1600 | |
1606 | |
1601 | for (object *op = object::first; op; op = op->next) |
1607 | for (object *op = object::first; op; op = op->next) |
1602 | reattach (op); |
1608 | reattach (op); |
1603 | } |
1609 | } |
1604 | |
1610 | |
|
|
1611 | bool |
|
|
1612 | add_client_socket (int fd, const char *peername) |
|
|
1613 | |
1605 | NV floor (NV x) |
1614 | NV floor (NV x) |
1606 | |
1615 | |
1607 | NV ceil (NV x) |
1616 | NV ceil (NV x) |
1608 | |
1617 | |
1609 | void server_tick () |
1618 | void server_tick () |
… | |
… | |
1656 | } |
1665 | } |
1657 | OUTPUT: RETVAL |
1666 | OUTPUT: RETVAL |
1658 | |
1667 | |
1659 | void _exit (int status = 0) |
1668 | void _exit (int status = 0) |
1660 | |
1669 | |
1661 | int cf_find_animation (char *text) |
1670 | int find_animation (char *text) |
1662 | PROTOTYPE: $ |
1671 | PROTOTYPE: $ |
1663 | |
1672 | |
1664 | int random_roll(int min, int max, object *op, int goodbad); |
1673 | int random_roll (int min, int max, object *op, int goodbad); |
1665 | |
1674 | |
1666 | const char *cost_string_from_value(uint64 cost, int approx = 0) |
1675 | const char *cost_string_from_value(uint64 cost, int approx = 0) |
1667 | |
1676 | |
1668 | int invoke (int event, ...) |
1677 | int invoke (int event, ...) |
1669 | CODE: |
1678 | CODE: |
… | |
… | |
1730 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
1739 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
1731 | RETVAL = INVOKE_((event_type)event, ARG_OBJECT (op), ARG_AV (av)); |
1740 | RETVAL = INVOKE_((event_type)event, ARG_OBJECT (op), ARG_AV (av)); |
1732 | OUTPUT: RETVAL |
1741 | OUTPUT: RETVAL |
1733 | |
1742 | |
1734 | SV *registry (object *op) |
1743 | SV *registry (object *op) |
1735 | CODE: |
|
|
1736 | RETVAL = registry_of (op); |
|
|
1737 | OUTPUT: |
|
|
1738 | RETVAL |
|
|
1739 | |
1744 | |
1740 | void mortals () |
1745 | void mortals () |
1741 | PPCODE: |
1746 | PPCODE: |
1742 | EXTEND (SP, object::mortals.size ()); |
1747 | EXTEND (SP, object::mortals.size ()); |
1743 | for (AUTODECL (i, object::mortals.begin ()); i != object::mortals.end (); ++i) |
1748 | for (AUTODECL (i, object::mortals.begin ()); i != object::mortals.end (); ++i) |
… | |
… | |
1785 | |
1790 | |
1786 | object *find_best_object_match (object *op, const char *match) |
1791 | object *find_best_object_match (object *op, const char *match) |
1787 | |
1792 | |
1788 | object *find_marked_object (object *op) |
1793 | object *find_marked_object (object *op) |
1789 | |
1794 | |
1790 | int cf_object_get_resistance (object *op, int rtype) |
1795 | int resistance (object *op, int rtype, int newval = 0) |
1791 | ALIAS: resistance = 0 |
1796 | CODE: |
|
|
1797 | if (rtype < 0 || rtype >= NROFATTACKS) |
|
|
1798 | croak ("resistance out of bounds"); |
|
|
1799 | RETVAL = op->resist [rtype]; |
|
|
1800 | if (items >= 3) |
|
|
1801 | op->resist [rtype] = newval; |
|
|
1802 | OUTPUT: RETVAL |
|
|
1803 | |
|
|
1804 | void set_resistance (object *op, int rtype, int val) |
|
|
1805 | CODE: |
|
|
1806 | if (rtype < 0 || rtype >= NROFATTACKS) |
|
|
1807 | op->resist[rtype] = val; |
1792 | |
1808 | |
1793 | int need_identify (const object *obj); |
1809 | int need_identify (const object *obj); |
1794 | |
1810 | |
1795 | int apply_shop_mat (object *shop_mat, object *op); |
1811 | int apply_shop_mat (object *shop_mat, object *op); |
1796 | |
1812 | |
… | |
… | |
1798 | CODE: |
1814 | CODE: |
1799 | RETVAL = move_ob (op, dir, originator); |
1815 | RETVAL = move_ob (op, dir, originator); |
1800 | OUTPUT: |
1816 | OUTPUT: |
1801 | RETVAL |
1817 | RETVAL |
1802 | |
1818 | |
1803 | void cf_object_apply (object *op, object *author, int flags = 0) |
1819 | void apply (object *applier, object *applied, int flags = 0) |
|
|
1820 | CODE: |
|
|
1821 | manual_apply (applied, applier, flags); |
1804 | |
1822 | |
1805 | void cf_object_apply_below (object *op) |
1823 | void apply_below (object *op) |
|
|
1824 | CODE: |
|
|
1825 | player_apply_below (op); |
1806 | |
1826 | |
1807 | void cf_object_remove (object *op) |
1827 | void remove (object *op) |
|
|
1828 | CODE: |
|
|
1829 | op->remove (); |
1808 | |
1830 | |
1809 | void cf_object_free (object *op) |
1831 | void destroy (object *op, int recursive = 0) |
|
|
1832 | CODE: |
|
|
1833 | op->destroy (recursive); |
1810 | |
1834 | |
1811 | object *cf_object_present_archname_inside (object *op, char *whatstr) |
1835 | object *cf_object_present_archname_inside (object *op, char *whatstr) |
1812 | |
1836 | |
1813 | int cf_object_transfer (object *op, int x, int y, int r = 0, object_ornull *orig = 0) |
1837 | int cf_object_transfer (object *op, int x, int y, int r = 0, object_ornull *orig = 0) |
1814 | |
1838 | |
1815 | int cf_object_change_map (object *op, int x, int y, maptile *map) |
1839 | int cf_object_change_map (object *op, int x, int y, maptile *map) |
1816 | |
1840 | |
1817 | object *cf_object_clone (object *op, int clonetype = 0) |
1841 | object *clone (object *op, int recursive = 0) |
|
|
1842 | CODE: |
|
|
1843 | if (recursive) |
|
|
1844 | RETVAL = object_create_clone (op); |
|
|
1845 | else |
|
|
1846 | { |
|
|
1847 | RETVAL = object::create (); |
|
|
1848 | op->copy_to (RETVAL); |
|
|
1849 | } |
|
|
1850 | OUTPUT: RETVAL |
1818 | |
1851 | |
1819 | int cf_object_pay_item (object *op, object *buyer) |
1852 | int pay_item (object *op, object *buyer) |
|
|
1853 | CODE: |
|
|
1854 | RETVAL = pay_for_item (op, buyer); |
|
|
1855 | OUTPUT: RETVAL |
1820 | |
1856 | |
1821 | int cf_object_pay_amount (object *op, uint64 amount) |
1857 | int pay_amount (object *op, uint64 amount) |
|
|
1858 | CODE: |
|
|
1859 | RETVAL = pay_for_amount (amount, op); |
|
|
1860 | OUTPUT: RETVAL |
1822 | |
1861 | |
1823 | void pay_player (object *op, uint64 amount) |
1862 | void pay_player (object *op, uint64 amount) |
1824 | |
1863 | |
1825 | val64 pay_player_arch (object *op, const char *arch, uint64 amount) |
1864 | val64 pay_player_arch (object *op, const char *arch, uint64 amount) |
1826 | |
1865 | |
1827 | int cf_object_cast_spell (object *caster, object *ctoo, int dir, object *spell_ob, char *stringarg = 0) |
1866 | int cast_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg = 0) |
1828 | |
1867 | |
1829 | int cf_object_cast_ability (object *caster, object *ctoo, int dir, object *sp_, char *stringarg = 0) |
1868 | void learn_spell (object *op, object *sp, int special_prayer = 0) |
|
|
1869 | CODE: |
|
|
1870 | do_learn_spell (op, sp, special_prayer); |
1830 | |
1871 | |
1831 | void cf_object_learn_spell (object *op, object *sp) |
|
|
1832 | |
|
|
1833 | void cf_object_forget_spell (object *op, object *sp) |
1872 | void forget_spell (object *op, object *sp) |
|
|
1873 | CODE: |
|
|
1874 | do_forget_spell (op, query_name (sp)); |
1834 | |
1875 | |
1835 | object *cf_object_check_for_spell (object *op, char *spellname) |
1876 | object *check_for_spell (object *op, char *spellname) |
|
|
1877 | CODE: |
|
|
1878 | RETVAL = check_spell_known (op, spellname); |
|
|
1879 | OUTPUT: RETVAL |
1836 | |
1880 | |
1837 | int cf_object_query_money (object *op) |
1881 | int query_money (object *op) |
1838 | ALIAS: money = 0 |
1882 | ALIAS: money = 0 |
1839 | |
1883 | |
1840 | int cf_object_query_cost (object *op, object *who, int flags) |
1884 | int query_cost (object *op, object *who, int flags) |
1841 | ALIAS: cost = 0 |
1885 | ALIAS: cost = 0 |
1842 | |
1886 | |
1843 | void cf_object_activate_rune (object *op , object *victim) |
1887 | void spring_trap (object *op, object *victim) |
1844 | |
1888 | |
1845 | int cf_object_check_trigger (object *op, object *cause) |
1889 | int check_trigger (object *op, object *cause) |
1846 | |
1890 | |
1847 | int cf_object_out_of_map (object *op, int x, int y) |
|
|
1848 | |
|
|
1849 | void cf_object_drop (object *op, object *author) |
1891 | void drop (object *who, object *op) |
1850 | |
1892 | |
1851 | void cf_object_take (object *op, object *author) |
1893 | void pick_up (object *who, object *op) |
1852 | |
1894 | |
1853 | object *cf_object_insert_object (object *op, object *container) |
1895 | object *cf_object_insert_object (object *op, object *container) |
1854 | |
1896 | |
1855 | object *cf_object_insert_in_ob (object *ob, object *where) |
1897 | object *cf_object_insert_in_ob (object *ob, object *where) |
1856 | |
1898 | |
1857 | int cf_object_teleport (object *op, maptile *map, int x, int y) |
1899 | int cf_object_teleport (object *op, maptile *map, int x, int y) |
1858 | |
1900 | |
1859 | void cf_object_update (object *op, int flags) |
1901 | void update (object *op, int action) |
1860 | |
1902 | CODE: |
1861 | void cf_object_pickup (object *op, object *what) |
1903 | update_object (op, action); |
1862 | |
1904 | |
1863 | object *cf_create_object_by_name (const char *name) |
1905 | object *cf_create_object_by_name (const char *name) |
1864 | |
1906 | |
1865 | void change_exp (object *op, uint64 exp, const char *skill_name = 0, int flag = 0) |
1907 | void change_exp (object *op, uint64 exp, const char *skill_name = 0, int flag = 0) |
1866 | |
1908 | |
… | |
… | |
1875 | void use_trigger (object *op); |
1917 | void use_trigger (object *op); |
1876 | |
1918 | |
1877 | void add_button_link (object *button, maptile *map, int connected); |
1919 | void add_button_link (object *button, maptile *map, int connected); |
1878 | |
1920 | |
1879 | void remove_button_link (object *op); |
1921 | void remove_button_link (object *op); |
1880 | |
|
|
1881 | void |
|
|
1882 | cf_object_set_resistance (object *op, int rtype, int val) |
|
|
1883 | CODE: |
|
|
1884 | if (rtype >= 0 && rtype < NROFATTACKS) |
|
|
1885 | op->resist[rtype] = val; |
|
|
1886 | |
1922 | |
1887 | |
1923 | |
1888 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
1924 | MODULE = cf PACKAGE = cf::object PREFIX = cf_ |
1889 | |
1925 | |
1890 | void cf_fix_object (object *pl) |
1926 | void cf_fix_object (object *pl) |
… | |
… | |
2000 | int command_banish (object *op, char *params) |
2036 | int command_banish (object *op, char *params) |
2001 | |
2037 | |
2002 | |
2038 | |
2003 | MODULE = cf PACKAGE = cf::player PREFIX = cf_player_ |
2039 | MODULE = cf PACKAGE = cf::player PREFIX = cf_player_ |
2004 | |
2040 | |
2005 | INCLUDE: $PERL genacc player ../include/newserver.h ../include/player.h | |
2041 | INCLUDE: $PERL genacc player ../include/player.h | |
2006 | |
2042 | |
2007 | char * |
2043 | char * |
2008 | client (player *pl) |
2044 | client (player *pl) |
2009 | CODE: |
2045 | CODE: |
2010 | RETVAL = pl->socket.client; |
2046 | RETVAL = pl->socket->client; |
2011 | OUTPUT: |
2047 | OUTPUT: |
2012 | RETVAL |
2048 | RETVAL |
2013 | |
2049 | |
2014 | char * |
2050 | char * |
2015 | host (player *pl) |
2051 | host (player *pl) |
2016 | CODE: |
2052 | CODE: |
2017 | RETVAL = pl->socket.host; |
2053 | RETVAL = pl->socket->host; |
2018 | OUTPUT: |
2054 | OUTPUT: |
2019 | RETVAL |
2055 | RETVAL |
2020 | |
2056 | |
2021 | int invoke (player *pl, int event, ...) |
2057 | int invoke (player *pl, int event, ...) |
2022 | CODE: |
2058 | CODE: |
… | |
… | |
2025 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
2061 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
2026 | RETVAL = INVOKE_((event_type)event, ARG_PLAYER (pl), ARG_AV (av)); |
2062 | RETVAL = INVOKE_((event_type)event, ARG_PLAYER (pl), ARG_AV (av)); |
2027 | OUTPUT: RETVAL |
2063 | OUTPUT: RETVAL |
2028 | |
2064 | |
2029 | SV *registry (player *pl) |
2065 | SV *registry (player *pl) |
|
|
2066 | |
|
|
2067 | player *cf_player_find (char *name) |
|
|
2068 | PROTOTYPE: $ |
|
|
2069 | |
|
|
2070 | void cf_player_move (player *pl, int dir) |
|
|
2071 | |
|
|
2072 | void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0); |
|
|
2073 | |
|
|
2074 | player *first () |
2030 | CODE: |
2075 | CODE: |
2031 | RETVAL = registry_of (pl); |
2076 | RETVAL = first_player; |
|
|
2077 | OUTPUT: RETVAL |
|
|
2078 | |
|
|
2079 | player *next (player *pl) |
|
|
2080 | CODE: |
|
|
2081 | RETVAL = pl->next; |
|
|
2082 | OUTPUT: RETVAL |
|
|
2083 | |
|
|
2084 | bool |
|
|
2085 | cell_visible (player *pl, int dx, int dy) |
|
|
2086 | CODE: |
|
|
2087 | RETVAL = FABS (dx) <= pl->socket->mapx / 2 && FABS (dy) <= pl->socket->mapy / 2 |
|
|
2088 | && !pl->blocked_los [dx + pl->socket->mapx / 2][dy + pl->socket->mapy / 2]; |
2032 | OUTPUT: |
2089 | OUTPUT: |
2033 | RETVAL |
2090 | RETVAL |
2034 | |
2091 | |
2035 | player *cf_player_find (char *name) |
|
|
2036 | PROTOTYPE: $ |
|
|
2037 | |
|
|
2038 | void cf_player_move (player *pl, int dir) |
|
|
2039 | |
|
|
2040 | void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0); |
|
|
2041 | |
|
|
2042 | player *first () |
|
|
2043 | CODE: |
|
|
2044 | RETVAL = first_player; |
|
|
2045 | OUTPUT: RETVAL |
|
|
2046 | |
|
|
2047 | player *next (player *pl) |
|
|
2048 | CODE: |
|
|
2049 | RETVAL = pl->next; |
|
|
2050 | OUTPUT: RETVAL |
|
|
2051 | |
|
|
2052 | bool |
|
|
2053 | cell_visible (player *pl, int dx, int dy) |
|
|
2054 | CODE: |
|
|
2055 | RETVAL = FABS (dx) <= pl->socket.mapx / 2 && FABS (dy) <= pl->socket.mapy / 2 |
|
|
2056 | && !pl->blocked_los [dx + pl->socket.mapx / 2][dy + pl->socket.mapy / 2]; |
|
|
2057 | OUTPUT: |
|
|
2058 | RETVAL |
|
|
2059 | |
|
|
2060 | void |
2092 | void |
2061 | buggy_mapscroll (player *pl, int value = 1) |
2093 | buggy_mapscroll (player *pl, int value = 1) |
2062 | CODE: |
2094 | CODE: |
2063 | pl->socket.buggy_mapscroll = value; |
2095 | pl->socket->buggy_mapscroll = value; |
2064 | |
2096 | |
2065 | void |
2097 | void |
2066 | send (player *pl, SV *packet) |
2098 | send (player *pl, SV *packet) |
2067 | CODE: |
2099 | CODE: |
2068 | { |
2100 | { |
2069 | STRLEN len; |
2101 | STRLEN len; |
2070 | char *buf = SvPVbyte (packet, len); |
2102 | char *buf = SvPVbyte (packet, len); |
2071 | |
2103 | |
2072 | Write_String_To_Socket (&pl->socket, buf, len); |
2104 | pl->socket->send_packet (buf, len); |
2073 | } |
2105 | } |
2074 | |
2106 | |
2075 | int |
2107 | int |
2076 | listening (player *pl, int new_value = -1) |
2108 | listening (player *pl, int new_value = -1) |
2077 | CODE: |
2109 | CODE: |
… | |
… | |
2142 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
2174 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
2143 | RETVAL = INVOKE_((event_type)event, ARG_MAP (map), ARG_AV (av)); |
2175 | RETVAL = INVOKE_((event_type)event, ARG_MAP (map), ARG_AV (av)); |
2144 | OUTPUT: RETVAL |
2176 | OUTPUT: RETVAL |
2145 | |
2177 | |
2146 | SV *registry (maptile *map) |
2178 | SV *registry (maptile *map) |
2147 | CODE: |
|
|
2148 | RETVAL = registry_of (map); |
|
|
2149 | OUTPUT: |
|
|
2150 | RETVAL |
|
|
2151 | |
2179 | |
2152 | INCLUDE: $PERL genacc maptile ../include/map.h | |
2180 | INCLUDE: $PERL genacc maptile ../include/map.h | |
2153 | |
2181 | |
2154 | maptile *new (int width, int height) |
2182 | maptile *new (int width, int height) |
2155 | PROTOTYPE: |
2183 | PROTOTYPE: |
… | |
… | |
2163 | void delete_map (maptile *map) |
2191 | void delete_map (maptile *map) |
2164 | |
2192 | |
2165 | void clean_tmp_map (maptile *map) |
2193 | void clean_tmp_map (maptile *map) |
2166 | |
2194 | |
2167 | void play_sound_map (maptile *map, int x, int y, int sound_num) |
2195 | void play_sound_map (maptile *map, int x, int y, int sound_num) |
|
|
2196 | |
|
|
2197 | int out_of_map (maptile *map, int x, int y) |
2168 | |
2198 | |
2169 | maptile *tile_map (maptile *map, unsigned int dir) |
2199 | maptile *tile_map (maptile *map, unsigned int dir) |
2170 | CODE: |
2200 | CODE: |
2171 | RETVAL = dir < 4 ? map->tile_map [dir] : 0; |
2201 | RETVAL = dir < 4 ? map->tile_map [dir] : 0; |
2172 | OUTPUT: |
2202 | OUTPUT: |
… | |
… | |
2356 | |
2386 | |
2357 | MODULE = cf PACKAGE = cf::living |
2387 | MODULE = cf PACKAGE = cf::living |
2358 | |
2388 | |
2359 | INCLUDE: $PERL genacc living ../include/living.h | |
2389 | INCLUDE: $PERL genacc living ../include/living.h | |
2360 | |
2390 | |
|
|
2391 | MODULE = cf PACKAGE = cf::settings |
|
|
2392 | |
|
|
2393 | INCLUDE: $PERL genacc Settings ../include/global.h | |
|
|
2394 | |
|
|
2395 | MODULE = cf PACKAGE = cf::client_socket |
|
|
2396 | |
|
|
2397 | INCLUDE: $PERL genacc client_socket ../include/newserver.h | |
|
|
2398 | |
|
|
2399 | int invoke (client_socket *ns, int event, ...) |
|
|
2400 | CODE: |
|
|
2401 | if (KLASS_OF (event) != KLASS_SOCKET) croak ("event class must be SOCKET"); |
|
|
2402 | AV *av = (AV *)sv_2mortal ((SV *)newAV ()); |
|
|
2403 | for (int i = 2; i < items; i++) av_push (av, SvREFCNT_inc (ST (i))); |
|
|
2404 | RETVAL = INVOKE_((event_type)event, ARG_SOCKET (ns), ARG_AV (av)); |
|
|
2405 | OUTPUT: RETVAL |
|
|
2406 | |
|
|
2407 | SV *registry (client_socket *ns) |
|
|
2408 | |