X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fctables.h;h=2a0ce834ba6132fb655df9eafe5a62fab24059ab;hb=484b718ccf1505360d62401dd09e3eca6b2568d8;hp=d9f660f7145f5a652da3a51669a857a6fb79f89c;hpb=71eb82a9807d96139ef56c5a5be7653507e89aa9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/ctables.h b/include/ctables.h index d9f660f71..2a0ce834b 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -29,7 +29,8 @@ enum TranslateType TR_TEXT, /* Raw text, leave as-is */ TR_NICK, /* Nickname, translate to UUID for server->server */ TR_NICKLIST, /* Comma seperated nickname list, translate to UUIDs */ - TR_SPACENICKLIST /* Space seperated nickname list, translate to UUIDs */ + TR_SPACENICKLIST, /* Space seperated nickname list, translate to UUIDs */ + TR_CUSTOM /* Custom translation handled by EncodeParameter/DecodeParameter */ }; /** For commands which should not be replicated to other @@ -139,6 +140,25 @@ class CoreExport Command : public Extensible return CMD_INVALID; } + /** Encode a parameter for server->server transmission. + * Used for parameters for which the translation type is TR_CUSTOM. + * @param parameter The parameter to encode. Can be modified in place. + * @param index The parameter index (0 == first parameter). + */ + virtual void EncodeParameter(std::string& parameter, int index) + { + } + + /** Decode a parameter from server->server transmission. + * Not currently used in this version of InspIRCd. + * Used for parameters for which the translation type is TR_CUSTOM. + * @param parameter The parameter to decode. Can be modified in place. + * @param index The parameter index (0 == first parameter). + */ + virtual void DecodeParameter(std::string& parameter, int index) + { + } + /** Disable or enable this command. * @param setting True to disable the command. */ @@ -173,7 +193,7 @@ class CoreExport Command : public Extensible /** A hash of commands used by the core */ -typedef nspace::hash_map Commandable; +typedef nspace::hash_map Commandtable; #define TRANSLATE1(x1) translation.push_back(x1); #define TRANSLATE2(x1,x2) translation.push_back(x1);translation.push_back(x2);