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

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2006, 04:46 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default MySQL 5.0 and eqemu

hi,
here's a short explanation how to get eqemu 6.4 DR1-613 running with mysql 5.0 (5.1 might work too but i didn't test it)

1) change the sourcecode
(the first one is the original source the second one the modified one)

diff -r 6.4/common/database.cpp 6.4a/common/database.cpp
2881c2881
< return MakeAnyLenString(query, "SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= %d", varcache_lastupdate);
---
> return MakeAnyLenString(query, "SELECT variables.varname, variables.value, unix_timestamp() FROM eqemu.variables where unix_timestamp(ts) >= %d", varcache_lastupdate);

2996c2996
< if (RunQuery(query, MakeAnyLenString(&query, "Update variables set value='%s' WHERE varname like '%s'", varvalue, varname), errbuf, 0, &affected_rows)) {
---
> if (RunQuery(query, MakeAnyLenString(&query, "Update eqemu.variables set variables.value='%s' WHERE variables.varname like '%s'", varvalue, varname), errbuf, 0, &affected_rows)) {

3005c3005
< if (RunQuery(query, MakeAnyLenString(&query, "Insert Into variables (varname, value) values ('%s', '%s')", varname, varvalue), errbuf, 0, &affected_rows)) {
---
> if (RunQuery(query, MakeAnyLenString(&query, "Insert Into eqemu.variables (varname, value) values ('%s', '%s')", varname, varvalue), errbuf, 0, &affected_rows)) {

4131c4131
< if (RunQuery(query, MakeAnyLenString(&query, "SELECT value FROM variables WHERE varname='ServerType'"), errbuf, &result)) {
---
> if (RunQuery(query, MakeAnyLenString(&query, "SELECT variables.value FROM eqemu.variables WHERE variables.varname='ServerType'"), errbuf, &result)) {

4167c4167
< if (RunQuery(query, MakeAnyLenString(&query, "SELECT value FROM variables WHERE varname='UseCFGSafeCoords'"), errbuf, &result)) {
---
> if (RunQuery(query, MakeAnyLenString(&query, "SELECT variables.value FROM eqemu.variables WHERE varname='UseCFGSafeCoords'"), errbuf, &result)) {
diff -r 6.4/zone/spawn2.cpp 6.4a/zone/spawn2.cpp

226c226
< MakeAnyLenString(&query, "SELECT id, spawngroupID, x, y, z, heading, respawntime, variance, pathgrid, timeleft, condition, cond_value FROM spawn2 WHERE zone='%s'", zone_name);
---
> MakeAnyLenString(&query, "SELECT id, spawngroupID, x, y, z, heading, respawntime, variance, pathgrid, timeleft, spawn2.condition, cond_value FROM spawn2 WHERE zone='%s'", zone_name);


diff -r 6.4/zone/spawngroup.cpp 6.4a/zone/spawngroup.cpp
161,163c161,163
< "SELECT spawnentry.spawngroupID, npcid, chance, "
< " spawnentry.spawn_limit AS gsl, npc_types.spawn_limit AS sl "
< "FROM spawnentry, spawn2 LEFT JOIN npc_types ON spawnentry.npcID = npc_types.id "
---
> "SELECT spawnentry.spawngroupID, spawnentry.npcID, spawnentry.chance, "
> "spawnentry.spawn_limit AS gsl, npc_types.spawn_limit AS sl "
> "FROM spawnentry INNER JOIN spawn2 LEFT JOIN npc_types ON spawnentry.npcID=npc_types.id "


diff -r 6.4/zone/zone.cpp 6.4a/zone/zone.cpp
1634c1634
< if (RunQuery(query, MakeAnyLenString(&query, "SELECT varname, value FROM variables WHERE varname like 'decaytime%%' ORDER BY varname"), errbuf, &result)) {
---
> if (RunQuery(query, MakeAnyLenString(&query, "SELECT variables.varname, variables.value FROM eqemu.variables WHERE varname like 'decaytime%%' ORDER BY varname"), errbuf, &result)) {



2) add the Spawn2 table

# MySQL-Front Dump 2.5
#
# Host: 192.168.0.9 Database: eq
# --------------------------------------------------------
# Server version 4.0.13-standard


#
# Table structure for table 'spawn2'
#

CREATE TABLE spawn2 (
id int(11) NOT NULL auto_increment,
spawngroupID int(11) NOT NULL default '0',
zone varchar(16) NOT NULL default '',
x float NOT NULL default '0',
y float NOT NULL default '0',
z float NOT NULL default '0',
heading float NOT NULL default '0',
respawntime int(11) NOT NULL default '0',
variance smallint(4) NOT NULL default '0',
pathgrid int(10) NOT NULL default '0',
timeleft bigint(16) NOT NULL default '0',
spawn2.condition MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
cond_value MEDIUMINT NOT NULL DEFAULT '1',
PRIMARY KEY (id)
) TYPE=MyISAM;

3) add some data to spawn2

eg the PEQ database
https://www.projectf.de/spawn2data.sql
Reply With Quote
  #2  
Old 02-28-2006, 01:48 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

Thanks for the info about whats broken, we will consider changing these field/table names to make mysql happy..


in the future, please post unified diffs (-u), much easier to read.
Reply With Quote
  #3  
Old 04-30-2006, 01:31 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

ok i made a compatible patch for all users.. concerning the mysql5 troubles with eqemu and the availability of all froglok classes.

if you want to enable mysql5 support just uncomment the mysql5db_cflags at world, zone, EMuShareMem and eqlaunch.

to enable all froglok classes just uncomment the ALLFROGS at the world makefile.

enjoy it

https://www.projectf.de/mysql5frog.diff
Reply With Quote
  #4  
Old 06-08-2006, 07:38 AM
Arex
Hill Giant
 
Join Date: Jul 2004
Posts: 196
Default

I guess that this code for support MYSQL5 isnt still updated in eqemu official code? isnt it?
Reply With Quote
  #5  
Old 06-08-2006, 08:17 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

i'll post the new code tomorrow ...
__________________
- http://www.eqemu-paradigma.de -
Reply With Quote
  #6  
Old 06-09-2006, 02:19 AM
Arex
Hill Giant
 
Join Date: Jul 2004
Posts: 196
Default

nice Thank You, and could i know if is neccesary to do any changes to DB ? i am not sure, but i remember that last time that i tried source peq-db in mysql 5.0, i got any error...
Reply With Quote
  #7  
Old 06-09-2006, 02:21 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

nah there is no db change needed
__________________
- http://www.eqemu-paradigma.de -
Reply With Quote
  #8  
Old 06-09-2006, 02:46 AM
Arex
Hill Giant
 
Join Date: Jul 2004
Posts: 196
Default

yes mate, DB need any change, i have checked it rightnow, at least spawn2 create table script need any modification...
Reply With Quote
  #9  
Old 06-09-2006, 09:23 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

https://www.projectf.de/mysql5.diff

diff was made for 0.7.0-800. all you need to do is add it to your code and the server works with mysql5
__________________
- http://www.eqemu-paradigma.de -
Reply With Quote
  #10  
Old 06-10-2006, 08:45 PM
Arex
Hill Giant
 
Join Date: Jul 2004
Posts: 196
Default

u also need modify spawn2 create table script changing condition field for `condition`..
Reply With Quote
  #11  
Old 06-10-2006, 10:54 PM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

if you import a new db u can either use spawn2.condition or `condition`
__________________
- http://www.eqemu-paradigma.de -

Last edited by aza77; 06-11-2006 at 07:48 AM..
Reply With Quote
  #12  
Old 06-11-2006, 05:42 AM
Arex
Hill Giant
 
Join Date: Jul 2004
Posts: 196
Default

i already have compiled code succesfully and same with DB source...have u checked eqemu performance with mysql 5.0? works it so good like with mysql 4.0.24?

Thank you for help!
Reply With Quote
  #13  
Old 06-11-2006, 06:27 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

i didn't notice any slowdown but i already changed to mysql5 some month ago
__________________
- http://www.eqemu-paradigma.de -
Reply With Quote
  #14  
Old 09-27-2006, 04:24 AM
abaddon
Sarnak
 
Join Date: Nov 2005
Posts: 60
Default

call me slow (laffs) but I had a question.. I have crappy machines (lots of them) so I am constantly looking for a faster way to do everything... will 5.x speed up the server?
Reply With Quote
  #15  
Old 09-27-2006, 04:48 AM
eq4me
Hill Giant
 
Join Date: Jul 2006
Posts: 166
Default

no

But you could use machines for dedicated tasks.

Eg. let the mysql Database run on one Machine and the EQEmu Server itself on other machines. You could even run zones from one EQEmu server on multiple machines. As long as you have enough RAM and maybe Swapspace in each machine that is.
I intend do try some more complex setups (under Linux) in the near future and write a Wiki tutorial about it.
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 11:00 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3