Guest Pigeonstriker Posted October 4, 2010 Report Posted October 4, 2010 Here's the current code. The commands don't seem to work, e.g. ?accept does nothing. I added this to the bottom of conf/groupdef.dif/default and did ?reloadconf -f and restarted the server. ; freq management commandsacceptdeclineinvitenoinvitefreqkick http://paste.pocoo.org/show/270801/ Thanks! Quote
Cheese Posted October 4, 2010 Report Posted October 4, 2010 your groupdef policy needs to have "cmd_accept" instead of "accept" if you want to have a pub command, and you would also need "privcmd_accept" if you also wanted to pm it Quote
»Purge Posted October 4, 2010 Report Posted October 4, 2010 Any specific reason you're using Python for this module? Sounds like freq manager would be better in C. Quote
CRe Posted October 4, 2010 Report Posted October 4, 2010 No semi-colons here: ichat = asss.get_interface(asss.I_CHAT); igame = asss.get_interface(asss.I_GAME); Quote
Guest Spidernl Posted October 8, 2010 Report Posted October 8, 2010 Any specific reason you're using Python for this module? Sounds like freq manager would be better in C. I approve of this message. Quote
Guest Pigeonstriker Posted October 9, 2010 Report Posted October 9, 2010 Thanks for the help, I got it working following these tips. The module was requested to be written in Python. Quote
JoWie Posted October 9, 2010 Report Posted October 9, 2010 Just do as much as possible in python. Freq management with asss 1.5.0 is very simple. Quote
JoWie Posted October 9, 2010 Report Posted October 9, 2010 (edited) Just browsed the asss source and freqman is intended to work in pyton but advisers are only half implemented in python. So you indeed have to use C for now. Would go something like this: static int CanChangeFreqAdv(Player *p, int new_freq, char *err_buf, int buf_len) { if (/*allowed to change freq*/) { return 1; } else { if (err_buf) { snprintf(err_buff, buf_len, "You do not own freq %d", new_freq); err_buf[buf_len-1] = 0; // not need for GCC } return 0; } } static Aenforcer enforceradv = { ADVISER_HEAD_INIT(A_ENFORCER) NULL, CanChangeFreqAdv }; EXPORT int MM_mymodule(int action, Imodman *mm_, Arena *arena) { // ... else if (action == MM_ATTACH) { mm->RegAdviser(&enforceradv, arena); return MM_OK; } else if (action == MM_DETACH) { mm->UnregAdviser(&enforceradv, arena); return MM_OK; } } Edited October 9, 2010 by JoWie Quote
deadonarrival Posted December 29, 2010 Report Posted December 29, 2010 Programming is no fun in Python anyway - if there are no pointers to cock up, there's nowhere to waste 10 hours a week hunting that missing dereference. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.