Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2003, 07:31 AM
velns
Fire Beetle
 
Join Date: Apr 2003
Posts: 10
Default Logging Spell Usage Bug

The following are changes to zone/spells.cpp to fix the misorder of output in the spell logging code. The name of the castee and the name of the spell had been incorrectly inversed. I believe there may also be an issue with the spell power logic, as I haven't seen any spells logged at usage other than 50%. I will need to do more debugging to figure out exactly why.

>...>...>...if (partial && (random > chance - 0.10))
>...>...>...{
>...>...>...>...LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 50%% Hit!",
caster?caster->GetName():"unknown",
spells[spell_id].name, GetName());
>...>...>...>...return 50;
>...>...>...}
>...>...>...else if (partial && random > chance - 0.0
>...>...>...{
>...>...>...>...LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 60%% Hit!",
caster?caster->GetName():"unknown",
spells[spell_id].name, GetName());
>...>...>...>...return 60;
>...>...>...}
>...>...>...else if (partial && random > chance - 0.06)
>...>...>...{
>...>...>...>...LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 70%% Hit!",
caster?caster->GetName():"unknown",
spells[spell_id].name, GetName());
>...>...>...>...return 70;
>...>...>...}
>...>...>...else if (partial && random > chance - 0.04)
>...>...>...{
>...>...>...>...LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 80%% Hit!",
caster?caster->GetName():"unknown",
spells[spell_id].name, GetName());
>...>...>...>...return 80;
>...>...>...}
>...>...>...else if (partial && random > chance - 0.02)
>...>...>...{
>...>...>...>...LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 90%% Hit!",
caster?caster->GetName():"unknown",
>... spells[spell_id].name, GetName());
>...>...>...>...return 90;
>...>...>...}
>...>...>...else if (random > chance)
>...>...>...{
>...>...>...>...LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: Full Hit!",
caster?caster->GetName():"unknown",
spells[spell_id].name, GetName());
>...>...>...>...return 100;
>...>...>...}
Reply With Quote
  #2  
Old 07-29-2003, 01:13 PM
velns
Fire Beetle
 
Join Date: Apr 2003
Posts: 10
Default

Modifications to latest 0.5 code, various zone files (including better formatting of the above code change)

makefile change to use "common" mysql library / include paths rather than /usr/local path =>
Code:
--- makefile    25 Jul 2003 12:01:08 -0000      1.1.1.2
+++ makefile    30 Jul 2003 00:25:02 -0000
@@ -1,6 +1,6 @@
 APP=zone
 SF=../common/EQNetwork.o \
-   ../common/timer.o ../common/database.o ../common/packet_dump.o ../common/packet_functions.o \
+   ../common/timer.o ../common/EQEMuError.o ../common/database.o ../common/packet_dump.o ../common/packet_functions.o \
    ../common/unix.o ../common/packet_dump_file.o ../common/Mutex.o ../common/MiscFunctions.o \
    zone.o entity.o mob.o client.o client_process.o npc.o net.o spawn2.o attack.o hate_list.o \
    ../common/serverinfo.o ../common/moremath.o worldserver.o spells.o spawngroup.o loottables.o \
@@ -14,8 +14,8 @@

 CC=gcc
 LINKER=gcc
-MYSQL_FLAGS=-I/usr/local/mysql/include
-MYSQL_LIB=-L'/usr/local/mysql/lib' -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv
+MYSQL_FLAGS=-I/usr/include/mysql/
+MYSQL_LIB=-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv
 DFLAGS=-DDEBUG=5 -DCATCH_CRASH -DNO_PIDLOG -DSHAREMEM -DSPELL_EFFECT_SPAM
 WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wstrict-prototypes -Wno-deprecated -Wnested-externs -Wcomment -Wcast-align
 COPTS=$(WFLAGS) -O -ggdb -march=i686 -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS)
parser.cpp change to make the itoa definition WIN32 only, as it is an invalid-redefinition when compiling on linux =>
Code:
--- parser.cpp  29 Jul 2003 00:30:19 -0000      1.2
+++ parser.cpp  30 Jul 2003 00:25:05 -0000
@@ -152,7 +152,10 @@
        return returnvalue;
 }

+#ifdef WIN32
 char* itoa(int integer) {char tmp[10];return itoa(integer,tmp,10);}
+#endif
+
 string strlwr(string tmp) {return strlwr((char*)tmp.c_str());}
 int strcmp(string com, string com2) {return strcmp(com.c_str(),com2.c_str());}
spells.cpp change, to fix improper wording in spell casing logger messages=>
Code:
--- spells.cpp  29 Jul 2003 00:30:20 -0000      1.2
+++ spells.cpp  30 Jul 2003 00:25:17 -0000
@@ -1458,43 +1458,43 @@
                        if (partial && (random > chance - 0.10))
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 50%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 50;
                        }
                        else if (partial && random > chance - 0.08)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 60%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 60;
                        }
                        else if (partial && random > chance - 0.06)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 70%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 70;
                        }
                        else if (partial && random > chance - 0.04)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 80%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 80;
                        }
                        else if (partial && random > chance - 0.02)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 90%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                              spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                              spells[spell_id].name, GetName());
                                return 90;
                        }
                        else if (random > chance)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: Full Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 100;
                        }
                        return 0;
Reply With Quote
  #3  
Old 07-29-2003, 09:48 PM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

moved this to the Development forum. Looks good , though Im hestitate to alter the makefiles. Mysql doesnt install to the same location based on your distro. I'll take a look though, I thought BP had modified it to dynamic work that out....
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #4  
Old 08-03-2003, 06:35 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

Automake is the devil, if someone wants to do it, go for it.. a configure script would be good aswell..
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
  #5  
Old 08-03-2003, 07:07 AM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

Hmm dunno how i missed this post.. yeah i had fixed the makefile to use mysql_config, someone likely copied an older makefile in the merge
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:33 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3