Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Can we have the sumary of cast a emailed to the admin?

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Andraž 'ruskie' Levstik" <ruskie AT mages.ath.cx>
  • To: <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] Can we have the sumary of cast a emailed to the admin?
  • Date: Fri, 20 Jul 2007 10:46:09 +0200

On 04:39:48 2007-07-20 Andrew Stitt <afrayedknot AT thefrayedknot.armory.com>
wrote:
> On Thu, Jul 19, 2007 at 01:57:33PM -0700, Eric Sandall wrote:
> > Andraž 'ruskie' Levstik wrote:
> > <snip>
> > >> Perhaps rename cast_pass_five to something non-Sorcery hackers
> > >> would understand without looking at the code. :) May want a
> > >> CONFLICTS hook as well.
> > >>
> > > Well one will need to know sorcery internals anyway but I'll take
> > > any suggestions for that...
> > >
> > > maybe cast_final ?
> >
> > cast_final makes much more sense. :)
>
> If you're going to rename the numbered phases you might want to consider
> renaming the others.
>

Am not renaming them... This are simply hook files that corespond to
when they are run. Though personally I agree it should be as similar to
the original part of sorcery as possible.

i.e.

$SORCERY_HOOKS/cast_spell - runs at the sstart of the spell cast
$SORCERY_HOOKS/cast_final - runs at the end of pass five
$SORCERY_HOOKS/libhook includes 3 functions(moved from other parts of
sorcery: sound, set_term_title and mail_report)
and explanation of all hooks
$SORCERY_HOOKS/post_SUCCESS
$SORCERY_HOOKS/

I basically took the sound code and modified it to be a run_hook code
then added calls in relevant parts of the code.

> Also, consider that function names are always somewhat arbitrary :-)
> numbered phases made perfect sense to me, even before I knew anything
> about how cast worked.
>

Amazingly they do to me as well :)

> You might also want to be careful about renaming too many things because
> the existing sorcery hacker's explainations of the code to others might
> need extra translation.

There isn't any internal renaming :) This is just for hooks :)

> I'll probably always think of phase five as
> phase five, not cast_final (which might be interprited as the function
> that would run a spell's FINAL).
>

Well I've made a decision on basing ALL spell files on the folowing rule:

pre_SPELL_FILE
post_SPELL_FILE

So FINAL would be pre_FINAL and post_FINAL

Any other hooks are lo-case only with the exception of:
pre/post_SUCCESS/FAILURE

> Of course, thats all for the new SL to decide. Since Im not running for
> another term. To clarify that, although I wont be re-running, I'll stay
> present within the community and am happy to be a resource for
> explaining sorcery internals. At least until I forget it all.
>

Greatly appreciated


And for those that want to give this a test I've made a tarball and is
available at:

http://ruskie.dtdm.net/caches/sorcery-devel-hooks.tar.bz2

A quick explanation:

sorcery -> options -> feature menu -> HOOK on

Place hook files into:
/var/lib/sorcery/hooks/

There are some samples in already(mail,cleartext(used for debuging) and
xterm_title, sound) but they need to be copied over as anything in hooks
can be changed/added.

I'll be keeping these 4 sample hooks in sorcery and then provide a
smgl-hooks spell that will implement others. This way it will be
possible to have others installed without needing to touch any of these :)

Hook files must be +x else they are not run... You are free to source and
slaughter and do anything you can think off with them. The existing:
mail, set_term_title and sound hooks still rely on the rest of the sorcery
variables to function i.e. MAIL_REPORTS, SET_TERM_TITLE and SOUND themes.

This is so to not break any backwards compatibility.

All hooks are listed in /var/lib/sorcery/hooks/libhook comments and cleartext
implements them all as well.

Comments/Suggestions/Flames and so forth...

--
Andraž "ruskie" Levstik
Source Mage GNU/Linux Games grimoire guru
Geek/Hacker/Tinker

Hacker FAQ: http://www.plethora.net/%7eseebs/faqs/hacker.html
Be sure brain is in gear before engaging mouth.

Key id = F4C1F89C
Key fingerprint = 6FF2 8F20 4C9D DB36 B5B6 F134 884D 72CC F4C1 F89C





Archive powered by MHonArc 2.6.24.

Top of Page