Bez tytułu

z k4be, 5 lata temu, napisane w C, wyświetlone 345 razy.
URL https://pastebin.k4be.pl/view/6f0f3979 Udostępnij
Pobierz wklejkę lub Pokaż surowy tekst
  1. #include "unrealircd.h"
  2.  
  3. #define OVR_WEBIRC "WEBIRC"
  4. #define OVR_JOIN "JOIN"
  5.  
  6. static int showwebirc_overridewebirc(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, char *parv[]);
  7.  
  8. static ModuleInfo *showwebircMI = NULL;
  9. Cmdoverride *showwebircOVRWebirc;
  10.  
  11. ModuleHeader MOD_HEADER(m_showwebirc) = {
  12.         "m_showwebirc",
  13.         "$Id: v0.01 2018/12/14 k4be$",
  14.         "Add Y usermode for WEBIRC users",
  15.         "3.2-b8-1",
  16.         NULL
  17. };
  18.  
  19. long showwebirc_umode;
  20.  
  21. MOD_INIT(m_showwebirc) {
  22.         showwebircMI = modinfo;
  23.         if(!UmodeAdd(modinfo->handle, 'Y', UMODE_GLOBAL, 0, umode_allow_none, &showwebirc_umode)) return MOD_FAILED;
  24.         return MOD_SUCCESS;
  25. }
  26.  
  27. MOD_LOAD(m_showwebirc) {
  28.         showwebircOVRWebirc = CmdoverrideAdd(showwebircMI->handle, OVR_WEBIRC, showwebirc_overridewebirc);
  29.  
  30.         if(ModuleGetError(showwebircMI->handle) != MODERR_NOERROR || !showwebircOVRWebirc) {
  31.                 return MOD_FAILED;
  32.         }
  33.         return MOD_SUCCESS;
  34. }
  35.  
  36. MOD_UNLOAD(m_showwebirc) {
  37.         return MOD_SUCCESS;
  38. }
  39.  
  40. static int showwebirc_overridewebirc(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, char *parv[]) {
  41.         /* Gets args: Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, char *parv[]
  42.         **
  43.         ** ovr: Pointer to the override we're attached to
  44.         ** cptr: Pointer to directly attached client -- if remote user this is the remote server instead
  45.         ** sptr: Pointer to user executing command
  46.         ** parc: Amount of arguments (also includes the command in the count)
  47.         ** parv: Contains the actual args, first one starts at parv[1]
  48.         **
  49.         */
  50.  
  51.         long old = sptr->umodes;
  52.        
  53.         sptr->umodes |= showwebirc_umode;
  54.         send_umode_out(sptr, sptr, old);
  55.         return CallCmdoverride(ovr, cptr, sptr, parc, parv);
  56. }
  57.  

odpowiedź "Bez tytułu"

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

captcha