(pregunta)como se compila esto?

Moderadores: Kravenbcn, largeroliker, fidelcastro, cerealkiller, pspCaracas, m0skit0, LnD, ka69, zacky06

Avatar de Usuario
dark_sasuke
Moderador Global
Moderador Global
Mensajes: 3379
Registrado: 03 Sep 2009, 02:13
Twitter: D4rkyt0

(pregunta)como se compila esto?

Mensaje por dark_sasuke »

Esto es un modulo de los bots de servicio de un IRC, pero no se como compilarlo, se que al final queda el archivo .so asi que queda compilado para linux, pero no se como se compila, si como hemos aprendido o como :s , ademas que es la unica forma que lo encuentro, porque compilado no lo encuentro :/

Spoiler:

Código: Seleccionar todo

#include "module.h"

#define AUTHOR "n00bie"

#define VERSION "$Id: cs_join.c v2.0.0 09-09-2007 n00bie $"



/*

************************************************************************************************

** Module   : cs_join.c

** Version   : 2.0.0

** Author   : n00bie (n00bie@rediffmail.com)

** Release   : 11th August, 2006

** Update   : 09th September, 2007

************************************************************************************************

** <Description>

**      This module will make ChanServ JOIN / PART a channel & will automatically

**      set correct modes for itself.

**

**      This module is designed for ppl who wanted to have @ChanServ sits on their

**      channel along with a BotServ @Bots; and without the need of using ugly RAW commands for

**      making ChanServ join a channel.

**

**      It is recommended not to use this module with cs_fantasy.c or

**      cs_inhabitregistered.c loaded as those modules already does the job ;)

**

**      Also, when using this module i'd like to suggest the SYMBIOSIS mode turned off

**      (if there is a bot assigned on a channel). See /BotServ HELP SET SYMBIOSIS for reasons.

** </Description>

**

** NOTE: Only channel founder and services admin can use this command.

************************************************************************************************

** Tested: 1.7.19, Unreal3.2.7

**

** Providing Command:

**

** /msg ChanServ HELP JOIN|PART

** /msg ChanServ JOIN #channel

** /msg ChanServ PART #channel

**

************************************************************************************************

** This program is free software; you can redistribute it and/or modify it under the

** terms of the GNU General Public License as published by the Free Software

** Foundation; either version 1, or (at your option) any later version.

**

** This program is distributed in the hope that it will be useful, but WITHOUT ANY

** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS for

** a PARTICULAR PURPOSE. THIS MODULE IS DISTRIBUTED 'AS IS'. NO WARRANTY OF ANY

** KIND IS EXPRESSED OR IMPLIED. YOU USE AT YOUR OWN RISK. THE MODULE AUTHOR WILL

** NOT BE RESPONSIBLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF

** LOSS WHILE USING OR MISUSING THIS MODULE.

**

** See the GNU General Public License for more details.

************************************************************************************************

** Changelog:

**

** v1.0.0 - First public release

**

** v1.0.2 - 1) Removed strtok();

**          2) Fixed mem leak

**

** v1.0.3 - Changed mode +oq/+oa/+o to correct modes depending on the IRCd

**

** v2.0.0 - 1) Cleaned up minor codes

**          2) Added check for EVENT_PART_CHANNEL to prevent from an invite bug :o

**          3) Added and will now respect 'BSMinUsers' directives from services.conf ;)

**          4) Added command support for Services Admin (suggested by Katsklaw) ^^

**

** Still on the TODO - CS_JOIN_ALREADY :">

************************************************************************************************

** This module have no configurable option.

*/



int do_cs_join(User *u);

int do_cs_part(User *u);

int do_cs_help_join(User *u);

int do_cs_help_part(User *u);

int do_kick_rejoin(char *source, int ac, char **av);

int do_cs_check(int ac, char **av);

void myChanServHelp(User *u);

int AnopeInit(int argc, char **argv)

{

   EvtHook *hook = NULL;

   Message *msg = NULL;

   Command *c;

   int status = 0;

   c = createCommand("JOIN", do_cs_join, NULL, -1, -1, -1, -1, -1);

   moduleAddHelp(c, do_cs_help_join);

   moduleSetChanHelp(myChanServHelp);

   status = moduleAddCommand(CHANSERV, c, MOD_TAIL);

   if (status == MOD_ERR_OK) {

      alog("%s: cs_join: Added command 'JOIN", s_ChanServ);

   } else {

      return MOD_STOP;

   }

   c = createCommand("PART", do_cs_part, NULL, -1, -1, -1, -1, -1);

   moduleAddHelp(c, do_cs_help_part);

   status = moduleAddCommand(CHANSERV, c, MOD_TAIL);

   if (status == MOD_ERR_OK) {

      alog("%s: cs_join: Added command 'PART'", s_ChanServ);

   } else {

      return MOD_STOP;

   }

   hook = createEventHook(EVENT_PART_CHANNEL, do_cs_check);

    status = moduleAddEventHook(hook);

   if (status == MOD_ERR_OK) {

      alog("%s: cs_join: Successfully hooked to EVENT_PART_CHANNEL", s_ChanServ);

   } else {

      alog("%s: cs_join: Unable to bind to EVENT_PART_CHANNEL", s_ChanServ);

        return MOD_STOP;

    }

   msg = createMessage("KICK", do_kick_rejoin);

   status = moduleAddMessage(msg, MOD_TAIL);

   alog("%s: cs_join: Module loaded and active.", s_ChanServ);

   moduleAddAuthor(AUTHOR);

   moduleAddVersion(VERSION);

   return MOD_CONT;

}



int do_cs_join(User *u)

{

   ChannelInfo *ci;

   char *buf = moduleGetLastBuffer();

   char *chan = myStrGetToken(buf, ' ', 0);

   if (!chan) {

      notice(s_ChanServ, u->nick, "You did not specify a channel to join.");

      notice(s_ChanServ, u->nick, "Syntax: \2JOIN\2 \037#CHANNEL\037");

   } else if (!(ci = cs_findchan(chan))) {

      notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);

   } else if (!nick_identified(u)) {

      notice_lang(s_ChanServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);

   } else if ((ci->flags & CI_VERBOTEN) || (ci->flags & CI_SUSPENDED)) {

      notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);

   } else if ((!is_founder(u, ci) && !is_services_admin(u))) {

      notice_lang(s_ChanServ, u, PERMISSION_DENIED);

      if (LogChannel) {

         alog("%s: access denied for \2%s\2 with command JOIN %s", s_ChanServ, u->nick, chan);

      }

   } else if (ci->c && ci->c->usercount < BSMinUsers) {

      notice_user(s_ChanServ, u, "Can join only when there are %d user(s) in %s.", BSMinUsers, chan);

   } else {

      anope_cmd_join(s_ChanServ, chan, time(NULL));

      anope_cmd_bot_chan_mode(s_ChanServ, ci->name);

   }

   if (chan)

      free(chan);

   return MOD_CONT;

}



int do_cs_part(User *u)

{

   ChannelInfo *ci;

   char *buf = moduleGetLastBuffer();

   char *chan = myStrGetToken(buf, ' ', 0);

   if (!chan) {

      notice(s_ChanServ, u->nick, "Syntax: \2PART\2 \037#CHANNEL\037");

   } else if (!(ci = cs_findchan(chan))) {

      notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);

   } else if (!nick_identified(u)) {

      notice_lang(s_ChanServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);

   } else if ((!is_founder(u, ci) && !is_services_admin(u))) {

      notice_lang(s_ChanServ, u, PERMISSION_DENIED);

      if (LogChannel) {

         alog("%s: access denied for \2%s\2 with command PART %s", s_ChanServ, u->nick, chan);

      }

   } else {

      anope_cmd_part(s_ChanServ, chan, "PART command from %s", u->nick);

   }

   if (chan)

      free(chan);

   return MOD_CONT;

}



int do_kick_rejoin(char *source, int ac, char **av)

{

   if ((!(stricmp(av[1], s_ChanServ) == 0))) {

      return MOD_CONT;

   }

   if (LogChannel) {

      alog("%s got kicked from '%s' by %s (Auto re-joining)", s_ChanServ, av[0], source);

   }

   anope_cmd_join(s_ChanServ, av[0], time(NULL));

   anope_cmd_bot_chan_mode(s_ChanServ, av[0]);

   return MOD_CONT;

}



int do_cs_check(int ac, char **av)

{

   ChannelInfo *ci;

   if (ac < 5) {

      if (stricmp(av[0], EVENT_STOP)) {

         if ((ci = cs_findchan(av[2]))) {

            if (ci->c && ci->c->usercount <= BSMinUsers) {

               anope_cmd_part(s_ChanServ, ci->name, NULL);

            }

         }

      }

   }

   return MOD_CONT;

}



int do_cs_help_join(User *u)

{

   notice(s_ChanServ, u->nick, "Syntax: \2JOIN\2 \037#Channel\037");

   notice(s_ChanServ, u->nick, " ");

   notice(s_ChanServ, u->nick, "This command will make \2%s\2 join the channel you specified.", s_ChanServ);

   notice(s_ChanServ, u->nick, "Note that when %s joins the channel, it will automatically Opped", s_ChanServ);

   notice(s_ChanServ, u->nick, "itselves on the channel and will remain on the channel untill parted");

   notice(s_ChanServ, u->nick, "using the \2PART\2 command or will part the channel when there are");

   notice(s_ChanServ, u->nick, "less than \2%d\2 user(s) on the channel.", BSMinUsers);

   notice(s_ChanServ, u->nick, " ");

   notice(s_ChanServ, u->nick, "\2NOTE\2: Command is limited to Channel Founder.", s_ChanServ);

   return MOD_CONT;

}



int do_cs_help_part(User *u)

{

   notice(s_ChanServ, u->nick, "Syntax: \2PART\2 \037#Channel\037");

   notice(s_ChanServ, u->nick, " ");

   notice(s_ChanServ, u->nick, "This command will make \2%s\2 part the channel you specified.", s_ChanServ);

   return MOD_CONT;

}



void myChanServHelp(User *u)

{

   notice(s_ChanServ, u->nick, "    JOIN       Makes %s join a channel", s_ChanServ);

   notice(s_ChanServ, u->nick, "    PART       Makes %s part a channel", s_ChanServ);

}



void AnopeFini(void)

{

   alog("%s: cs_join: module unloaded.", s_ChanServ);

}



/* EOF */


Imagen

Avatar de Usuario
m0skit0
Administrador
Administrador
Mensajes: 5585
Registrado: 03 Sep 2009, 09:35
Ubicación: 0xdeadbeef

Re: (pregunta)como se compila esto?

Mensaje por m0skit0 »

¿No trae ninguna instrucción de instalación?
Imagen

Avatar de Usuario
dark_sasuke
Moderador Global
Moderador Global
Mensajes: 3379
Registrado: 03 Sep 2009, 02:13
Twitter: D4rkyt0

Re: (pregunta)como se compila esto?

Mensaje por dark_sasuke »

No, profe seria lo primero que hubiera leido XD , solo viene el codigo :/
Imagen

arisma
Habitual
Habitual
Mensajes: 497
Registrado: 18 Sep 2009, 08:41

Re: (pregunta)como se compila esto?

Mensaje por arisma »

El problema es que el autor ya no da soporte al modulo, que está relacionado con anope.

Ni siquiera con el module.h(que incluye otros archivos de cabecera) compila, da errores de constantes no declaradas.

Aunque las declares sigue dando error en services.h

Total poco que hacer, quizás encontrando los archivos antiguos de module.h y los relacionados.

Avatar de Usuario
dark_sasuke
Moderador Global
Moderador Global
Mensajes: 3379
Registrado: 03 Sep 2009, 02:13
Twitter: D4rkyt0

Re: (pregunta)como se compila esto?

Mensaje por dark_sasuke »

Si señor arisma, es el modulo cs_join del anope, pues es que no he encontrado otro modulo que haga la misma tarea :/ :(
Imagen

Avatar de Usuario
driKton
Moderador
Moderador
Mensajes: 1099
Registrado: 04 Sep 2009, 14:30
PSN ID: DarkCarlx10
Steam ID: drikton
Twitter: driKton
Ubicación: Santa Cruz de Tenerife
Contactar:

Re: (pregunta)como se compila esto?

Mensaje por driKton »

2. cd anope-1.7.17 (o el nombre que le hayas puesto)
3. cd src/modules
4. wget url del modulo
5. ahora ve a la carpeta principal del anope
7. make modules
8. make install
9. go to IRC and type /operserv modload modulename

A ver si funciona.. xD
Imagen

Avatar de Usuario
pspCaracas
Moderador Global
Moderador Global
Mensajes: 3080
Registrado: 03 Sep 2009, 03:29
Ubicación: Buenos Aire - Argentina
Contactar:

Re: (pregunta)como se compila esto?

Mensaje por pspCaracas »

Ummm...pero si hay varios clientes de IRC para Linux, y más específicamente para Debian como paquetes binarios listos para instalar y usar...incluso hasta puedes integrar toda la mensajería con Pidgin o Empathy...¿Por qué te antojas de ese en particular?
http://farm3.static.flickr.com/2497/3983880148_f5ae0aaab2_o.png

Avatar de Usuario
dark_sasuke
Moderador Global
Moderador Global
Mensajes: 3379
Registrado: 03 Sep 2009, 02:13
Twitter: D4rkyt0

Re: (pregunta)como se compila esto?

Mensaje por dark_sasuke »

No entiendo muy bien lo que dice pspCaracas si me explicaras un poco mejor :D, y lo que yo tengo no es un cliente IRC es un Demonio IRC es con el que se montan el IRC y el modulo que busco es para el Anope que son los bots de servicio (chanserv, operserv, botserv, memoserv ...etc), para cliente IRC ya tengo X-chat :D
Imagen

Avatar de Usuario
pspCaracas
Moderador Global
Moderador Global
Mensajes: 3080
Registrado: 03 Sep 2009, 03:29
Ubicación: Buenos Aire - Argentina
Contactar:

Re: (pregunta)como se compila esto?

Mensaje por pspCaracas »

Ok, no he dicho nada... :?
http://farm3.static.flickr.com/2497/3983880148_f5ae0aaab2_o.png

Avatar de Usuario
dark_sasuke
Moderador Global
Moderador Global
Mensajes: 3379
Registrado: 03 Sep 2009, 02:13
Twitter: D4rkyt0

Re: (pregunta)como se compila esto?

Mensaje por dark_sasuke »

Jejejejeje :D

A ver si algun alma caricativa conoce un modulo para meter a OperServ o a ChanServ a un canal por si quedan vacios no desaparezcan de la /list, he consegido el modulo de OperServ pero no se si tenga el mismo problema ademas que no lo se compilar :(

Codigo del de OperServ

Pongo el link porque no cabe en el post :o :roll:

Saludos !!!!
Imagen

Responder