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!
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 SSC Distension OwnerSSCU Trench Wars Developer3:JabJabJab> sometimes i feel like when im in this mood im like a productive form of CheeseDr Brain> Pretty much everything you said was wrong. Except where you called me a lazy jerk with no time. That was true.3:KrynetiX> do you ever open your web browser and type ?go google5:Ceiu> Wow. My colon decided that was a good time to evacuate itself.
★ 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.
★ 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); -CReSSCC Desert Storm OwnerB.O.P. - Alive and running till the end of continuum. 4:L.C.> @Cre I am wearing.. THIS https://secure.wikimedia.org/wikipedia/en/wiki/Anti-rape_device4:L.C.> Dick untouchable, and my ass will shred your cock http://i44.tinypic.com/kf18ww.png
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.
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.
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.
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
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. - DeadOnArrivalNever interrupt your enemy when he is making a mistake.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now