+ CMD_EPERM = 3 /* Command failed because of a permission check */
+};
+
+/** Flag for commands that are only allowed from servers */
+const char FLAG_SERVERONLY = 7; // technically anything nonzero below 'A' works
+
+/** Translation types for translation of parameters to UIDs.
+ * This allows the core commands to not have to be aware of how UIDs
+ * work (making it still possible to write other linking modules which
+ * do not use UID (but why would you want to?)
+ */
+enum TranslateType
+{
+ TR_END, /* End of known parameters, everything after this is TR_TEXT */
+ TR_TEXT, /* Raw text, leave as-is */
+ TR_NICK, /* Nickname, translate to UUID for server->server */
+ TR_CUSTOM /* Custom translation handled by EncodeParameter/DecodeParameter */
+};
+
+/** Routing types for a command. Any command which is created defaults
+ * to having its command broadcasted on success. This behaviour may be
+ * overridden to one of the route types shown below (see the #defines
+ * below for more information on each one's behaviour)
+ */
+enum RouteType
+{
+ ROUTE_TYPE_LOCALONLY,
+ ROUTE_TYPE_BROADCAST,
+ ROUTE_TYPE_UNICAST,
+ ROUTE_TYPE_MESSAGE,
+ ROUTE_TYPE_OPT_BCAST,
+ ROUTE_TYPE_OPT_UCAST
+};
+
+/** Defines routing information for a command, containing a destination
+ * server id (if applicable) and a routing type from the enum above.
+ */
+struct RouteDescriptor
+{
+ /** Routing type from the enum above
+ */
+ RouteType type;
+ /** For unicast, the destination server's name
+ */
+ std::string serverdest;
+
+ /** Create a RouteDescriptor
+ */
+ RouteDescriptor(RouteType t, const std::string &d)
+ : type(t), serverdest(d) { }