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.

Can.t get mystats.so to work

Old posts that have not been replied to for several years.
Locked
G
GIR

Can.t get mystats.so to work

Post by GIR »

I did everything according to the manual and tried some extra tricks I had up my sleeve, just can't get it to work.

exporting LD_LIBRARY_PATH doesn't work and I can't static compile it.

Eggdrop version 1.6.15
MySQL version 3.23.51
The error message wrote:relocation error: /home/eggdrop/modules/mystats.so: undefined symbol: mysql_init
MySQL libs wrote:mysql_config --libs
-static -L'/usr/local/mysql/lib' -lmysqlclient -lz -lcrypt -lnsl -lm
MySQL incs wrote:mysql_config --cflags
-I'/usr/local/mysql/include'
Contens libs dir wrote:/usr/local/mysql/lib$ ls
libdbug.a libmygcc.a libmysqlclient.a libmystrings.a libmysys.a
Contens incs dir wrote:/usr/local/mysql/include$ ls
config-os2.h getopt.h merge.h my_global.h my_sys.h mysql_com.h raid.h thr_alarm.h
config-win.h global.h my_alarm.h my_list.h my_tree.h mysql_version.h sslopt-case.h thr_lock.h
config.h hash.h my_base.h my_net.h myisam.h mysqld_error.h sslopt-longopts.h violite.h
dbug.h heap.h my_bitmap.h my_no_pthread.h myisammrg.h mysys_err.h sslopt-usage.h
errmsg.h m_ctype.h my_config.h my_nosys.h myisampack.h nisam.h sslopt-vars.h
ft_global.h m_string.h my_dir.h my_pthread.h mysql.h queues.h t_ctype.h
Can anybody tell me what I'm doing wrong or what I'm missing?

TIA,
GIR
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

I got the module to worke successfully withouth any undefined symbol errors now... What I did was adding the library location at the end of the line in the Makefile. I dont know if you already tried this. Notice the "/usr/local/lib/mysql/libmysqlclient.a". This is what my makefile looks like now:

Code: Select all

srcdir = .


doofus:
        @echo ""
        @echo "Let's try this from the right directory..."
        @echo ""
        @cd ../../../ && make

static: ../mystats.o

modules: ../../../mystats.$(MOD_EXT)

../mystats.o:
        $(CC) $(CFLAGS) $(shell mysql_config --cflags) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/mystats.c
        @rm -f ../mystats.o
        mv mystats.o ../

../../../mystats.$(MOD_EXT): ../mystats.o
        $(LD) $(shell mysql_config --libs) -o ../../../mystats.$(MOD_EXT) ../mystats.o /usr/local/lib/mysql/libmysqlclient.a
        $(STRIP) ../../../mystats.$(MOD_EXT)

depend:
        $(CC) $(CFLAGS) $(CPPFLAGS) -MM $(srcdir)/mystats.c > .depend

clean:
        @rm -f .depend config.* *.o *.$(MOD_EXT) *~
distclean: clean

#safety hash
../mystats.o: .././mystats.mod/mystats.c ../../../src/mod/module.h \
 ../../../src/main.h ../../../src/lang.h ../../../src/eggdrop.h \
 ../../../src/flags.h ../../../src/proto.h ../../../lush.h \
 ../../../src/misc_file.h ../../../src/cmdt.h ../../../src/tclegg.h \
 ../../../src/tclhash.h ../../../src/chan.h ../../../src/users.h \
 ../../../src/compat/compat.h ../../../src/compat/inet_aton.h \
 ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
 ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
 ../../../src/mod/modvals.h ../../../src/tandem.h
G
GIR

Post by GIR »

That did the trick, tnx :)

I have a few ideas of my own that I am going to add.

* Make it so that users add themselves with +suser
* Make it so that users can change their pass / hostmasks
* Password protect public user commands
* Make it so that you can hide people from the stats
* Make it so that you can monitor the same channel names on a botnet
IE: if you have 1 bot on net x and another bot on net y on channels that have the same name
* Make it so that stats get purged every x period, like every month or week
* Make a more extensive PHP page with charts and graphs

I have also discoverd 3 bugs.

* If you -schan a channel then you can't readd it again, you have to restart the bot
* The idle time is only tracked for known users. If a person doesn't have a account with the stats then they show up on the "who is online" but their stats isn't being tracked.
* !top10 line doesn't work

I also have a question. What is chans.status used for? I found you use 1 and 2 but what do they mean?

Tnx,
GIR
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

Glad it worked, and I'd be happy to explain what some of the table colums holds (you may have figured some out already).

Code: Select all

chans.status can either be -1,0,1 or 2.
  -1 Once you join a channel a record is beeing created with this default
     It means that you dont keep stats for this channel. Inactive mode.
  0  You keep stats for this channel, but the bot hasn't joined it yet.
  1  You keep stats for this channel, the bot has joined, but you havent
     loaded everyone who's online yet.
  2  You keep stats for this channel, the bot is ready to go.

online.mode is whatever status the user has op/hop/voice/none.
  0000
  |||'- none
  ||'- voice
  |'- hop
  '- op
ie. mode 1010 = User has op and voice, 0 = none and 1000 has op

users.type is not used but will be once the next release is out.
  0  Regular user (as everyone is rigth now)
  1  Known bot (dont keep stats for bots)
As far as the bugs go I know of the top10 one and it has been fixed for the next release. Not fixed the .-schan and i've also discovered that when you do a manually .loadmodule and the bot is already on some channels then they dont load properly...

[added]
The idletime is a part of the online table, so everyone has a known idletime, however only stats-users has a "time-wasted". Its not realy a bug, its a feuture i desided not to implement. cus whats the use of tracking statistics for users the bot doesnt recognize?
G
GIR

Post by GIR »

Just incase people can't wait on the official release and want to fix their !top command rightnow, you can get a fixed version here

How to use:
* Copy the public.c and ./language/mystats.english.lang file over the original files
* Go into the eggdrop directory (the source file dir not the compiled dir)
* run "make clean"
* run "./configure"
* run "make config"
* run "make && make install"

if all goes well without any error's then restart your bot and say "!top10 line"

HF & GL,
GIR

WARRANTY
No warranties, either expressed or implied, are hereby given. All software is supplied as is, without guarantee. The user assumes all responsibility for damages resulting from the use of these features, including, but not limited to, frustration, disgust, system abends, disk head-crashes, general malfeasance, floods, fires, shark attacks, nerve gas, locust infestation, cyclones, hurricanes, tsunamis, local electromagnetic disruptions, hydraulic brake system failure, a temporary dissemination of the code of the One, invasion, hashing collisions, the destruction of Zion, normal wear and tear of friction surfaces, cosmic radiation, inadvertent destruction of sensitive electronic components, windstorms, disruptions in the Force, the Riders of Nazgul, infuriated chickens, malfunctioning mechanical or electrical sexual devices, the second coming of Jesus, premature activation of the distant early warning system, peasant uprisings, jumpstarting the Earth’s molten core, halitosis, artillery bombardment, transporter accidents leading to a mirror universe, explosions, cave-ins, rerouting warp plasma thru the main deflector and/or frogs falling from the sky.

So don't call on me when something goes wrong or you do not know what you are doing.
Last edited by GIR on Sat Sep 06, 2003 11:05 am, edited 1 time in total.
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

I dont know if its such a good thing to rename the lines-counter to "lines" since its a reserved word by mysql.

http://www.mysql.com/doc/en/Reserved_words.html
G
GIR

Post by GIR »

You are right :) I have changed the package and the intrustions.
Locked