This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Channel stats and MySQL

Old posts that have not been replied to for several years.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

If you add in a matchstrength field it's even better.

table hostmasks:
hostmask as varchar
matchstrength as integer

matchstrength is the number of non-wild chars in the mask.

select hostmask from hostmasks where hostmask like '%blah.com' order by matchstrength desc

now the first result is the one you use

note that this will still not be very efficient -- the overhead of creating the sql call, transferring it, interpreting it, converting sql into something to execute -- will take ages longer than just searching through a local copy.

In fact, unless you plan on rewriting all portions of code that deal with users, this is unnecessary. Eggdrop passes around a structure, struct user, will all of the user information in it. It stores pointers to them in several places such as channel records. So essentially, all of the data in the database (including hostmasks) will also be loaded into memory by eggdrop. Therefore the most sensical thing to do is to have the database simply store the data and not worry about efficienty, since eggdrop wants to load all the data into memory in the beginning anyway. The database will basically be a fancy storage file.
T
TLM
Voice
Posts: 11
Joined: Thu Apr 10, 2003 7:35 pm
Location: Asheville, NC, USA
Contact:

Post by TLM »

Your site link to me pelefanten is down, sounds like a interesting project.
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

Sorry about that. The person who hosted it moved. Its up again. And I'd be more than happy if anyone would like to share some design thoughts (I'm thinking about rewriting the whole module anyway), bugrepors are welcome too ;P
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

I have re-writen the whole module now, and it's now using a diffrent table setup. This way there should be _alot_ more dynamic multi channel support. Nevertheless, it now has it's own userfile.

I'd be happy if anyone could try compiling, running on their systems since I only have one to test on. So, as far as I know its bug-free. But I guess thats not the truth.

I would also like sugestions on feutures not yet implemented.

http://www.cau.se/dev/mystats/
Last edited by pelefanten on Wed Aug 27, 2003 10:22 am, edited 1 time in total.
Q
Quadro

Post by Quadro »

Hmm this is just for linux?
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

So far its only been tested on linux and I've never had the opertunity to compile it using cygwin, which would be my guess on how to compile an eggdrop in windows. Besides, you need the mysql header and library files to be able to compile this module.

Like i said, never been done before (atleast as far as i know).
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

pelefanten wrote:So far its only been tested on linux and I've never had the opertunity to compile it using cygwin, which would be my guess on how to compile an eggdrop in windows. Besides, you need the mysql header and library files to be able to compile this module.

Like i said, never been done before (atleast as far as i know).
I just got MySQL and windrop running this week. I was a bit of a pain in the ass, but it works. I'm doing this with fastbase sql (manual will be shortly online). So windows (windrop) and MySQL and you're module should also work.

Don't know about the compiling part but it should be possible. I'm going to try this in the near future. I'm working on a dual boot linux and windows 2000 zo i can compile my own windrop. I had in mind the same as you're doing right now, making modules talk to MySQL.

So when my setup is compleet and i've made my first windrop, i would like to port you're module to windrop to. Else i would write it myself
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

Awesome, if it works that would be slick.

Latest version 1.58 is considered stable. But if you have any probs dont hesitate to message me.
http://www.cau.se/dev/mystats/mystats-1.58.tar.gz
T
TLM
Voice
Posts: 11
Joined: Thu Apr 10, 2003 7:35 pm
Location: Asheville, NC, USA
Contact:

Post by TLM »

Interesting project, but servers down so I cant test it before I go to work.
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

What this project lack tho, is a webbased interface for viewing the stats. I have one, using phpBB frontend style, at http://www.cau.se/mystats . Allthough, it only shows channel stats and stats for whomever is online.
B
BVGorp

Post by BVGorp »

does this thingy also auto add the peepz in a chan or do i need to do that manually??
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

Adding users needs to be done manually. But, since this module basically has nothing to do with channel security you can add people by their nick.

Code: Select all

.+suser homeboy homeboy*
Or if you want to be somewhat strict:

Code: Select all

.+suser homeboy homeboy!*
New version out, http://www.cau.se/dev/mystats/
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

pelefanten you have mail.

Sorry for responding so late. I Had some problems. But i would still love to test this module. Mostly because i'm wondering is you're sql implemetation works with fastbase mysql dll's.

So you can port this to windrop also
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Other SQL Servers

Post by pelefanten »

I doubt that it will work with any other SQL server. As for supporting other SQL servers I've rewritten the module with PostreeSQL support. However, this "version" is not quite stable yet.

For anyone who wants to try the pgSQL module out, download it from http://www.cau.se/dev/pgstats
Q
Quinie
Voice
Posts: 27
Joined: Fri Jan 09, 2004 5:29 am
Location: NL
Contact:

Post by Quinie »

I think you didn't get what i mean and maybe i didn't get what you meant to say.

i will try to explain meself but englisch isn't my native language.
I'm a user of windrop and i'm making tcl files that connect to mysql. These scripts work with a sollution a company called fastbast made.

I was hoping that when compiling this module in cygwin i could make a windrop out of it. I tought the first problem would be the syntax of your code. Would it respond to the fastbase syntax. So i wasn't meaning another sql server version.

Well i just put it to the test today. But i could not compile the your module (using cygwin on win2000).
Would you like me to send you the log ?
Locked