Bez tytułu

z k4be, 3 lata temu, napisane w C, wyświetlone 265 razy.
URL https://pastebin.k4be.pl/view/9a00dff8 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.  
  10. extern MODVAR MessageTagHandler *mtaghandlers;
  11.  
  12. ModuleHeader MOD_HEADER = {
  13.         "third/clienttagdeny",
  14.         "5.0",
  15.         "Informs clients about supported client tags",
  16.         "k4be@PIRC",
  17.         "unrealircd-5",
  18. };
  19.  
  20. MOD_INIT(){
  21.         return MOD_SUCCESS;
  22. }
  23.  
  24. MOD_LOAD(){
  25.         ISupportAdd(modinfo->handle, "CLIENTTAGDENY", ct_isupport_param());
  26.  
  27.         return MOD_SUCCESS;
  28. }
  29.  
  30. MOD_UNLOAD(){
  31.         return MOD_SUCCESS;
  32. }
  33.  
  34. #define BUFLEN 500
  35.  
  36. char *ct_isupport_param(void){
  37.         static char buf[BUFLEN];
  38.         int count = 0;
  39.         MessageTagHandler *m;
  40.        
  41.         strcpy(buf, "*");
  42.  
  43.         for (m = mtaghandlers; m; m = m->next) {
  44.                 if(m->name[0] == '+'){
  45.                         strncat(buf, ",-", BUFLEN-1);
  46.                         strncat(buf, m->name+1, BUFLEN-1);
  47.                         count++;
  48.                 }
  49.         }
  50.         return buf;
  51. }
  52.  

odpowiedź "Bez tytułu"

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

captcha