Loading...   

[Show Table of Contents]


§Complete Windows-based Server Setup Guide (Windows 7+)

  • Credits: This guide is an updated one based on previous work by Huppy, Sorvani, Veteranwizard, Derision as well as JJ and perhaps a number of other helpful folks that are undocumented.
  • This guide is for technically minded people (even beginners) however it is NOT assumed that you have any prior knowledge of programming or databases.
  • Please read this guide carefully as there are ongoing changes occuring to it.
  • EqEmulator no longer builds on Windows XP. It will build on Windows 7 onwards, in both 32 and 64 bit.
  • Last Updated: 20th April 2017

 

WARNING - PLEASE READ FIRST!

  • If you don't want to be on the bleeding edge, please read this thread first Windows Server Installer where you can get precompiled binaries.

 

§WARNING - PLEASE READ SECOND!

One of the biggest reasons some people end up with problems is because they missed something in the guide they are following, we have all done it at one time or another. Please make sure you're not just skimming over the text written here. If you read each and every single line in the following steps before moving on to the next one, you will end up with a working server. If you get an error in your setup, you missed something or changed something you weren't supposed to. Go back and retrace your steps. One single mis-typed character can cause your server not to start, run, or connect to the public server list.

§Overview - The Main Components

  • Whilst we talk about a "server", it is really a system - a number of components that are linked together in order to provide a service.
  1. The actual server that does all the processing (combat, keeping track of movement etc). Note that the server is actually a collection of programs rather than a single application (this will make more sense later).
    1. These are known as (Note the below is simply informational):
      1. world.exe - Listens on port 9000 - Handles all of the handoffs from the Loginserver
        1. Handles a lot of interserver traffic with zones/tells grouping etc.
      2. zone.exe - Listens on ports specified in the eqemu_config.xml , this is normally set on ports 7000-7500.
        1. This is responsible for all dynamic and static zones that players play in
        2. You could have as many zone processes running as you need zonese for your player count
      3. ucs.exe (Optional) - This is for both Chatserver and Mailserver - these used to be separate processes back in the day
        1. The configuration for ucs.exe resides in eqemu_config.xml and
      4. queryserv.exe (Optional/Required) - This is used for off-thread processing of optional logging - You do not need to use this to get a server going initially
  2. The Database
    1. Without the database the server does not know about items, spells, NPC's, or even zones.
    2. This is where information is read/written using the MySQL database engine which you will install later. Imagine a ton of tables like an Excel spreadsheet where information is constantly read/written from the server binaries (World.exe/zone.exe/ucs.exe etc)
  3. Maps
    1. Not to be confused with in-game maps. For every zone the server has a map file that tells it what the zone looks like (so it can ensure you don't fall through the world etc.
    2. Maps are also used for zone.exe to be be able to calculate Line of Sight for NPC's and players so casts can't go through walls, NPC's don't path through walls etc.
  4. Quests
    1. Most quests (not to be confused with Tasks -link-) are written in the Perl or Lua language.
    2. Perl and LUA are two different scripting languages that allow people to customize their server and scripts 'On the fly' so you can heavily customize the events on your server
      1. For later down the road, here are the master Perl and LUA References:
        1. Ultimate Perl Reference
        2. Ultimate LUA Reference

§Setup Method

  • If this is your first time, you almost certainly want to set up the Project EQ  database. This will give you all the zones we know and love (at the time of writing up to and including the GoD expansion), items, races and so on, so you can login to your new installation and actually see it working.
  • The EqEmu elements you require are currently stored in a number of places. The main EqEmu Server content is hosted on GitHub (eqemu.github.com) and requires a program called Git  to download.
  • The stages are as follows:-
  1. Setting up a folder structure.
  2. Gathering all the prerequisite tools and libraries.
  3. Installing required tools.
  4. Compiling the server.
  5. Fetching EqEmu specific data files (quests, database, maps etc).
  6. Downloading, installing and updating the PEQ database.
  7. Editing your server configuration and launching your server.
  8. Checklist
  9. (OPTIONAL) Install the Peq Editor.

§Step 1: Setting up a folder structure

  • Make a folder on your C drive called EQ.
C:\EQ
  • Make a folder inside the EQ Folder called Installs, this folder will have all the files you need to install to compile and run the server.
C:\EQ\Installs
  • Make a folder inside the EQ Folder called EQEmuServer, this folder will be where the actual game server runs from.
C:\EQ\EQEmuServer
  • Make a folder inside the EQ\EQEmuServer Folder called shared, this folder is required for "shared memory"
C:\EQ\EQEmuServer\shared
  • Make a folder inside the EQ Folder called SQL, this folder will be where you save database files and scripts to be sourced in to the database.
C:\EQ\SQL
  • Make a folder inside the EQ Folder called Source, this folder will be where you clone/download the C++ source code to.
C:\EQ\Source

§Step 2: Gathering all the prerequisite tools and libraries.

  • There are specific instructions to installing and configuring Perl, MySQL and Visual Studio Community 2017 in this guide. Read each section completely prior to installing everything. These instructions are using 32-bit versions of Perl and MySQL because the method is tried and works without errors. You can compile a 64-bit server, but that is not part of this guide - there is no real benefit to using 64 bit versions in EQEmu at his time. Unless you are an experienced EQEmu developer (who wouldn't be using this guide anyway), use 32 bit versions only.
  • Some parts of this process require you to open tar/gzip files. Windows can not extract these files natively, so you will have to install a 3rd party program to extract these files. 7-Zip  is free (not trial-ware like WinRAR) and works for everything you need and it is available here. Feel free to use whatever application you are comfortable with.

§a)  Download Perl (Scripting Language)

  • Download the 32-bit version of ActiveState Perl 5.12.3 (here) and put it in the C:\EQ\Installs directory.
  • Note that it is vital you download this particular version. No other version will work.

§b) Download MySQL

  • There are two methods to this. One is to manually download and install MySQL, the other uses XAMPP (link) to install. The bonus for the latter method is if you want to install the Peq Database Editor tool (and most people will want to), then you will most likely need to install XAMPP anyway!

§Method 1

  • Download the Windows (x86, 32-bit), MSI Installer version of MySQL Community Server here  and put it in the C:\EQ\Installs directory.
  • The current version as of April 2, 2014 is 5.1.73. DO NOT download the essentials version (it does not have the required developer components). Download the one called mysql-5.1.73-win32.msi . When you click on the download page it asks you to register - you do not need to. At the bottom of the page is a link that says "No thanks, just start my download". Use that link.

§Method 2

  • Download the latest XAMPP. This guide was written using the "7.1.1 / PHP 7.1.1" version xampp-win32-7.1.1-0-VC14-installer.exe. Simply install XAMPP using the defaults but ensure PHP and MySQL are included, and remove Perl from the list as you will install it yourself.

§c) Download Visual Studio Community 2017 for Windows Desktop (Windows 7+)

  • Download Visual Studio Community 2017 For Windows Desktop (note: Only Visual Studio Express 2015 and newer will work with EQEmu) and put it in the C:\EQ\Installs directory. The download should automatically start. Note this one is only a simple web installer package. It will download more when you run it. The latest version of Visual Studio requires Windows 7 or above.

§d) Download TortoiseSVN  <-- No longer used.

  • Download the current version of TortoiseSVN. If you have a 64-bit OS, download the 64-bit version. Be careful that you don't click the Download button that is in an advert, as that will try and force you to install a crapware toolbar that you probably don't want. The correct download button should download an .msi file which you should place in your C:\EQ\Installs directory.

§e) Download GIT for Windows. 

  • Download the current version of GIT for Windows. In the upper right of the download page there should be a picture of a monitor showing the latest stable release and a 'Download for Windows' button.

§f) Download CMAKE. 

  • Download the Windows (Win32 Installer) version of CMake here and copy it to your C:\EQ\Installs directory.

§g) (Optional) Download Notepad++

  • Download the current version of Notepad++ here.

§h) (optional) Download HeidiSQL 

  • Download the current version of HeidiSQL here and save it in the Installs directory.
  • Note that HeidiSQL is not required for this guide, however you will find it useful for editing the SQL database once you have the server up and running. If you are already comfortable using MySQL you can use HeidiSQL in place of the command line MySQL tool that is used throughout this guide.
  • If you are already familiar with another product (such as Navicat) then go ahead and use that instead. http://www.navicat.com/

§3. Installing required tools.

  • NOTE: The following steps install the programs that you downloaded and copied to your C:\EQ\Installs directory in the previous steps.

§a) Install ActiveState Perl

  • During the installation of Perl, change the installation path to C:\Perl if it is not already set to that. Otherwise, accept all the defaults.
  • When Perl is finished installing, you must reboot your PC to ensure the changes to the Windows PATH variable are updated before proceeding further.
 

§b) Install MySQL 5.1

§Method 1 - Not using XAMPP

  1. When you first start up the install, make sure you choose CUSTOM install.
  2. On that same menu, make sure ALL options are installed. The developer components will probably have an X against it. Click it and select 'This feature will be installed on local hard drive'. This is important, you will not be able to compile the EQEmu source code without the MySQL developer components.
  3. After clicking "next", on that menu, click Install
  4. If a Nag screen appears about MySQL Enterprise, click Next until a dialog appears with a box that says 'Configure the MySQL Server now'. Ensure the box is ticked and click Finish.
  5. The MySQL Server Instance Configuration Wizard should start. If you don't see it, make sure it is not hidden behind another window. Click Next.
  6. Select Detailed Configuration and click Next.
  7. Choose 'Server Machine' and click Next.
  8. Choose 'Multifunctional Database' and click Next.
  9. When the InnoDB settings dialogue appears, click Next.
  10. Select 'Online Transaction Processing (OLTP)' and click Next.
  11. On the next screen, ensure 'Enable TCP/IP Networking' is ticked, the port number should be 3306 and UNTICK 'Enable Strict Mode'. Then click Next.
  12. On the next sceen, select 'Best Support For Multilingualism' and click Next.
  13. On the next screen, ensure 'Install as a Windows Service' is ticked and, very important, tick the box to 'Include Bin Directory in Windows PATH'. Then click Next.
  14. You will be prompted for a root password (root is the default username). This will be known as your MySQL password. Make sure you remember it. Click Next.
  15. Click Execute.
  16. When the wizard has done it's thing, click Finish.
  17. You should either logoff/logon or reboot your PC to ensure the changes to the Windows PATH variable are updated before proceeding further.

§Method 2: Using XAMPP

  • XAMPP is used because it is a good all-in-one package which includes MySQL, Apache, PHP, and Perl. For XAMPP installation, it is recommended you (temporarily) disable virus protection and UAC. On one PC (Windows 7 Enterprise with McAfee) I did not need to do this. On another PC (Windows 7 Home with AVG), installing with both enabled resulted in only MySQL working (and if you want to edit the database later you will likely want Apache/PHP installed to use the PEQ Editor).
  • After installing this way, it will save you tons of typing if you add MySql to your "Path":-
§Adding MySql to your "Path" Windows 7
  1. Find out where mysql.exe is located on your machine (using XAMPP mine is in C:\xampp\mysql\bin ) 
  2. Click on the Windows start icon.
  3. Right click on "Computer" then select "Properties".
  4. Click on "Advanced System Settings" on the left hand side.
  5. On the dialogue that pops up, under "Startup and Recovery" will be a button called "Environment Variables". Click on it.
  6. Under "System Variables", scroll down and find the variable called "Path", click on it to select it and then click on "Edit".
  7. Click on the text box next to "Variable value" and scroll to the end (the "End" key is the quickest way to do this)
  8. Type in a semi colon ;
  9. Paste in the location you found in #1
  10. Press OK, OK and then OK.
§Adding MySql to your "Path" Windows 10
  1. Find out where mysql.exe is located on your machine (using XAMPP mine is in C:\xampp\mysql\bin ) 
  2. Click on the Windows start icon then select System
  3. Scroll down to the section Related Settings and select System Info
  4. Click on "Advanced System Settings" on the left hand side.
  5. On the dialogue that pops up, under "Startup and Recovery" will be a button called "Environment Variables". Click on it.
  6. Under "System Variables", scroll down and find the variable called "Path", click on it to select it and then click on the "Edit" button.
  7. Each member of the path variable will have it's own line that you can manipulate with the buttons on the right side ow the window.
  8. Click on the "New" button and paste in the location you found in #1
  9. If you previously had MySql installed separately and uninstalled it, it may have left the path old path variable.  If you find it, use the "Delete" button.
  10. Press OK, OK and then OK.
  • FINALLY you will need to set up your root password. 

Open a command prompt and type in:-

mysql -uroot

then type in:-

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your_pasword');

Changing your_password to the password you want to use.

§c) Install Microsoft Visual Studio Community 2017 for Windows Desktop

  • You can just install this with all the default installation. Nothing to do until after installation is complete. 
  • Now install any service packs or updates to your version of Visual Studio. windows Update should pick this up, however you should check "Optional Updates" as they might not be considerd a critical update.

§d) Install GIT, CMake, HeidiSQL and Notepad++ using defaults (click yes or next to everything)

 

 

§Step 4: Compiling the server.

§a) Get (Git) the source code!

  • Now on your main C-Drive, expand the EQ folder and then right click on the folder called Source.
  • From the menu that pops up, select 'GIT Bash'.
  • A command window should pop up (similar but not the same as the standard Windows command prompt).
  • Type the following EXACTLY (including the period at the end):
git clone git://github.com/EQEmu/Server.git .
 
  • *Note the . at the end of the command*, i.e. there is a space after Server.git and then a period/full-stop. This is important. It tells GIT to clone the source code into the current folder , i.e. C:\EQ\Source If you omitted the . it would create a new folder called C:\EQ\Source\Server and download the source into that. 
  • The output of the git clone command should look similar to this:
 
Cloning into '.'...
remote: Counting objects: 1288, done.
remote: Compressing objects: 100% (1070/1070), done.
remote: Total 1288 (delta 225), reused 1262 (delta 199)
Receiving objects: 100% (1288/1288), 3.17 MiB | 856 KiB/s, done.
Resolving deltas: 100% (225/225), done.
Checking out files: 100% (1181/1181), done.
  • If you go to C:\EQ\Source in Windows Explorer, you should see a bunch of files and sub-folders have appeared, namely
  • CMakeLists.txt LICENSE.md cmake eqlaunch ucs zone shared_memory README.md common loginserver utils GPL.txt changelog.txt dependencies queryserv world
  • Note that if you want to update your source code in the future to the latest version, follow the process above, but instead of typing 'git clone ...' you would just type:
git pull
 
  • and that would check for updates to the source code and download the latest version if there have been any changes since you last did a git clone or git pull.
  • you should create a working branch to avoid making changes to the master file versions type: git checkout -b MyServer

§ 

§b) Download the additional dependencies

  • EqEmu uses libraries made by other people that aren't integrated into the source code directly, so we need to fetch those. Download the additional dependencies from github.io - first fetch WindowsDependencies_x86.zip and unzip them into C:\EQ\Source\dependencies
  • If you do it correctly, you should have six folders underneath C:\EQ\Source\dependencies:
  1. boost (e.g. C:\EQ\Source\dependencies\boost\boost)
  2. libsodium
  3. luaj_x86
  4. mysql_x86
  5. openssl_x86
  6. zlib_x86.
  • You can download your dependencies for x86 (32 Bit) from GITHUB HERE

§c) Use CMake to build the required Visual Studio Solution and Project files

  1. Create the folder C:\EQ\Source\Build
  2. Launch your CMake program, typically labeled CMake (cmake-gui). Eg: Start -> CMake 3.8 -> CMake
  3. To the right of the 'Where is the source code' box, click 'Browse Source' and expand the tree, C:\EQ\, click once on Source and then click OK, so the entry in the 'Where is the source code' box should read C:/EQ/Source/
  4. To the right of the 'Where to build the binaries box', click 'Browse Build', expand the tree down to C:\EQ\Source\. click once on Build and then click OK. The 'Where to build the binaries box' should now have C:/EQ/Source/Build in it.
  5. Click on the Configure button.
  6. In the next dialogue that says 'Specify the generator for this project', select 'Visual Studio 15 2017' if you arte using Visual Studio Express 2015, "Visual Studio 14 2015". Click on Finish.
  7. Some messages should appear in the lower window with hopefully no errors.  If the cmake backround has any 'red' then click on the Configure again until the backgroud is all white.
  8. Ensure you tick EQEMU_BUILD_LUA then click on Configure again.
  9. (OPTIONAL) If you don't want to use the new communication packet encryption then untick EQEMU_ENABLE_SECURITY and then click the Configure button until there is no red.
  10. (OPTIONAL) If you want to use 'Bots' on your server, click the box next to EQEMU_ENABLE_BOTS and then click Configure again.
  11. (OPTIONAL) If you want to run your own local login server (useful if you want to work on your server disconnected from the internet- on a laptop, for example) then tick EQEMU_BUILD_LOGIN.
  12. Click on Generate and CMake should say 'Generating done' in the output window. You can now close CMake. 
  • Note: If you get to step 12 with any Red entry lines, you will need to click Configure again before clicking Generate or those options will not be set.

§d) Build the executables using Visual Studio

  • In Windows explorer, navigate to C:\EQ\Source\Build and double-click on EQEmu.sln (if you don't see the .sln suffix, it is the file named EQEmu that has a Type of 'Microsoft Visual Studio Solution'.
  • Microsoft Visual Studio Community 2017 should open up. On one side of the window you should see the 'solution explorer' with an entry called ALL_BUILD.
  • Right-click on ALL_BUILD and select Build.
  • This will take a while. It will produce a (metric) ton of warnings in the output window, which you can safely ignore. When it is finished you should see a message saying:
 
========== Build: 14 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  • The number of succeeded items may change, depending on what you selected to build. The important thing is there should be no failed!
  • If you do not see that message at all, select Debug>Windows>Output from the top menu. This will show the output window. At the top of this window it will say "Show output from:" and there will be a drop down box next to it - select "Build".
  • If you do get failures then- you know those warnings I told you to ignore...? Click in the output window then click save - it will auto populate the "Save File As" dialogue with "Output-Build.txt". The contents of this file are really important in finding what the real problem is - if you post on the forum asking help in compiling then please copy and paste this output in between a [CODE][/CODE] tag.
  • If you get "Incompatible project" next to each project, you probably downloaded "Visual Studio 2013 for Windows".
*NOTE*
If the build was successful, (0 failed), you DO NOT have to re-build just because you have future problems. The rest of the setup is copying files, sourcing your database and configuring your server. The database and the server are two separate things. Your config files will help connect the two when your server is finally up and running.

§e) Copying the executables to your server directory:-

  1. First go into the C:\EQ\Source\Build\Bin\Debug folder and copy at least the following files:
shared_memory.exe, eqlaunch.exe, queryserv.exe, ucs.exe, world.exe and zone.exe to your C:\EQ\EQEmuServer folder.
 
You may also copy ALL the .pdb files from C:\EQ\Source\Build\Bin\Debug to C:\EQ\EQEmuServer although this isn't strictly necessary. If EQEmu crashes and you have the .pdb files present in C:\EQ\EQEmuServer a crash report will be produced saying exactly whereabouts in the code the crash occurred. This can be useful when reporting crashes on the forums. Personally, I would recommend copying them all.
  1. Next, go to your C:\EQ\Source\utils\patches folder and copy all the files from there to your C:\EQ\EQEmuServer folder.
  2. Then, go to your C:\EQ\Source\utils\defaults folder and copy all the files and sub-folders from there to your C:\EQ\EQEmuServer folder.
  3. Finally, unless you have installed the full version of Lua 5.1 on your machine (there is no reason to do so in order to get EqEmu working), copy lua51.dll from the C:\EQ\Source\dependencies\luaj_x86\bin folder to your C:\EQ\EQEmuServer folder. IF YOU DO NOT DO SO YOU WILL BE PROMPTED THAT lua51.dll IS MISSING FROM YOUR SYSTEM WHEN YOU RUN Zone.exe (see later).
  • Note: The final sub-folder for the binaries location may not be '\Debug' - depending on the build type selected.

§Step 5: Fetching EqEmu specific data files - maps and quests

§a) Quests

  • In your C:\EQ\EQEMuServer server folder, create a new folder C:\EQ\EQEMuServer\projecteqquests
  • right click on the folder called \projecteqquests
  • From the menu that pops up, select 'GIT Bash'.
  • A command window should pop up (similar but not the same as the standard Windows command prompt).
  • Type the following EXACTLY (including the period at the end):
  • git clone git://github.com/ProjectEQ/projecteqquests.git .
  • you should create a working branch to avoid making changes to the master file versions, type: git checkout -b MyQuests
 

§b) Maps

  • In your C:\EQ\EQEMuServer server folder, create a new folder C:\EQ\EQEMuServer\EQEmuMaps
  • right click on the folder called \EQEmuMaps
  • From the menu that pops up, select 'GIT Bash'.
  • A command window should pop up (similar but not the same as the standard Windows command prompt).
  • Type the following EXACTLY (including the period at the end):
  • git clone git://github.com/Akkadius/EQEmuMaps.git .
  • you should create a working branch to avoid making changes to the master file versions, type: git checkout -b MyMaps

§ 

§c) Copying quest plugins

  1. Go to the C:\EQ\EQEmuServer\quests\plugins folder and copy all the files in there to the C:\EQ\EQEmuServer\plugins folder.You may get a warning that the file check_handin.pl already exists. Select the option to overwrite the file.
  2. Copy the C:\EQ\EQEmuServer\quests\lua_modules folder to the C:\EQ\EQEmuServer\lua_modules folder.​

§d) Verifying that you have copied all the files into your server directory.

In your eqemu (server folder) there should be 8 folders.
 
  1. logs (this will be empty right now)
  2. Maps (full of all the map files you downloaded)
  3. plugins (has all the plugin files you copied from /quests/plugins folder)
  4. lua_modules (has all the lua files you copied from /quests/lua_modules folder)
  5. quests (has all the quests you downloaded.)
  6. templates
  7. updated_templates
  8. shared
Aside from those 8 folders, you should have 21 other files in your server folder.
 

§Step 6: Downloading, installing and updating the PEQ database

§a) Download it

  • Currently you must download the latest database from the following location (you will get redirected to a Google Drive folder):
http://peqtgc.com/releases
  • The filename will be something like:-
peqbeta_{Date_and_Time}.tar.gz 
  • where {Date_and_Time} is actually the time it was generated e.g  peqbeta_2015-08-12
  • WARNING! The Oct 11 2014 PEQ database peqbeta_2014-10-11-02:01.tar.gz is broken. Use the peqbeta_2015-08-12-02_01.tar.gz one instead!
  • Next, go to the folder C:\EQ\SQL and unzip the file.
  • If double-clicking on peqbeta_{Date_and_Time}.tar.gz  does not launch 7-zip or your preferred unzipper, you may need to launch 7-manually (possibly using 'Run as Administrator' and go into the settings/options and tell it to associate it with .gz files).
  • Once you have the file opened with 7-zip, select extract and extract it to C:\EQ\SQL. It may just unzip to a file called peqbeta_{Date_and_Time}.tar. You  then have to unzip *that* file, and inside are the files you really want.
  • There will be approx 11 files, one of which will be Readme.txt. I would advise reading that text! It will be updated whenever the database is (unlike this guide), and may have information that override what you read here. Copied from the current Readme:-

What do these files all do?
 
eqtime.cfg - This is the EQEmu time file, and is required to make sure your server is in sync with PEQ. If it isn't, spawns that depend on time of day will not work properly.
data_tables_.sql - Contains the newest commands, launcher, rule_sets, rule_values, and variables tables. This is not required for fresh installs, but is recommended for upgrades.
drop_bots.sql - Use this if you want to remove bots from the DB.
drop_system.sql - Drops the content tables of your DB (items, spells, spawns, faction, zone data, doors, objects, etc)
load_login.sql - Loads the tables required to run a local login server. This is not required if you are using the public EQEmu server.
peqbeta_.sql - This is the actual PEQ database. It contains all the content we are developing.
player_tables_.sql - For fresh installs ONLY. This contains the player tables (character_, accounts, inventory, etc) and also the data tables (commands, launcher, rule_sets, rule_values, and variables.)
source_views.sql - Not used by us atm, it's for merc support.   
 
TIP:
  • Some of the tables will have the timestamp in the file name, and in later steps this will be a PITA. I would recommend removing the timestamp so "peqbeta_2014-04-01-02_01.sql" would become "peqbeta.sql", "player_tables_2014-04-01-02_01.sql" would become "player_tables.sql" and so on. Maybe I'm just lazy though!

§b) Sneaky thing you need to do that isn't much to do with the database!

  • Copy eqtime.cfg that was stored with the Peq database into C:\EQ\EqEmuServer\ (where your binaries are stored).

§c) Now it is time to create the database.

  • The following assumes you have used my tip to rename the files to something easier to type!
  • Launch a command prompt window and navigate to your C:\EQ\SQL folder by typing:
cd c:\EQ\SQL
 
  • Then enterC:\EQ\SQL>mysql -uroot -ppassword where password is the password you chose when installing MySQL.
  • You should be presented with a mysql> prompt. If you do not, and it says it cannot find "mysql" please refer to (link) Adding MySql to your "Path"
  • Assuming you are now logged in, you can now create your database.
Type: 
create database peq; 
and press enter.
 
  • The following ensures any commands you use next will apply to this new database:-
Type: 
use peq; 
and press enter.
 
  • Note: Now that the database is created anytime you need to login to MySQL in the future, you can do it with a single line command:
 
mysql -uroot -pyourpassword peq
 
Type: 
source peqbeta.sql;
and press enter.
 
This may take a while to complete, depending on how powerful your PC is.
 
When the mysql> prompt returns:
 
Type: 
source player_tables.sql;
and press enter.
 

(OPTIONAL) If you plan on using mercenaries, follow this seperate guide located here.

 
Finally, type 
exit
and press enter to return to the command prompt.
 
(OPTIONAL) If you plan on using Bots
  • You must configure your eqemu_config.xml file, as detailed in Step 7 below, before performing the next steps.
  • change directory to C:\EQ\EQEmuServer
  • run the commands:
  • C:\EQ\EQEmuServer>perl eqemu_server.pl
  • Enter a command #> database
  • Enter a command #> check_bot_db_updates
  • Enter a command #> check_db_updates
  • Enter a command #> exit

 

§d) Database Updates (Applying)

Important : You must configure your eqemu_config.xml file, as detailed in Step 7 below, before performing these steps.

  • If you did not add the (OPTIONAL) Bots above:
    • change directory to C:\EQ\EQEmuServer
    • run the commands:
    • C:\EQ\EQEmuServer>perl eqemu_server.pl
    • Enter a command #> database
    • Enter a command #> check_db_updates
    • Enter a command #> exit
  • World.exe now has a built-in auto-update feature that will update your database to the current requirements of the server code.
  • This feature is called every time that world.exe is started.
  • start world.exe manually to update the database to your current code build.  This is just to update the database to the current level.  Do not run the start.bat file you created below.
    • C:\EQ\EQEmuServer>world.exe
  • close the world.exe window when it's completed.
 
  • For people who run their server offline, you will need to recompile and start world.exe before disconnecting from the internet or the updater will mark your database as updated and no changes will be applied. If this does happen to you, or if you manually transfer code to an offline computer, you will need to install any required updates by hand.
  • Note: The manual database update requirement only applies to a very small group of people and should not be performed for a 'standard' server configuration. Manually applying older scripts to an updated database will likely cause MySQL errors or server crashes. At the very least, you will have data loss and abherent server behavior.
 

(The following is kept for reference only)


Warning :  Currently a lot of the database code is being rewritten and the database itself is evolving. You MUST apply the following steps.
 
  • The next stage is to apply SQL updates to your database so that it is compatible with your version of the EQEmu source code/executables
  • In Windows Explorer, navigate to the C:\EQ\Source\utils\sql\git folder
  • In this folder are two sub-folders, one called required, and one called optional. As the names suggest, any .sql files in the 'required' folder must be applied. The ones in the 'optional' folder are ... optional.
  • In each sub-folder, there may be .sql files with names like: 
YYYY_MM_DD_Desc.sql
 
  • Anything in the "required" subfolder is essential. Anything in optional is... optional.
  • You are going to need to 'source in' those that were written later than your copy of the PEQ database. So for example, if your database is from the 1st April 2014, find every .sql file that is dated later than the 1st of April 2014 and source it in.

NOTE: The PEQ database dump from the 11th August 2014 must have all required updates applied starting from 2014_07_10_npc_spells.sql and upwards.

  • Back to our example though, make a note of the names of all the .sql files with a date newer than 1st April 2014.
 
Back in your command window, navigate to the C:\EQ\Source\utils\sql\git\required folder, 
i.e. cd C:\EQ\Source\utils\sql\git\required folder.
 
type
mysql -uroot -p
Enter your MySQL password
 
  • When the mysql prompt appears:
 
type
use peq;
and press enter
 
Then, for each of the .sql files you made a note of, starting with the lowest dated one and proceeding in sequence, enter:
source insert_file_name_here.sql
and press enter.
 
Eg. . using PEQ database from the 19th August 2014 and the latest source from 27th August 2014, you would type:
 
source 2014_08_20_merchantlist_probability.sql
source 2014_08_24_character_lookup.sql
and press enter.
 
At the time of writing (18th September 2014) you should source the following files:-
 
2014_07_10_npc_spells.sql
2014_08_02_spells_new.sql
2014_08_12_NPC_raid_targets.sql
2014_08_18_spells_new_update.sql
2014_08_20_merchantlist_probability.sql
2014_08_23_Complete_QueryServ_Table_Structures.sql
2014_08_23_player_events_and_player_aa_rate_hourly.sql
2014_08_24_character_lookup.sql
2014_09_09_attack_delay.sql
 

§(OPTIONAL) Backup your database

Once you have your database updated fully, BACK IT UP !!!
That is easily done without even logging in to your mysql.
  1. Create a folder on your C-Drive (or wherever), called backup
  2. Then in a command window, simply type the following:
 
mysqldump -uroot -ppassword peq > c:\EQ\peq_backup.sql
 
  • Then if you ever have to re-install everything, you can easily source your whole database back in by typing the following: (make sure your in that same backup folder)
mysql -uroot -ppassword
drop database peq;
create database peq;
use peq
source C:\EQ\peq_backup.sql

 

§Step 7: Editing your server configuration and launching your server

§a) (OPTIONAL) Port forwarding on your router (if you're using one)

  • Port forwarding is required if you want to allow other people out on the Internet to play on your server. If you are only intending for yourself or other people on your local LAN to connect, then this step is not necessary.
  • Log in to your router and you need to forward the following ports to the internal ip of your server computer.
    • UDP 7000 to 7100 (Port Range Forwarding is essential for this)
    • UDP 9000
    • TCP 9001
  • NOTE: Windows also has a Firewall that will block these ports #'s into your computer if you are using Windows. You will need to create Windows Firewall exemptions, or allow world.exe/zone.exe/ucs.exe as a list of approved programs
  • To find out the internal ip of your computer, at a command prompt type ipconfig. The 192.168.1.xxx number that is listed is the forwarding IP you need.
  • Every router is different, so if you don't know how to log in to it, then you will have some searching to do without the manual.
  • Most commonly, a web browser is used, typing in an address like 192.168.1.1

§b) Editing your server configuration - eqemu_config.xml

  • In your C:\EQ\EQEmuServer folder, you will have two xml files in there, one called eqemu_config.xml and another called eqemu_config.xml.full .You don't need both of these. DELETE the eqemu_config.xml and keep the other one. Rename eqemu_config.xml.full to eqemu_config.xml by REMOVING the .full at the end of it. (The .full xml file is a more complete config)
  • You must now edit the config file or your server will not work. The following wiki page has a full explanation of the file and what it's contents mean http://wiki.eqemulator.org/p?eqemu_config.xml&frm=Main , please follow that page as to how to edit your config file and then return to this page to move onto step 7. c)

§c) Creating a batch file to launch the server

  • Now you can make a start.bat file to put in your server folder with the following lines:
@echo off
title Start EQEmu
echo.
echo.
echo   *******************************************************
echo   *                                                     *
echo   *    Enter 1 to copy all of the EQEmu server files    *
echo   *    Enter 2 to copy just the new EXE and PDB files   *
echo   *                                                     *
echo   *******************************************************
echo.
set /p useExisting=
if %useExisting%==2 goto :JustEXEPDB
echo.
echo   Getting the EXE's...
copy /Y C:\EQ\Source\Build\bin\Debug\*.exe C:\EQ\EQEmuServer\ >nul
echo   Getting the PDB's...
copy /Y C:\EQ\Source\Build\bin\Debug\*.pdb C:\EQ\EQEmuServer\ >nul
echo   Getting the Patch Files...
copy /Y C:\EQ\Source\utils\patches\*.* C:\EQ\EQEmuServer\ >nul
echo   Getting the Quest Files...
xcopy C:\EQ\EQEmuServer\projecteqquests\*.* C:\EQ\EQEmuServer\quests\ /EQY >nul
echo   Getting the Plugin Files...
copy /Y C:\EQ\EQEmuServer\quests\plugins\*.* C:\EQ\EQEmuServer\plugins\ >nul
echo   Getting the LUA Files...
copy /Y C:\EQ\EQEmuServer\quests\lua_modules\*.* C:\EQ\EQEmuServer\lua_modules\ >nul
echo   Getting the Map Files...
copy /Y C:\EQ\EQEmuServer\EQEmuMaps\maps\*.* C:\EQ\EQEmuServer\Maps\ >nul
goto :StartEQEmu

:JustEXEPDB
echo.
echo   Getting the EXE's...
copy /Y C:\EQ\Source\Build\bin\Debug\*.exe C:\EQ\EQEmuServer\ >nul
echo   Getting the PDB's...
copy /Y C:\EQ\Source\Build\bin\Debug\*.pdb C:\EQ\EQEmuServer\ >nul

:StartEQEmu
del /s/q C:\EQ\EQEmuServer\logs\*.* >nul
cd C:\EQ\EQEmuServer\
echo.
shared_memory.exe
start world.exe
echo.
echo   Waiting for the World to finish loading...
ping -n 6 127.0.0.1 >nul
start queryserv.exe
start ucs.exe
start eqlaunch.exe zone
exit
  • Then create a shortcut on your desktop to run this file.

§Launching your server for the first time

  • OK, If you've done all that, been there and back again, and your 300% sure that you followed these steps exactly, crossed all t's and dotted all i's - Your done.
  • Before you click on that Start.bat file, a couple things to know. When you run start.bat, a new command window with the title C:\EQ\EQEmuServer\world.exe should appear.
  • After 10 seconds, three more command windows should appear with the following titles:
C:\EQ\EQEmuServer\eqlaunch.exe
C:\EQ\EQEmuServer\queryserv.exe
C:\EQ\EQEmuServer\ucs.exe
If one or all four of the windows does not appear then the corresponding program failed to launch for some reason. Launch a new command prompt window and navigate to C:\EQ\EQEmuServer
and run the command manually, e.g. type
world.exe
and press enter.
 
  • This will display any error messages that is causing the program to fail to start. You should look at the errors and go back over the guide to see if you can figure out what you did wrong. If all else fails, make a post on the EQEmu forums asking for assistance.
  • *NOTE* - Your server places it's log files in the logs folder. This is where you look for troubleshooting problems.
  • After you have run start.bat and you have the four windows displayed you can now log in the EQEmu public logon server, find your server in the list and login to it.

§Creating your first character and giving yourself GM power

  • Assuming you are able to log in to your server successfully and create a character, you probably want to give your account GM powers. The easiest way to do this is to open a command prompt, navigate to C:\EQ\EQEmuServer and then type:
world flag your_account_name 250
 
e.g.
world flag Derision 250
 
  • This will flag your account with status 250.
  • At this point you can now lock your server so that nobody else can log in to it. To do this, edit your eqemu_config.xml and change this line:

to

  • This is removing the XML comments around that line.
  • Then restart your server, i.e. Ctrl-C all the running command windows and then run start.bat again.
  • When you log in next, your server should have a status of 'Locked', but since you have GM status, it will let you log in anyway.

§ Using a Private Login Server instead of the Public server

§Restricting Access to GM Commands

  • Besides the usual commands available in everquest that begin with a '/', e.g. /say, there are additional commands available in EQEmu that begin with a '#'.
  • These are mostly commands for GMs, e.g. #zone, #repop etc. although some are available to normal players, e.g. #undyeme
The access to these # commands is determined by 'account status' which is set as described above using the
world flag
  • Each # command has a 'default' status that is required to use it which is set in the source code. This required status is overridden by the value assigned to the command in the commands table in the MySQL database. If you want to prevent normal players (who usually have a status of 0) from using a command, set the status for that command to > 0 in the commands table. Likewise, to give a player access to a command that they can't usually access (e.g. #zone), set the status for that command to 0 in the commands table.

§8. CHECKLIST

[ ] Set up a folder structure
[ ] Downloaded and installed Perl
[ ] Restarted my PC after installing Perl
[ ] Downloaded and installed MySQL
[ ] Downloaded and installed Git
[ ] Downloaded and installed TortoiseSVN
[ ] Downloaded and installed CMAKE
[ ] Downloaded and installed Microsoft Visual Studio Express 2013 for Windows Desktop (Windows 7+), or Visual Studio Express 2012 (Windows XP/Vista)
[ ] Downloaded additional dependencies
[ ] Ran CMAKE
[ ] Compiled the server
[ ] Copied the executables to your server directory.
[ ] Fetched quests into the correct folder
[ ] Fetched maps into the correct folder
[ ] Copied quest plugins into the correct folder
[ ] Copied lua_modules into the correct folder
[ ] Downloaded and installed the PEQ database
[ ] Run the updated SQL scripts in /utils/sql/git/required/
[ ] (optional) Run the updated SQL scripts in /utils/sql/git/optional/
[ ] Copied eqtime.cfg into the correct folder
[ ] Edited the configuration file
[ ] Created a batch file to run the server.
[ ] Logged in and created a character.
[ ] Flagged your own account with GM status

§Step 9: (OPTIONAL) Install the Peq Editor

  • PEQ uses Google Code to store the PEQ Database Editor. Using TortoiseSVN, checkout the editor into your \xampp\htdocs\ folder as peqedit or whatever you wish to call it. If you do not want to keep an SVN, you can download the daily editor dump from PEQ at http://peqtgc.com/releases. Open the readme file for instructions on setting the configuration for your editor.
  • (below is taken almost verbatim from  http://www.peqtgc.com/phpBB3/viewtopic.php?f=29&t=5906 )
-use default for everything and the following when prompted 
**Server Information** 
Network Domain: localhost 
Server Name: peq (*or whatever your everquest server name is in mysql) 
Administators Email: type your email here 
-when it has finished you can test by going to http://localhost or http://localhost:8080 
-stop apache using the start menu. 
-open the configuration file(httpd) - located in the 'conf' folder of Apache 
-Search (ctrl+f) for DirectoryIndex then we will add little extra characters to that line. 
-use the example below, add index.php and index.htm after index.html.var 

(example) 
# DirectoryIndex: sets the file that Apache will serve it a d 
# is requested. 
# 
# The index.html.var file (a type-map) is used to deliver com 
# negotiated documents. The Multiviews option can be used for 
# same purpose, but it is much slower. 
# 
DirectoryIndex index.html index.html.var index.htm index.php 
(end of example) 
-Save and Close the file. 
-Make a folder named 'web' under your main[c] drive. 

APACHE SHOULD BE FULLY SET-UP AT THIS POINT, SEE TUTORIAL2 TO INSTALL PHP NEXT, BEFORE MOVING ON 
***PART 2 Configure Apache for PHP*** 
this section should be used once php has been set up 

-open httpd file (located at c:\program files\apache group\apache2\conf) 
-search for documentroot and a few lines below directory and modify as shown below 
(example2) 
# DocumentRoot: The dire 
# documents. By default, 
# symbolic links and ali 
# 
DocumentRoot "c:\web" <--- ADD THIS TEXT*** 

# 
# This should be changed to whatever you set DocumentRoot to. 
# 
<--- ADD THIS TEXT*** 
(end of example2) 
-search for #AddType application/x-tar.tgz, and cut/copy/paste the following directly below it 
# Load sapi module 
LoadModule php4_module c:/php/sapi/php4apache2.dll 
AddType application/x-httpd-php .php 

-save and close the file 
-RESTART SERVER(MUST) start->all programs->apache HTTP Server 2.0.55->Control Apache Server->Restart 
END OF TUTORIAL---Veteranwizard----2008

*configuration* 
-rename php.ini-dist to php.ini 
-Open the file 'php.ini' using 'Notepad' (suggest using notepad++) 
-search for (ctrl+F) doc_root and modify according to the example below 
(example1) 
; The root of the PHP pages, used only if nonempty. 
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set do 
; if you are running php as a CGI under any web server (other tha 
; see documentation for security issues. The alternate is to use 
; cgi.force_redirect configuration below 
doc_root = "c:\web <--- ADD THIS TEXT**** 

END OF TUTORIAL2 ---Veteranwizard---2008 

JJ's edit: In your php.ini file, also ensure you turn short open tags on. Look for "short_open_tag = Off" and change it to "short_open_tag = On"

§Common Problems

§Quest Problems

  1. If quests don't work at all in game, make sure your quest files are in C:\EQ\EQEmuServer\quests and not C:\EQ\EQEmuServer\quests\quests
  2. If hailing an NPC works but when you hand them an item they do nothing, then you either missed the step where you must copy the contents of C:\EQ\EQEmuServer\quests\plugins into C:\EQ\EQEmuServer\plugins and/or you missed the step where you must copy the contents of C:\EQ\EQEmuServer\quests\lua_modules into C:\EQ\EQEmuServer\lua_modules
  3. If hailing an NPC does not work, it may be an NPC that has a Lua script file and you missed the step where you must copy the contents of C:\EQ\EQEmuServer\quests\lua_modules into C:\EQ\EQEmuServer\lua_modules

§Bot Problems

  • If bots don't work, ensure you ticked EQEMU_ENABLE_BOTS in the CMake step. If you forgot to do that, go back and run CMake again, followed by the step to compile the executables and copy the executables from the Build/Bin/Debug folder to your C:\EQ\EQEmuServer folder.
  • If you enabled bots in CMake but they still don't work, you may have missed the step to source load_bots.sql during the database setup.

§shared_memory startup problems

  • If you click on your start.bat and receive a message along the lines that a shared memory file cannot be created, make sure you have a folder called shared in your C:\EQ\EQEmuServer folder, i.e. a folder called C:\EQ\EQEmuServer\shared

§Any other problems ?