Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: cs_recordcount.c: Chanserv Users Record Count  (Read 10509 times)

0 Members and 1 Guest are viewing this topic.

Andrei Rosseti

  • Anope User
  • Offline Offline
  • Posts: 5
cs_recordcount.c: Chanserv Users Record Count
« 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
« Last Edit: April 22, 2009, 03:36:41 PM by Andrei Rosseti »
Logged

Jens Voss

  • Team
  • *
  • Offline Offline
  • Posts: 125
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #1 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]
« Last Edit: April 22, 2009, 03:40:22 PM by Jens Voss »
Logged

Andrei Rosseti

  • Anope User
  • Offline Offline
  • Posts: 5
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #2 on: April 22, 2009, 03:38:39 PM »

Nice! i think that now it's look a bit better! :-P

Thanks Jens Voss!
« Last Edit: April 22, 2009, 03:48:03 PM by Andrei Rosseti »
Logged

Eric Davis

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 9
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #3 on: April 22, 2009, 03:41:07 PM »

What's wrong with /lusers? Heh.
Logged

Andrei Rosseti

  • Anope User
  • Offline Offline
  • Posts: 5
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #4 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.
Logged

Julian

  • Anope User
  • Offline Offline
  • Posts: 9
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #5 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)
Logged

Andrei Rosseti

  • Anope User
  • Offline Offline
  • Posts: 5
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #6 on: April 22, 2009, 05:42:16 PM »

Now it's ok, check it!

:)
Logged

Julian

  • Anope User
  • Offline Offline
  • Posts: 9
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #7 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?
Logged

Andrei Rosseti

  • Anope User
  • Offline Offline
  • Posts: 5
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #8 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!
Logged

Julian

  • Anope User
  • Offline Offline
  • Posts: 9
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #9 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.
Logged

Sascha

  • Anope User
  • Offline Offline
  • Posts: 3
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #10 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.
Logged

Thalles

  • Anope User
  • Offline Offline
  • Posts: 6
Re: cs_recordcount.c: Chanserv Users Record Count
« Reply #11 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.
Logged
Pages: [1]   Go Up