Anope IRC Services

Anope Development => Modules => Topic started by: n00bie on August 15, 2006, 06:16:15 PM

Title: [Module] cs_join.c
Post by: n00bie on August 15, 2006, 06:16:15 PM
Description: This module will make ChanServ JOIN / PART a channel & will automatically set modes +oq ChanServ ChanServ on a channel.

Why?: 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.

Providing commands:
/msg ChanServ JOIN #Channel
/msg ChanServ PART #Channel

Providing IRCD Handler for: KICK

Tested: UnrealIRCd 3.2.5 + Anope-1.7.15 (1128)

Download location: HERE (http://noobie.esmartkid.com/mymods/cs_join.c)
Title:
Post by: Tom65789 on August 15, 2006, 07:16:11 PM
very nice n00bie, just a hint because i know your learning (at a very nice speed to) but try to avoid using strtok, its used in the core and is very bad to use in a module. try using tokens instead, if you need any help catch me on IRC
Title:
Post by: n00bie on August 15, 2006, 08:39:42 PM
Thanks a lot Tom65789, Ok... i'll catch you up on IRC.
Title:
Post by: Gman on August 30, 2006, 07:24:46 PM
have you a compiled win32 version of this module?
I haven't a much internet traffic for download requied software for compile C code :(
Title:
Post by: Tom65789 on August 30, 2006, 08:54:16 PM
lol, would ask n00bie for that one. i think he still might wanna update the code to avoid using strtok
Title:
Post by: Gman on August 31, 2006, 08:59:31 AM
Don't forget about Win32 russia users :)
Title:
Post by: n00bie on August 31, 2006, 01:50:21 PM
o.O i'm glad that you are interested in the module :*
like Tom said i've updated the code and replaced with a token... tested the module on 1.7.13 and above and works fine.

And as for the windows version, i'm currently downloading/upgrading(dial-up :p ) the VC++ 2005 express edition and cannot provide the .dll file for you yet. But i request/ask chaz to compile the mod and i hope that we will have a dll file soon for it ^_^
Title:
Post by: Charles Kingsley on August 31, 2006, 01:51:12 PM
Already done, should be in your inbox.
Title:
Post by: Tom65789 on August 31, 2006, 01:56:45 PM
almost n00bie, just need to fix those mem leaks now :P Tokens use memory and you need to free(); it
Title:
Post by: n00bie on August 31, 2006, 02:24:01 PM
:0 finally here we go ^^
http://noobie.esmartkid.com/mymods/cs_join.c

For windows version: see attachment
Title:
Post by: Gman on September 04, 2006, 03:55:49 PM
Probably attached file?
after clicking on link -and then nothing :D

termiftp@mail.ru
Title:
Post by: heinz on September 04, 2006, 04:12:43 PM
The attached file is there and working fine... What's the problem?
Title:
Post by: Tom65789 on September 04, 2006, 04:47:47 PM
works fine here as well. i dont see whats wrong.
Title:
Post by: Alex on September 04, 2006, 07:54:24 PM
I have a question regarding to the module cs_join.c

After that I installed Anope-1.7.15, the module show the following for some reason: ChanServ@localhost.net which it didn't when I used it on Anope-1.7.14.

Is it anyone that have an idea what this causes, it would be appreciated. (I have checked in my services.conf)

Thanks.
Title:
Post by: n00bie on September 04, 2006, 09:23:47 PM
sorry, i don't understand what you exactly mean here. are you sure that thing(?) shows from the cs_join module ?
Title:
Post by: Alex on September 04, 2006, 09:30:56 PM
Hello n00bie,

Yes, that is what's showing up when it joins a channel,

ChanServ (services@localhost.net) has joined #ChannelName,

but what it was supposed to show should be:

ChanServ (services@network.net) had joined #ChannelName

Thanks.
Title:
Post by: n00bie on September 04, 2006, 09:37:47 PM
oh! i see. That was not a problem with the module. It was a settings from your services.conf itself.

# ServiceUser <usermask>  [REQUIRED]
#     Specifies the user@host mask which should be used by the Services
#     pseudoclients.  May be overridden by the -user and -host command-line
#     options.

ServiceUser "services@localhost.net"

maybe you change your services user name when using Anope1.7.14 to Anope-1.7.15. I guess you know what i mean. If that is not the problem, please tell again, thanks :)
Title:
Post by: Alex on September 04, 2006, 09:49:47 PM
Hello n00bie,

The first thing I checked when I saw this, was to go into my services.conf to see if it was something missed there, and it was.
It was services@localnet.net so I changed this to services@network.net (with my real networkname), saved it and did /os Update and /os Reload, but nothing happened.

I'm not sure what I can have done wrong here, or if I should re-install Anope-1.7.15 again? I did just an upgrade from Anope-1.7.14.

Thanks.
Title:
Post by: n00bie on September 04, 2006, 09:54:09 PM
Ok, so when you upgrade your services from anope-1.7.14 to .15 have you restart your services ? if not, you need to restart and recompile the module(s) you have loaded. My guess is that you forget to restart your services (as you did not mentioned that you did /os restart ) :)
Title:
Post by: Alex on September 04, 2006, 09:58:11 PM
Hello n00bie,

Oh my god I feel dumb now...lol. I had forgot to do /os restart, but did it right now and everything works fine. Thank you so much for your patiente and the great help. It was much appreciated. ;)
Title:
Post by: n00bie on September 04, 2006, 09:59:26 PM
your welcome :)
Title:
Post by: Gman on September 06, 2006, 09:56:32 AM
This is an a good idea to using modules without bad raw and other crash commands
:)
Thank you very much :D
Title:
Post by: PreciousAlly on September 07, 2006, 05:17:19 AM
n00bie, I'm getting this error:

Quote
<OperServ> Unable to load module cs_join


Any suggestions please??
Title:
Post by: n00bie on September 07, 2006, 05:25:17 AM
What exactly is the issue. Are you using windows or unix/linux ? Set your services in debug mode ( /os set debug on ) and try to load the module. Look at the services log files located inside the logs folder and paste what youv'e got there.
Title:
Post by: PreciousAlly on September 08, 2006, 05:23:57 AM
I'm using windows. This is the error in the log file:

Quote
[Sep 08 00:22:12 2006] OperServ: PreciousAlly: set debug on
[Sep 08 00:22:12 2006] Debug mode activated
[Sep 08 00:22:12 2006] debug: Sent: :OperServ NOTICE PreciousAlly :Services are now in debug mode.
[Sep 08 00:22:14 2006] debug: Received: :PreciousAlly PRIVMSG OperServ@services.thesims2source.com :modload cs_join
[Sep 08 00:22:14 2006] OperServ: PreciousAlly: modload cs_join
[Sep 08 00:22:14 2006] Trying to load module [cs_join]
[Sep 08 00:22:14 2006] Runtime module location: .\modules\runtime\cs_join.dll.a05156
[Sep 08 00:22:15 2006] The specified module could not be found.


[Sep 08 00:22:15 2006] debug: Sent: :OperServ NOTICE PreciousAlly :Unable to load module cs_join
[Sep 08 00:22:15 2006] Module loading status: 6
[Sep 08 00:22:18 2006] debug: Received: :PreciousAlly PRIVMSG OperServ@services.thesims2source.com :set debug off
[Sep 08 00:22:18 2006] OperServ: PreciousAlly: set debug off
[Sep 08 00:22:18 2006] Debug mode deactivated
Title:
Post by: Tom65789 on September 08, 2006, 07:46:49 AM
are you sure you are installing them correctly because looking at that you have the same problem with the os_clientjoin [Sep 08 00:22:15 2006] The specified module could not be found.
Title:
Post by: PreciousAlly on September 08, 2006, 05:15:01 PM
I'm doing what everyone tells me to do. I put the .dll in the .\Data\Modules\ folder, and typed:

Quote
/os modload cs_join


There has to be something wrong with the win32 version of the module, I've downloaded and installed other modules before without any problems.



[Edited on 8-9-2006 by PreciousAlly]
Title:
Post by: Tom65789 on September 08, 2006, 07:22:40 PM
what version of anope are you using exactly?
Title:
Post by: PreciousAlly on September 08, 2006, 10:39:33 PM
1.7.14, how do I upgrade? I checked the docs for information on upgrading, but I don't think those docs are for windows. Also, could this be why (lack of current Anope version) I'm getting this problem?
Title:
Post by: PreciousAlly on September 08, 2006, 10:49:49 PM
Nevermind, I needed to upgrade, I just saved the services.conf, and reinstalled 1.7.15..then I loaded cs_join, and it worked.
Title:
Post by: Jan Milants on September 08, 2006, 10:58:24 PM
for windows versions of the modules (.dll's) it has to be compiled for a specific version, if your version is another one then the .dll was made for, then it won't work... and most module writers will - on windows - only support the latest anope...
Title:
Post by: Tom65789 on September 09, 2006, 08:50:33 AM
its the same for the os_clientjoin. you had the same problem i see in the other thread. it should work also
Title:
Post by: wac on January 11, 2008, 12:04:19 PM
your page download isn't working :( *sigh*
Title:
Post by: katsklaw on January 11, 2008, 09:14:21 PM
Quote
Originally posted by wac
your page download isn't working :( *sigh*


most likely because the thread is more than a year old.
Title:
Post by: Jan Milants on January 11, 2008, 10:14:22 PM
maybe you should consider looking on the modules site for an up to date version...


btw, is anyone having issues with this module?
i heard rumours that it can crash under certain conditions.. if anyone would be so friendly as to tell me how to make it crash - if even possible - it would be appreciated.
Title:
Post by: Armadillo on January 25, 2008, 08:11:47 AM
I'm using it since many months on our network and there has never been any incident with this module.
Title:
Post by: GmanServ on February 24, 2008, 03:41:37 PM
eh, for these 1.5 years I learned much more about C++ and anope |:( , and have wrote my first anope module, basis on cs_join module by n00bie.

The module forces ChanServ join a channel when at least 1 user joins, like BotServ bots, but..
It stays forever on a channel, guarding them, before first services restart.
I wrote this module to prevent 'topic cheatings' on my small network: some ugly users joins the channel, and set topic and modes before ChanServ have take op from them.
Module creates a 'text-database' in main Anope directory, and have a /cs set guard on|off|status option.

Is this idea interested for you?