Category:Crucible

The EVEmu project is a developing EVE Online server suite and as yet does not support most features offered in the game.

EVEmu Crucible is compatible with EVE Client v1.6.5 build 360229 (Crucible).

= DISCLAIMER = EVEmu is an educational project. This means, our primary interest is to learn and teach us and our users more about C++ project development in a large scale. Our software is not intended for running public servers, and we do not support that. We are not responsible for what others do with the source code downloaded from this project.  

= Quick Navigation = This is a large page with lots of detail for building and setting up the server, building the server's database, and developer-only related information. Use this Quick Navigation panel to get where you want to go.

= PREFACE =

This guide is meant more for the intermediate programmer and/or computer power user. It is not meant for an average computer user or gamer that just wants to connect to a server and start playing EVE. This guide assumes basic to intermediate knowledge in the following areas. If you find that you do not have this prerequisite knowledge, you will find it nearly impossible to follow this guide on your own and are encouraged to just either go learn about these areas or you don't build the server, setup the database and try to run your own server. You'll just have to "find" one to connect to. As stated in the above, The EVEmu Project does not host any servers nor does it encourage anyone to do so.

Prerequisites:
 * MySQL Server - know how to setup a MySQL server from scratch, administrate it, make/remove accounts, create databases, tables, etc
 * Visual Studio - basic use of Visual Studio including opening a project, changing project properites, running build configurations
 * Git SCM - basic to intermediate use of Git Source control management system either via a client or command line
 * File systems - intermediate use of file systems and directory management on your platform of choice

= SUPPORTED PLATFORMS = (updated 2012-05-23)

WINDOWS: Windows builds are currently fully functional. Windows XP, Vista, 7 (32 or 64 bit both work)

LINUX: Linux builds are currently fully functional. Recommended distros: Ubuntu, Debian, really anything.

= STEP 1 - Getting the Client =
 * http://gork.levelbelow.net/eveexe/360229/


 * 1) Download the EVE_Online_Installer_360229.exe, eveonline_360229_1of2.7z, and eveonline_360229_2of2.7z
 * 2) Install the client using the .exe
 * 3) Download the blue_patcher ZIP package for Crucible
 * 4) Finally, follow the instructions in the README.md file to run the patcher and configure your client to connect to a server

NOTE: Do NOT run the Client from the icon you get after installation. Change it to run the /bin/exefile.exe instead of the eve.exe

Crucible is no longer available from CCP, so you will have to use the link above to download the currently supported client build for EVEmu Crucible.

= STEP 2 - Setting up your Build and Server Environment =

We recommend a nicely organized folder structure for keeping your build area separate from your server execution area in case you need to delete/move either of them. I will also illustrate a good way to keep dependencies of the source code in a separate area than either the source tree or the server execution area.

A note on  shown below: this is simply the folder path from the base drive letter (C: in Windows, or '/' in linux) to where you want to store your EVEmu development tree. For simplicity for new users/developers, you may simply use C:\ or '/' as your path from root. More complicated paths might be F:\projects\servers\ (windows) or /home/projects/servers/ (linux).

Build Environment - Recommended folder structure

 *  - (see note above about )
 * \evemu
 * \server
 * \common - optional, only if you want to manually specify and maintain the source's dependencies
 * this will contain various subdirectories for the server source dependencies, such as mysql, boost, zlib, etc
 * \evemu_server
 * this will contain the entire source tree for the server source code

Server Execution Environment - Recommended folder structure

 *  - (see note above about )
 * \servers
 * perhaps you run multiple game servers like WoW, EVEmu, etc, LOL
 * \evemu
 * \bin
 * in here, you'll put the eve-server.exe and libmysql.dll files
 * (eve-server.exe you'll find in /builds/src/eve-server/Release)
 * (libmysql.dll you'll find in /builds/mysql-XXXXXXX/lib)
 * \etc
 * in here, paste a copy of the log.ini, devtools.raw, and eve-server.xml files you'll find inside the source tree's /utils directory
 * \log

= STEP 3 - Server setup = NOTE: If you have server binaries, then proceed directly to 


 * - Getting the source code
 * - Compiling with CMake
 * - Compiling the Source Code Project
 * - Database Installation and Setup
 * - Server Configuration

Getting Git
LEARN:
 * The best Git primer we've seen is a 1hr 40min video series found here
 * If you prefer to use Git via command line, here is a good tutorial on how to do it. Git-Linux  Git-Windows

GET:
 * You need a Git client in order to download the source. Windows users can download SmartGit, Linux users need to install the respective package (usually git).

NOTE: Use Git to pull down the source, we recommend if you want to develop, create a Github account. Then you can fork from the main branch and develop from there.

The EVEmu server source code is hosted on GitHub and uses the Git SCM (Source Control Management) system for revision and branch control. Here is the home page for the latest server source code project:
 * EVEmu Project - evemu_server

-Windows-
GUI route: Download Smartgit and follow the on screen instructions to pull down the source from github. This guide is not going to contain a primer on how to use SmartGit. Most of our developers use the command line git, so most of this guide is going to be oriented more toward using git on the command line.

Command Line route:
 * Download and install msysgit command line environment for windows
 * Run the Git Bash tool to get the git command line
 * Using the 'cd' command, navigate to a directory location on your hard drive, such as C:\evemu\server and from that location in the command line for Git, type this:

$ git clone https://github.com/evemuproject/evemu_server.git

You'll end up with the source tree being copied to the location C:\evemu\server\evemu_server and you'll be ready for the next step.

-Linux-
You can use any gui available for Linux. If you prefer terminal, type this:

$ git clone https://github.com/evemuproject/evemu_server.git

The source will be downloaded into subdirectory evemu_server.

STEP 3.2 - Compiling with CMake
EVEmu can be built using CMake: a tool designed to ease the whole process of compiling on various platforms. You can find further information about it on the homepage; here we'll concentrate only to how to use it to build EVEmu.

-Windows-
NOTE: Dependencies are being automatically downloaded, installed, and linked to during the CMake process, so manually downloading, installing, extracting, and pointing CMake to dependencies is OPTIONAL.

Tools and Dependencies

 * Download and Install: Git For Windows CMD

-Linux-

 * cmake
 * git
 * make
 * g++
 * zlib, zlib-dev
 * libmysqlclient, libmysqlclient-dev
 * boost-build, libboost-dev

NOTE: Just search your distro's repository for similarly named packages and install them.

Running CMake
'''WARNING: Do NOT use SPACES in any part of your path to the EVEmu source code or any of its dependencies (libraries like boost, mysql, zlib, etc). Any spaces in the path will cause MASSIVE errors when you go to compile the software in your compiler. YOU HAVE BEEN WARNED!!'''

-Windows-
Create directory C:\evemu\server\evemu_server\build.

Go to the directory where you have installed CMake, there should be subdirectory bin. Go in there and run cmake-gui.exe.

In the edit box labeled Where is the source code:, click Browse source and pick C:\evemu\server\evemu_server

In the edit box labeled Where to build the binaries:, click Browse build and pick C:\evemu\server\evemu_server\build

Now, click Configure button in the lower-left part. Another dialog pops up, asking you to choose compilers and a generator. Choose Visual Studio 10 2010, then use default native compilers and press Finish.

CMake starts configuring your build.

CMake Manual Dependency Configuration - (if Cmake fails to download them)
'''STATUS - The ability to manually configure the location for depenencies is now broken due to changes made to the CMake build configuration that now automatically downloads, extracts, installs, and links to all dependencies used by the source. A solution is being worked that will allow us to disable this automatic process in favor of a fully manual dependency management option for at least the big three dependencies: boost, mysql, and zlib.'''

If Manual Dependency Management is enabled, Configure will fail, because you haven't set several CMake variables yet. For each of the rows below, click the button Add Entry in the upper part, fill in the corresponding editboxes and click OK:

Choose advance tab in cmake, The very first line should be Boost_include_DIR. Please update it to your path for Boost.

Name: CMAKE_SYSTEM_INCLUDE_PATH Type: PATH Value: C:\evemu\server\common\mysql\include;C:\evemu\server\common\zlib Name: CMAKE_SYSTEM_LIBRARY_PATH Type: PATH Value: C:\evemu\server\common\mysql\lib\opt Name: Boost_INCLUDE_DIR Type: PATH Value: C:\evemu\server\common\boost

Now click Configure again and it should be fine. After configuration is done, click Generate and close the window.

IMPORTANT: Be sure there are NO red errors in the log window at the bottom of the CMake window. If there are any, take a look at them to see if they merit reporting to developers or if they are simply reporting the failure to configure something that you did not select for being configured, such as doxygen or eve-tool.

Finally, you can now open the EVEmu server solution in Visual Studio. Just make sure to open it in the same version of Visual Studio that you told CMake to use when you setup the CMake build.

-Linux-
Type: $ mkdir path/to/evemu/server/evemu_server/build $ cd path/to/evemu/server/evemu_server/build $ cmake path/to/evemu/server/evemu_server

If you want to configure the build manually, add -i flag: $ cmake -i path/to/evemu/server/evemu_server

Alternatively, you can use the curses-based CMake (assuming you have it installed): $ ccmake path/to/evemu/server/evemu_server

This is particularly useful e.g. when you want to build a Debug binary.

-Windows-
Browse to C:\evemu\server\evemu_server\build, there should be a file evemu.sln. Double-click it and Visual Studio opens up. You can set it to two modes, Debug or Release by choosing a selection from a drop-down menu near the center of the toolbar. Depending on your OS platform, you may want to choose between 32-bit and 64-bit using the drop-down menu to the right of the Release/Debug drop-down.

Either Debug or Release build will work, but the Debug build's exe is much larger and much slower in performance due to all the debug symbols and extra code to support debugging that gets built into the exe. If you want to run the server and not debug at all, use the Release build as it will be much smaller in size and much faster.

In the left file/folder tree view called Solution Explorer, right-click Solution evemu and click Build solution. Compilation should start.

-Linux-
Type: $ cd path/to/evemu/server/evemu_server/build $ make

If you want to make use of a multicore CPU, specify number of cores with -j option. For example, if you had quad-core CPU, you'd type: $ make -j4

Debugging
These instructions will help you surmount the common problems when setting up your system to debug EVEmu server code.

Skip to if you are not interested in developing code for this project and just want to run the server.

-Windows-

 * 1) Open the evemu project in Visual Studio.
 * 2) To do FULL Rebuilds of entire project, select ALL_BUILD at the top of the list in Solution Explorer, then either hit Ctrl+Alt+F7 key or click Build -> Rebuild Solution from the menu bar.
 * 3) To compile sub-projects by themselves, such as eve-server, then select that sub-project in Solution Explorer, then hit F7 for a Build or Ctrl+Alt+F7 for a Rebuild or access either from the Build menu on the menu bar.
 * 4) To set the project for Debugging, find the drop down box on the toolbar that is either going to have Release or Debug inside. If it says Debug you are good to go, just to a FULL rebuild of the whole project. If it says Release, click on it then select Debug, then do a FULL rebuild of the whole project.
 * 5) To RUN eve-server after you have built it under Debug, follow these steps:
 * 6) Right-click on eve-server in the Solution Explorer and select Properties
 * 7) Expand Configuration Properties and click Debugging
 * 8) Put the text Debug in the field called Working Directory, then click the OK button
 * 9) Now, navigate to your server project source root directory, then drill down to this sub-folder: build\src\eve-server
 * 10) Make a new folder called etc and put your eve-server.xml file in that new etc folder. You can copy and modify the provided example eve-server.xml found inside the /utils subdirectory off the root of the source tree.
 * 11) Back in Visual Studio, right click on eve-server again in the Solution Explorer and select Set as StartUp Project, the eve-server tree label will now be bold to indicate this change
 * 12) You can now hit F5 to execute the debug build .exe or click Debug -> Start Debugging from the menu bar.

-Linux-
Assuming you've used the Debug build configuration, just use GDB:

$ gdb build/src/eve-server/eve-server

If you want to REBUILD your source code
Whenever you update your source code working tree from the github repository, add files to the project (which requires adding them to the CMakeLists.txt files), or change one of the .xmlp files found in /src/eve-common/packets/xmlp, you MUST do a full REBUILD of your source code to ensure that all changes and new files are made available to the compiler. Here's how you do that:

REBUILD source: This is simply accomplished by closing Visual Studio, opening CMake, clicking Configure twice, then Generate once, and finally opening Visual Studio again. Now, you need to right-click on the ALL_BUILD project, and click Rebuild. This will rebuild your entire source code from scratch using any new files or modified packet xmlp files that were added/modified by either you or whomever pushed changes to the github repository that you just pulled down.

STEP 3.4 - Database Installation and Setup
NOTE: This guide assumes directory structure created in compiling with cmake guide.

Properly setup your MySQL server
You need to properly setup your MySQL server before you attempt to build the database following the instructions we present below, so go open up your my.ini (windows) or my.conf (linux) in a text editor. Find the following parameters and set them to the values you see in the following list. If they are not present in the file, add them. Please do a search FIRST before adding them, you may have just missed them scrolling by.
 * under [mysqld]
 * max_allowed_packet = 1000M
 * key_buffer = 256M
 * under [mysqldump]
 * max_allowed_packet = 1000M

Save the file and close it. Restart your MySQL server before proceeding to build the database.

Required Software

 * MySQL server - NO LATER THAN v5.5.x
 * Intermediates: Get XAMPP - XAMPP is your friend, has apache, mysql, php, and lots more, already configured, ready to go with a bit of setup, but they have instructions to help you
 * EXPERTS ONLY: MySQL Server 5.1 (It's recommend downloading the Windows Essentials installer, as it is all that is needed)
 * Crucible v1.6 MySQL conversion from Official DB dump
 * This is the last database update for Crucible: CCP's most recent release of the Database Dump is Crucible 1.6, therefore we use this
 * We keep a watch on CCP's Toolkit site for DB dump updates

Database Setup
Download and install the latest stable version of MySQL 5.5.x or install a whole web server package like XAMPP (recommended) from the links above.

Extract the dowloaded database dump to directory C:\evemu\server\evemu_server\sql. Browse into C:\evemu\server\evemu_server\sql\utils.

If you are on Windows: In the /sql/utils/ directory, Execute merge-ofic-updates.bat.

If you are on Linux: In the /sql/utils/ directory, Execute merge-ofic-updates.sh.

This should create new file called ofic-updates.sql in parent directory sql.

Now, you'll have these .sql files in the /sql directory:
 * cru16-mysql5-v1.sql
 * evemu_dynamic-dump.sql
 * evemu_static-dump.sql
 * ofic-updates.sql
 * prime_db.sql
 * ./evemu-updates/liveupdates.sql

NOTE: cru16-mysql5-v1.sql.sql is the biggest sql and takes the longest to write into the database, over 460 MB import.

Data Import
IMPORTANT: Paths should use / instead of \

First, make sure you put the path to your MySQL 'bin' folder in your PATH environment variable.

Open a command prompt and change directory to the C:\evemu\server\evemu_server\sql directory and run mysql in that prompt like this: C:\evemu\server\evemu_server\sql> mysql -u -p

where   is your mysql database username, then type the password and hit enter. You will see a "mysql>" prompt, now you can create database and source the sql files using instructions below.

You will now need to create the EVEmu database, to do this type at the mysql command prompt: create database evemu;

Now hit enter, it should tell you that was successful by saying: Query OK, 1 row affected. INFO: Don't panic if you get multiple messages like this. It's normal and it usually takes a while to setup. (30 mins or so)

After each query is completed it will display mysql> - at this point simply run the next one.

Automated SQL Setup
To build the database in one command, you first need to copy the "cru16-mysql5-v1.sql" file into the /sql dir of the source, where the other sql files are located.

Open a command prompt IN the sql/ directory so you are local to all the sql files the following script needs access to and run the following command:

evemu_build_database.bat   evemu

'''If this completes without errors, your database is completely setup. Now, proceed to "Final Checking of Database Integrity".'''

Manual Execution of each SQL piece
If you have trouble for one reason or another using the automated setup, then try using these manual steps in the mysql command prompt to setup your database.

Now to import the actual data... to do this you'll need to use the following queries (each line is a separate query - don't execute them all at once!): use evemu; source C:/evemu/server/evemu_server/sql/cru16-mysql5-v1.sql; source C:/evemu/server/evemu_server/sql/ofic-updates.sql; source C:/evemu/server/evemu_server/sql/evemu_static-dump.sql; source C:/evemu/server/evemu_server/sql/evemu_dynamic-dump.sql; source C:/evemu/server/evemu_server/sql/prime_db.sql; source C:/evemu/server/evemu_server/sql/liveupdates.sql;

Final Checking of Database Integrity
There are some final checks on your database that are highly recommended that you perform in order to ensure your database was 100% correctly setup in the previous steps. These are listed below:

InventoryDB::GetItem(..\..\..\src\eve-server\inventory\InventoryDB.cpp:471): Item 61000004 not found
 * 1) Check the AUTO_INCREMENT value in the entity table to make sure it is set to this value: 140000000. If it is not set to that value, change it to this value 140000000. If you do not, you may experience a server crash when you make your first character, so DO check it and set it if it is not the correct value. A common error that you may encounter if you miss this step is something like this in the server console due to the fact that the AUTO_INCREMENT was not set and the last itemID was61000003 or something.

Adding an Account
This is really simple... just type the following: INSERT INTO account (accountID, accountName, role, password, online, banned) VALUES(NULL, 'your_account_name', 5003499186008621056, 'your_password', 0, 0); Simply make sure to replace your_account_name and your_password with what you want your username and password to be!

NOTE: For further reading and reference, the role value indicated in the above query was generated after some research and can be seen in this article on Roles after the Incursion and later table, we've called it "ROLEMASK_GRAVY".

If you are new to MySQL command line, you can try using Navicat Lite http://www.wizdownloads.com/download/Windows/navicat-lite/ it has an easy to use interface.

If you have to REBUILD your Database
If you somehow corrupt your database or the server does it as a result of a crash or wrong SQL query in the code, or you need to rebuild it due to development actions taken that modified SQL files found in the source's /sql directory, here's what we mean by "REBUILD":

REBUILD database: This is simply "dropping" the entire evemu database in mysql, such that the database is completely deleted, as in, the database name is no longer visible or accessible. Then, the database is built again from scratch by first creating a new database with the name you used before, switching to that database and running the "evemu_setup_database.sql" file on it. So, this basically means that you proceed directly to the "Data Import" section above on this page AFTER you have DROPPED your complete database from MySQL either using a MySQL client to do it (phpmyadmin, navicat, MySQL Workbench, etc) or by using the mysql command line as follows: mysql> drop database evemu; '''WARNING: MySQL does NOT prompt you on the command line, when you hit enter, it's too late, no going back. So, if you NEED to backup your database, do an export of the whole thing first.'''

Tweak your MySQL Server Settings for Optimum Performance
Have a look at these articles for advice on how to tweak your MySQL Server settings for optimum performance of your server:
 * What to tune in MySQL Server after installation
 * MySQLTuner-perl script - monitors use of your mysql server over a long time to recommend tweaks to obtain optimum performance

STEP 3.5 - Server Configuration
NOTE: This guide assumes directory structure where you have git cloned the evemu_server project into C:\projects resulting in a path of C:\projects\evemu_server for the source tree.

To get the server up and running correctly, you will need to put various files in the correct places, and make modifications to some of them.

Directory Setup

 * 1) Create a location for your server binaries and cache files, such as C:\evemu_server, create the folders bin, etc, log and server_cache
 * 2) Copy eve-server.exe from C:\projects\evemu_server\build\src\eve-server\Release to C:\evemu_server\bin
 * 3) Copy libmysql.dll and libmysqld.dll from C:\projects\evemu_server\build\mysql-5.x.x-xxxx\lib to C:\evemu_server\bin
 * 4) * An example would be C:\projects\evemu_server\build\mysql-5.5.25a-win32\lib
 * 5) Copy eve-server.xml from C:\projects\evemu_server\utils to C:\evemu_server\etc

File Setup
Browse to C:\evemu_server\log and create empty text file named eve-server.log Browse to C:\evemu_server\etc and create empty text file named log.ini _OR_ use the sample log.ini file in the source code. After that go to C:\evemu_server\etc and open eve-server.xml in your favorite text editor, You will need to change 2 sets of settings separated by <> tags (there are many optional settings to mess around, if you know what you are getting your hands into).

Remember: Every set up is different so use your own setting and don't copy and paste!

We will assume you have followed the previous step of setting up the database and we will go ahead and show an example of the needed changes:

Database Tag Changes
Default: 127.0.0.1 eve eve eve

Example: 127.0.0.1 root password evemu NOTE: You will need to insert your own MySQL username and password

NOTE: Please make sure a password is set or client will stop after trying to connect

Net Tag Changes
Default:

Example(Must be 26000): 26000    26001 localhost 26002</apiServerPort> <apiServer>localhost</apiServer>

Files Tag Changes
Default:

Example: <logDir>../log/</logDir> <logSettings>../etc/log.ini</logSettings> <cacheDir>../server_cache</cacheDir>

The ../log/eve-server.log will contain the text from the eve-server console window. The ../etc/log.ini file contains settings to control how eve-server outputs messages to the log. We need more definition as to what goes in this file. Finally, the ../server_cache directory is where the server will create files for all cached objects when the server starts up.

NOTE: If any cached database tables change during server down-time, you MUST delete ALL cache files in this directory BEFORE starting up the server again. The server does not check to see if the tables changed.

Keeping The Server Updated
The Evemu core updates very often. To keep your server up to date with the current Evemu revision; you must perform a simple core update and recompile.


 * 1) Use your favorite git gui or the git command line to keep your source up to date
 * 2) Re-run CMake just in case new files were added or old files were removed.
 * 3) You must now rebuild you solution to actually see the changes in game.
 * 4) Run the "evemu" sln with C++ and rebuild the solution MUST BE SET ON 'DEBUG' or 'RELEASE' (the question of your choice - for now is just a size of exe file on exit. No any stability or workability differences for now,except of some crashes,caused by svcerror and beancount errors on release binary.

Windows
Then you should be able to run eve-server.exe to start the server. The server log will be stored in C:\evemu\log\eve-server.log if you need it. Wait for the message : "Init Done" before initiating any action associated with the server(Even opening a client). See here for an old forum thread that discusses eve-server restart scripts in the cases where the server crashes, somewhere down the page is a script for windows.

Linux
You can just run the eve-server executable in your build directory, or you can use a script to run it, even to restart it if it ever crashes. Here is a forum thread that lists several different scripts on how the eve-server can be restarted if it crashes.

FAQ
You will find it under Crucible FAQ

= Crucible Development =

Information will be soon here.

Building a Binary Distribution Package
TBD

= Crucible Known Issues =

[FIXED] == Undocking == There are some cases when the location is not stored in the Data Base and when you try to undock it will give a DB error in server log.
 * Workaround - Just select another station from the top left menu and transolacate there (tr command in right click menu) or choose another system from the map and do the same.

Right click on ship not responding

 * Workaround - Just undock and re-dock and this issue will go away.