1. Creating and Restoring Database
This part of the tutorial shortly describes simple steps to create and prepare server databases for use by server applications.
1.1 Creating Database
Follow and repeat the steps for each of server database.
- Open SQL Management Studio
- Navigate to Object Explorer and click with right mouse button on Databases and select New Database...
- In Database name area enter desired database name, by default MuOnline, Ranking, Events and BattleCore
- In Owner area enter database owner or leave <default>
- Follow to Options tab set Recovery model to Simple
- Confirm changes by clicking OK
1.2 Executing Database Script
Follow to \Database\1. Full Scripts\ and find available scripts. Databases are available in selection of configuration:
- Me_MuOnline_MD5.sql - this is database for purpose of advanced server configuration (shared account among different servers).
- Me_MuOnline_without_MD5.sql - this is database for purpose of advanced server configuration (shared account among different servers)
- MuOnline_MD5.sql - this is database for regular server configuration
- MuOnline_without_MD5.sql - this is database for regular server configuration
- Events.sql - this is database storing sort of Events information
- Ranking.sql - this is database storing range of ranking information
- BattleCore.sql - this is database storing data for Battle Core server purpose (Database name for BattleCore is unchangeable and must stay BattleCore)
The above databases are offered in two types, preconfigured to support and not support MD5 password encryption. For MD5 ones follow MD5 installation part of the tutorial.
Navigate to SQL Management Studio and open your database scripts in it. Now by pressing F5 execute them over previously created databases. If your database names are different than default modify USE statement at beginning of each script, e.g., USE [Database_Name]
1.3 MD5 Installation on Database
WZ MD5 encryption is working only with x86 distributions of SQL Server. All database scripts come with implemented MD5 function, you can skip Step 3 then. IMPORTANT MuOnline database user must be also an owner of master database
- Copy WZ_MD5_MOD.dll to <drive>:\<path>\Microsoft SQL Server\'INSTANCE_NAME'\MSSQL\Binn
-
Run the following codes in Query Analyzer on master database
use [master] GO exec sp_addextendedproc 'XP_MD5_EncodeKeyVal', 'WZ_MD5_MOD.dll' GO
-
Run the following codes in Query Analyzer on MuOnline/Me_MuOnline database
use [MuOnline] -- or [Me_Muonline] depends of server configuration GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fn_md5]') AND type IN ( N'FN', N'IF', N'TF', N'FS', N'FT' )) BEGIN EXEC('CREATE FUNCTION [dbo].[fn_md5] (@data VARCHAR(20), @data2 VARCHAR(10)) RETURNS BINARY(16) AS BEGIN DECLARE @hash BINARY(16) EXEC master.dbo.XP_MD5_EncodeKeyVal @data, @data2, @hash OUT RETURN @hash END') END
- Enable MD5 Support by setting PasswordEncryptType = 1 in IGCDS.ini of regular and BattleCore Data Servers.
1.4 Configuring SQL Database User
Before going to next step create database user and set him owner privileges to previously created databases - SQL Management Studio → Object Explorer → Security → Right Mouse Click on Logins → New Login...
- In Login name enter name of your database user (own input)
- Select SQL Server authentication
- In Password area enter password for the database user, make it strong enough
- In Confirm password retype the password from step above
- Uncheck Enforce password policy, otherwise make sure that Enforce password Expiration and User must change password at next login are unchecked.
- In Default language set English
- Navigate to User Mapping in Select page area
- On right side in databases list click on your previously created database name and check the box in Map column then in Database role membership area below check db_owner
Repeat last step for every of server Database
2. Configuring DataServer to start
The tutorial will describe options that are necessary to be modified with your individual values for purpose of server start. Functionality of rest of the option is explained directly within file comments.
Follow to \Server\Files\1. DataServer\ and open config.ini file (in some older versions the file name is IGCDS.ini)
- Find WanIP = PUBLIC_IP and replace the PUBLIC_IP with your actual WAN IP, not sure? check it here
-
Find following part and configure database names if did not restore them with default names
CharacterDB = MuOnline AccountDB = Me_MuOnline EventDB = Events RankingDB = Ranking
-
Follow to the next part and configure username and password for the database user of the above - it is not advised to use super admin (sa) user
User = DB_USER Pass = DB_PASSWD
-
Follow to next part and configure SQL Server IP or Instance Name to Data Server will connect to. It is usually 127.0.0.1 or instance name. You can check instance name by running SQL management Studio → Right mouse click on the top level position of the tree → select Properties and in newly appeared window on the right side follow to copy value of Name property
SQLServerName = SQL_INSTANCE\IP
-
Follow to last required part and configure password encryption type depending of selected database type
;------------------------------------------------------------------------ ;-- Specify selected value for PasswordEncryptType below ;-- Referenced table for storing password: [dbo].[MEMB_INFO].[memb__pwd] ;------------------------------------------------------------------------ ;####################################################################### ;### NO MD5 - varchar(20) - for x86/x64 SQL ############################ ;####################################################################### ;--- PWENC_NONE - 0 ;####################################################################### ;### WZ_MD5 - binary(16) - for x86 SQL only, requires WZMD5MOD.dll ##### ;####################################################################### ;-- PWENC_WZMD5 - 1 ;####################################################################### ;## IGC_MD5 - varchar(32) - for x86/x64 SQL, uses md5($pass) from PHP ## ;####################################################################### ;-- PWENC_MD5 - 2 ;####################################################################### ;### SHA 256 - binary(32) - for x86/x64 SQL ############################ ;####################################################################### ;-- PWENC_SHA256 - 3 ;----------------------------------------------------------------------- PasswordEncryptType = 0 ;----------------------------------------------------------------------- ;-- Salt for password encryption type 3 (PWENC_SHA256) ;----------------------------------------------------------------------- PasswordEncryptSalt = 1234567890
PasswordEncryptSalt is a salt for PasswordEncryptType = 3 encryption type
2.1 Battle Core Data Server
The Battle Core Data Server (IGC.DataServer_B.exe) is dedicated for purpose of Battle Core database management. Its configuration must be same as of regular Data Server with few differences only
Modules
UseJoinServer = 1 UseDataServer = 1 UseExDataServer = 0
Battle Core Data Server does not use ExDataServer module, leave it disabled. However, it uses own Join and Data Servers - keep them enabled as by above example.
Ports
JoinServerPort = 56770 DataServerPort = 56760 ExDataServerPort = 0
Ports of Join and Data Server must be different than ports configured for regular Data Server, otherwise you it will not be able to run Battle Core Data Server due to BIND ERROR.
Database
CharacterDB = BattleCore AccountDB = Me_MuOnline EventDB = BattleCore RankingDB = BattleCore
The Battle Core Data Server is operating over BattleCore database (the name of it cannot be changed). The CharacterDB, EventDB and RankingDB should always be configured with BattleCore database as on example above.
The AccountDB setting should point to Me_MuOnline database (or whatever the name of your Me_MuOnline database is).
3. Running Data Server
To run Data Server simply double click IGC.DataServer.exe. If it runs and you can see logs with no error in the window then it is configured fine.
If your Data Server window hangs and freeze then configuration is not valid, and Data Server cannot connect to SQL. In this case follow the tutorial again and double check configuration of the application and SQL Server.