diff --git a/world/net/include/place.gen b/world/net/include/place.gen index d03b00d..0d7922c 100644 --- a/world/net/include/place.gen +++ b/world/net/include/place.gen @@ -146,18 +146,23 @@ inherit NET_PATH "place/mailcast"; # ifdef PUBLIC inherit NET_PATH "place/public"; # else - // special case in the archetype options logic, see also psyconf -# ifndef PLACE_HISTORY -# ifdef PLACE_HISTORY_EXPORT -# define PLACE_HISTORY +# ifdef ON_UNKNOWN +// special place type that supports unknownmsg() +inherit NET_PATH "place/intercept"; +# else + // special case in the archetype options logic, see also psyconf +# ifndef PLACE_HISTORY +# ifdef PLACE_HISTORY_EXPORT +# define PLACE_HISTORY +# endif +# endif +# include "place.i" // archetype model generator code 2007 +# ifdef PLACE_HISTORY +# define HISTORY // compatibility +# endif +# ifdef PLACE_OWNED +# define OWNED PLACE_OWNED // compatibility # endif -# endif -# include "place.i" // archetype model generator code 2007 -# ifdef PLACE_HISTORY -# define HISTORY // compatibility -# endif -# ifdef PLACE_OWNED -# define OWNED PLACE_OWNED // compatibility # endif # endif # endif @@ -583,6 +588,14 @@ msg(source, mc, data, vars) { } #endif +// this hook only works in archetypes that support it +#ifdef ON_UNKNOWN +unknownmsg(source, mc, data, vars) { + ON_UNKNOWN + ::unknownmsg(source, mc, data, vars); +} +#endif + #ifdef ON_ENTER onEnter(source, mc, data, vars) { ON_ENTER diff --git a/world/net/place/archetype.gen b/world/net/place/archetype.gen index ecc05b8..e064383 100644 --- a/world/net/place/archetype.gen +++ b/world/net/place/archetype.gen @@ -38,6 +38,7 @@ # define PLACE_TOPIC // [+] provide a topic function # define PLACE_TOPIC_COMMAND // [+] provide a /topic command //# define PLACE_TOPIC_FOR_ALL // allow anybody to set the topic +//# define PLACE_UNKNOWN_HOOK // provide a handler for ON_UNKNOWN #endif // things that every archetype auto-model gets. @@ -1448,8 +1449,13 @@ msg(source, mc, data, mapping vars) { if (mc == "_message_private") mc = "_message_public"; // vorsicht mit _message_public_question und _message_video } +#ifdef PLACE_UNKNOWN_HOOK + unknownmsg(source, mc, data, vars); +} +unknownmsg(source, mc, data, vars) { +#endif /* if the source is not a member of the room and was allowed - * because of qAllowExternal* we probably should use the rooms + * because of qAllowExternal* we probably should use the room's * psycName instead of the source * yes, I admit it, afaik this only fixes bugs in net/jabber! */ diff --git a/world/net/place/intercept.c b/world/net/place/intercept.c new file mode 100644 index 0000000..8f1f5be --- /dev/null +++ b/world/net/place/intercept.c @@ -0,0 +1,11 @@ +// special archetype that supports ON_UNKNOWN +#define PLACE_UNKNOWN_HOOK + +#define ESSENTIALS +#define PLACE_HISTORY +//#define PLACE_HISTORY_EXPORT +//#define PLACE_SCRATCHPAD +//#define PLACE_MASQUERADE +//#define PLACE_OWNED + +#include "archetype.gen"