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.

MySQL instead of Eggdrops userfile?

General support and discussion of Eggdrop bots.
i
innu
Voice
Posts: 10
Joined: Sun Aug 20, 2006 4:36 pm

Post by innu »

demond wrote:using SQL is an overkill for the simple task of reading userfile ONCE (on (re)start) and writing it back ONCE an hour

another matter is that the proprietary text format eggdrop uses should be replaced with XML schema, thus allowing for easy userfile manipulation by external tools; but eggdrop is an antiquated piece of software anyway and that won't happen
What do you mean about 'eggdrop is an antiquated piece of software'? Is there something better.

Even xml is better than usual textfile.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Using xml might make it easier to alter the user database by hand. But you'd still have the issue of the userfile only being read once, and written every hour or so (making manually editing the userfile pretty pointless in most cases). In the rare occasion you'd have to repair your database manually, I'd probably think current format would be easier to fix by hand than xml. I'm sure there are a few good reasons to edit the database using various xml-tools, tho I'd considder those extremely rare (during my years since 1.0p and numerous botnets, I can count the number of times I've had to edit a userfile by hand on the fingers of my right hand...)

And since the data in the userfile always should be considdered old while your eggie is running, there really would'nt be much point in using any external tools to extract data while the eggie is running...

And as for mysql, I'm not too keen on having to install a mysqld and setting up databases and accounts with proper privileges, just in order to run an eggie.

Oh, and should I someday find a huge need to be able to modify my userlist from a fancy webpage with all the bells and whistles.. I'd just write a tiny script using sockets to allow my php-script to interface with my eggie under controlled conditions...
NML_375
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

it would definitely make editing the userfile by hand easier, at least for novices (have you tried XML Notepad?)

but I actually meant another, more important advantage - now that people are used to mySQL db's storing and manipulating all kinds of webpage data, import/export & process eggdrop userfile in XML format would be possible with one-liner tools without any need of special SQL interface in eggdrop

and yes, it is an antiquated software - or to put it mildly, it isn't exactly what you call the bleeding edge of software development or at least a modern day software (my understanding is that there are some developments in integrating modern era technologies - 1.9 branch? - but given the pace of eggheads, we won't be seeing those released in stable builds anytime soon - if ever)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

I this is a really old post but Its exactly what I am looking for - does anyone know of a script / module to make this happen?

Cheers
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Currently, the user database is very much integrated in the core application, making it impossible to switch the non-volatile datastorage without extensive patching of the core.
That said, what can currently be done with scripts or modules, is to export a copy of the userfile into xml-data, mysqldump-data, or whatever flavor you desire. Performing this would be quite simple. This however, will not allow you to modify the user database from "outside" your eggdrop (that is, you'd still have to rely on eggdrops user database API in order to alter the database in any way).

The outlines for a script to export the database would be something like this, I suppose:

Code: Select all

proc exportdatabase {stream} {
 foreach u [userlist -b] {
  #hosts, laston, info, xtra, comment, email, url, handle, pass
  puts $stream "user: $u"
  puts $stream "hosts: [getuser $u hosts]"
  puts $stream "laston: [getuser $u laston"
  #and so on...
 }
 foreach u [userlist +b] {
  #botfl, botaddr,hosts, laston, info, xtra, comment, email, url, handle, pass
  #same for bots, except they have two additional fields
 }
}
The above proc will expect an already opened file-stream (from either open or socket), and will probably require some tailoring to suit individual needs
NML_375
Post Reply