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