Bez tytułu

z k4be, 3 lata temu, napisane w C, wyświetlone 262 razy.
URL https://pastebin.k4be.pl/view/830ea241 Udostępnij
Pobierz wklejkę lub Pokaż surowy tekst
  1. /* Copyright (C) All Rights Reserved
  2. ** Written by k4be
  3. ** License: GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
  4. */
  5.  
  6. #include "unrealircd.h"
  7.  
  8. char *ct_isupport_param(void);
  9. int tags_rehash_complete(void);
  10.  
  11. extern MODVAR MessageTagHandler *mtaghandlers;
  12. Module *module;
  13.  
  14. ModuleHeader MOD_HEADER = {
  15.         "third/clienttagdeny",
  16.         "5.0",
  17.         "Informs clients about supported client tags",
  18.         "k4be@PIRC",
  19.         "unrealircd-5",
  20. };
  21.  
  22. MOD_INIT(){
  23.         return MOD_SUCCESS;
  24. }
  25.  
  26. MOD_LOAD(){
  27.         module = modinfo->handle;
  28.         ISupportAdd(module, "CLIENTTAGDENY", ct_isupport_param());
  29.         HookAdd(module, HOOKTYPE_REHASH_COMPLETE, 0, tags_rehash_complete);
  30.  
  31.         return MOD_SUCCESS;
  32. }
  33.  
  34. MOD_UNLOAD(){
  35.         return MOD_SUCCESS;
  36. }
  37.  
  38. #define BUFLEN 500
  39.  
  40. char *ct_isupport_param(void){
  41.         static char buf[BUFLEN];
  42.         MessageTagHandler *m;
  43.        
  44.         strcpy(buf, "*");
  45.  
  46.         for (m = mtaghandlers; m; m = m->next) {
  47.                 if(!m->unloaded && m->name[0] == '+'){
  48.                         strncat(buf, ",-", BUFLEN-1);
  49.                         strncat(buf, m->name+1, BUFLEN-1);
  50.                 }
  51.         }
  52.         return buf;
  53. }
  54.  
  55. int tags_rehash_complete(void){
  56.         ISupportSet(module, "CLIENTTAGDENY", ct_isupport_param());
  57.         return HOOK_CONTINUE;
  58. }
  59.  

odpowiedź "Bez tytułu"

Tutaj możesz odpowiedzieć na wklejkę z góry

captcha