modified modcmd to give the possibility for dynamic access (modcmd)
[NeonServV5.git] / modcmd.h
index 932fc1062873cf772334ce115d29b31b3f9e3d44..2afdfe43f20d3f26f33fb6f906a733e7a80d7186 100644 (file)
--- a/modcmd.h
+++ b/modcmd.h
@@ -6,8 +6,9 @@
 #define CMDFLAG_REQUIRE_AUTH 0x02
 #define CMDFLAG_REQUIRE_GOD  0x04
 #define CMDFLAG_CHECK_AUTH   0x08
-#define CMDFLAG_OVERRIDE_ACCESS 0x10
-#define CMDFLAG_REGISTERED_CHAN 0x20
+#define CMDFLAG_REGISTERED_CHAN 0x10
+#define CMDFLAG_OVERRIDE_GLOBAL_ACCESS 0x20
+#define CMDFLAG_OVERRIDE_CHANNEL_ACCESS 0x40
 
 struct ClientSocket;
 struct UserNode;
@@ -23,6 +24,8 @@ struct cmd_function {
     cmd_bind_t *func;
     unsigned int flags;
     int paramcount;
+    int global_access;
+    char *channel_access;
     
     struct cmd_function *next;
 };
@@ -33,7 +36,8 @@ struct cmd_binding {
     struct cmd_function *func;
     unsigned int flags;
     char *parameters;
-    int gaccess;
+    int global_access;
+    char *channel_access;
     
     struct cmd_binding *next;
 };
@@ -48,7 +52,7 @@ struct trigger_cache {
 void init_modcmd();
 void free_modcmd();
 struct ClientSocket* get_prefered_bot(int botid);
-int register_command(int botid, char *name, cmd_bind_t *func, int paramcount, unsigned int flags);
+int register_command(int botid, char *name, cmd_bind_t *func, int paramcount, unsigned int flags, char *channel_access, int global_access);
 int set_trigger_callback(int botid, trigger_callback_t *func);
 int changeChannelTrigger(int botid, struct ChanNode *chan, char *new_trigger);
 int bind_cmd_to_function(int botid, char *cmd, struct cmd_function *func);
@@ -56,6 +60,7 @@ int bind_cmd_to_command(int botid, char *cmd, char *func);
 int unbind_cmd(int botid, char *cmd);
 struct ClientSocket *getTextBot();
 void bind_set_parameters(int botid, char *cmd, char *parameters);
-void bind_set_gaccess(int botid, char *cmd, int gaccess);
+void bind_set_global_access(int botid, char *cmd, int gaccess);
+void bind_set_channel_access(int botid, char *cmd, char *chanaccess);
 
 #endif
\ No newline at end of file