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.

storing chan/user data in mysql

Old posts that have not been replied to for several years.
Locked
E
EvilMonkey

storing chan/user data in mysql

Post by EvilMonkey »

im making a module that will store all data in mysql then load it locally when bot is started, where can i find stuff on user and chan data? such as how it stores it, and other commands like that
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

User info is stored in the user file, channel data is stored in the channel file. Look in src/user*.c for user info, and the channel module for channel info.

Perhaps the best way to do it would be to have a blank user/channel file, and then when the bot starts and the module is loaded, you add all the users from there. Same with channels.
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

I recomend you look in src/chan.h and src/users.h. This is an example on how to get to every user in a channel, and the channel info:

Code: Select all

memberlist *m;
struct chanset_t *c;

c = findchan_by_dname("#chan");
for (m = c->channel.member; m && m->nick[0]; m = m->next) {
    // Nick: m->nick
    // Host: m->userhost
    // Handle: m->user?m->user->handle:"*"
}
More info on what a memberlist and chanset_t is look in the .h files.
E
EvilMonkey

Post by EvilMonkey »

thanks for all of the tips
E
EvilMonkey

Post by EvilMonkey »

If anyone would like to help with the development of the next ClanBots version which includes this module I am making, please contact me evilmonkey@clanbots.org.
Thanks
l
lordares
Voice
Posts: 15
Joined: Fri Dec 20, 2002 4:47 am

Post by lordares »

pfft thats easy
cd eggdrop/src
grep -ri "fprintf" *

everything but the notes.mod output it used for chanfile/userfile writing.


and comment out all the places it reads in userfile and chanfile
and backup functions.

I just made my botpack leaf not use any files at all, or save.. so i know exactly where to make the code changes, but i have no interest in making or really helping you with this, except for what i have already offered.
Locked