MySQL Conversion

10/06/2010 04:33 -8gX#1
Hey all its -8gX gettin back into the pserver development. My first undertaking is converting the old MSSQL servers into MySQL. My reasons for doing this should be blatant enough and if you dont know google why MySQL is better than MSSQL. Anyways; I want to do this but I need some advice.

How does the client read database information? Im assuming it doesnt and everything is read through the server but I'm just double checking.

Would I need to reprogram the ASM in dekaronserver.exe to connect via MySQL connections? Im assuming yes; otherwise how would it know a MySQL server even exists. Any one want to point me in the right direction on this? What lines am I looking for in Olly; how to debug it; etc.

Im not some random noob trying all this by the way guys. I know my shit inside and out of dekaron development. Im just normally a PHP guy that sits in the background lol.


Thanks again for your anticipated help.
10/06/2010 09:56 pieter#2
and how are you going to put the Stored Procedures in MySQL ?
the game will be useless without it since 80% of it depends on the stored procedures in MSSQL :)

getting the game to talk to MySQL is relatively easy (ODBC links) however. converting the gamedata (and by that i don't mean the table's/data but the procedures/functions and datatypes) will be nearly impossible :)

the server itself doesn't really read into the database.

it just constantly executes and call's stored procedures :)

example. if ingame you make a new character
it executes character..SP_CHAR_EDIT_CREATE with the info you've enterred "class,charname"
SP_CHAR_EDIT_CREATE then checks if the name exists, if its allowed, then makes an entry in user_character and reports back to the game with an integer -20 - 20
depending on those integers the game either reports an error or a success
10/06/2010 12:01 -8gX#3
Well after you connect to the MySQL database and the ODBC triggers SP_CHAR_EDIT_CREATE you would need to create a UDF within MySQL for SP_CHAR_EDIT_CREATE(class,charname);

Code:
DROP PROCEDURE IF EXISTS SP_CHAR_EDIT_CREATE;  

DELIMITER ';;'  
CREATE PROCEDURE SP_CHAR_EDIT_CREATE(  
  OUT cl STRING(8,2),
  OUT ch STRING(8,2),
)
BEGIN

IF EXISTS (SELECT %cl FROM dbo.character WHERE class = '%cl' AND charname = '%ch') then  
DIE('Char Exists')
END IF;

ELSE
ALTER TABLE dbo.character ADD %cl AND %ch WHERE class AND charname = NULL
END ELSE

END;;
Yes I know; that code is totally wrong but what it does prove is that stored procedures are possible. They arent too different from the MSSQL ones so conversion is possible.


[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Just a couple references to look at
10/06/2010 15:30 pieter#4
yes that why i said nearly :)

however, you will be quite busy since u need to rewrite each single SP and function into UDF's :)

Personally i'd rather stick time into researching MSSQL2008 compatability or maybe even MSSQL Azure (put dekaron in the cloud xD)
10/06/2010 17:04 ҉ THT ҉#5
Dekaronserver.exe is only the thing that loads your share folder.. (nothing with SQL)
BUT,
You shud need, Loginserver, Castserver, ...etc to edit..
AND that will be very hard, cuz the .exe using mssql connection not a mysql connection
10/07/2010 00:48 -8gX#6
well like pieter was saying.... you could just change the odbc connection so it reads the mysql database as a mssql one.

At least i think thats what he was saying
10/07/2010 10:10 pieter#7
i said u can try to ;)

most oldschool applications use ODBC so a big chance dekaron does too
10/08/2010 00:07 -8gX#8
And as for finding the information you provided on that SP... WHere would I go about getting all of that from? Like every SP in MSSQL?
10/08/2010 12:12 pieter#9
the most important Stored Procedures and Functions are inside the character / account / cash database.

just open them with SQL server management studio 2005 :)