Anope IRC Services

Anope Development => Modules => Topic started by: Andrei Rosseti on April 22, 2009, 03:09:01 PM

Title: cs_recordcount.c: Chanserv Users Record Count
Post by: Andrei Rosseti on April 22, 2009, 03:09:01 PM
In january of this year I started developing a short module for the Anope IRC Services. It provides a simple users record counter for chanserv service network.

You can download the source by the URL http://www.unsignal.com/dev/brasirc/cs_recordcount.c
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Jens Voss on April 22, 2009, 03:22:20 PM
Nice module. :-)
Can you upload it to the modules site? ( http://modules.anope.org/ )


You have a memory leak in do_record_info():
myStrGetToken returns a pointer to allocated memory. You have to free() chan und param before the return.

[edit]
this looks a bit better, but its not ok. What happens if do_record_info is called with no params? trying to free() a NULL pointer is not good.
try:  "if (chan) free(chan);" :-)
[/edit]
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Andrei Rosseti on April 22, 2009, 03:38:39 PM
Nice! i think that now it's look a bit better! :-P

Thanks Jens Voss!
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Eric Davis on April 22, 2009, 03:41:07 PM
What's wrong with /lusers? Heh.
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Andrei Rosseti on April 22, 2009, 03:54:21 PM
Well, the command /lusers don't retain the information for a long time stored in your hard disk.

IRCd has a volatile information, try to put your ircd process down to look better.

I write it only for hobby.

Tks.
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Julian on April 22, 2009, 05:15:38 PM
Spot the mistake...

Quote
[17:13] <&Global> OperServ: Jue: modload cs_recordcount
[17:13] <&Global> Trying to load module [cs_recordcount]
[17:13] <&Global> cs_recordcount: success: Unable to open the database.
[17:13] <&Global> cs_recordcount loaded
[17:13] <&Global> Module loading status: 0 (Module, Okay - No Error)
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Andrei Rosseti on April 22, 2009, 05:42:16 PM
Now it's ok, check it!

:)
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Julian on April 22, 2009, 05:58:15 PM
This is all good and everything, but how do I see the information the database is holding? Is there some sort of command?...Maybe something to make this module big like NeoStats StatServ...

Make it so it announces the max number of people who joined a specific channel and announce it in the services channel?
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Andrei Rosseti on April 22, 2009, 06:04:47 PM
Julian, you can view the information stored in your databases putting this command: [ /chanserv info channel all ]

Look, when your network is smaller, no have problem to announce in a specific channel the records, but if you have a biggest network, it generate much and fast information, and you can't read like.

Thanks for your comments!
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Julian on April 22, 2009, 06:13:42 PM
Well my network is a small network...

Plus implimenting something like NeoStats onto an Anope module makes life easier... Mean's people can get rid of NeoStats.
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Sascha on August 30, 2010, 02:24:44 AM
Error on Inspircd 1.2 and Anope 1.8.4

{2010-08-30}-{00:03:45} <matrix.german-irc.net> GLOBOPS: From OperServ: WARNING! Backup of cs_recordcount.db failed.
Title: Re: cs_recordcount.c: Chanserv Users Record Count
Post by: Thalles on October 16, 2010, 11:36:26 PM
 used this module and I'm also with this same problem What can it be done.

From OperServ: WARNING! Backup of cs_recordcount.db failed.