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.
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
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.
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).
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
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.
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.
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.
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 ?