PDA

View Full Version : HOWTO: Run Your Own Win32 EQEMu Server


Merth
07-28-2003, 04:18 PM
<Header author=kathgar reason="clarification and pointless questions">
This is a guide for compiling the latest DEVELOPER RELEASES of EQEMu. If you just want to run a server and you are not going to code, this is not for you. Similarly, if you ARE going to code you probably would not need this guide. DO NOT post on the forums or ask on IRC for support with DEVELOPER RELEASES. If you find a legitimate error and wish to report it, tell us in #eqemudev or in the bug forum. Again, this only applies if you KNOW what you are doing and what you are talking about. NOT "OMG I CAN'T COMPILE HOLD MY HAND!!!111oneoneoneoneone." As this guide CLEARLY states it is for using Windows 2003 and VS.net 2003. If you are not using those version thing may not work. If you cannot figure out how to set an environmental variable in Windows you probably are not supposed to be getting a -DR and you would be better off with one of the PRECOMPILED releases on Sourceforge.
IF ONE MORE PERSON POSTS OR COMES ON IRC HAVING PROBLEMS WITH CVS AND THEY HAVE NO REAL BUSINESS TRYING TO USE CVS IN THE FIRST PLACE I WILL GO INSANE
</rant>
</endheader>





This is a step-by-step guide for setting up a 0.5.0-DR3 server from scratch on a Windows system. You do not need to run your own server to play on EQEMu. If you just wish to play, visit HOWTO: Play EQEMu (http://www.eqemulator.net/forums/viewtopic.php?t=9649)

To run your own server, you must have a compiler and be somewhat familiar with computers. If you are not computer saavy, it's best not to run your own server - you have to know a fair bit of what you are doing and have the ability to resolve most problems on your own.

Scope
This guide was created with the following setup:
* p4 2.4ghz / 1gb ram / 120gb hard drive
* Windows 2003 Enterprise Server - Spankin' new installation, no service packs
* Visual Studio.NET 2003 - Spankin' new installation, no service packs
* Broadband Cable Internet (Comcast)
* Linksys Router

If you do not have the same setup as I did, you may have to make adjustments. In particular, most of this will not apply to Linux users.




Turn off all firewalls
[list=a:4ac0f31da4]
This is a section I will expand, but for simplicity - turn off all firewall stuff for now. This includes the Windows software firewall.


Install mysql 3.23

Download mysql 3.23 from http://www.mysql.com/downloads/mysql-3.23.html.
Run the installation program. This tutorial assumes you have installed to c:\mysql
Choose a Typical install


Install zlib 1.1.4

Download zlib 1.1.4 from http://www.gzip.org/zlib/
Unzip the file you download with the option to preserve directory structure. This tutorial assumes you have installed zlib to c:\EqEmu\zlib


Install WinCVS

Download WinCVS from http://sourceforge.net/project/showfiles.php?group_id=10072&release_id=24467
Download the latest version (13b10 as of July 2003)
Run setup.exe from the download
This tutorial assumes you have installed to c:\EqEmu\cvs\wincvs


Add CVS to %PATH%

Open Control Panel
Open System
Click on the Advanced tab
Click on Environment Variables
Highlight the PATH row in the System Variables Frame
Click Edit below the row you have highlighted
Add ;c:\EqEmu\cvs\wincvs;c:\EqEmu\cvs\wincvs\CVSNT to the end of the existing variable value. Don't overwrite the current value in there - just append to the end

While we're here, let's add mysql bin to the path:
Add ;c:\mysql\bin to the end of the existing variable value. Don't overwrite the current value in there - just append to the end
Here's a screenshot of what I added to my %PATH%:

http://www.eqemulator.net/merth/wincvs-environ04.jpg


Get EQEMu Source From CVS

Open a DOS prompt
Win98/95/ME - start->run->command
Win2k/XP/2k3 - start->run->cmd
Type in the following:
c:
cd \eqemu\cvs
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/eqemu login
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/eqemu -z3 co eqemu
NOTE: Press enter when it asks you for a password (leave it blank)
NOTE: Repeat these commands on failure (sourceforge's network gets swamped at times). Sometimes, it takes me 10-15 tries!
NOTE: If you get the following error: 'cvs' is not recognized as an internal or external command, operable program or batch file. - YOU NEGLECTED TO FOLLOW THE DIRECTIONS ABOVE! The section you skipped over is named Add CVS to %PATH%


Setup Compiler
NOTE: This section is based on the VS.NET 2003 compiler

Go to the menu Tools/Options
In the folder pane, navigate to Projects/VC++ Directories

http://www.eqemulator.net/merth/ide-01.jpg
In the Show directories for dropdown, select "Include Files"
At the end of the list, add the following directories:
c:\mysql\include
c:\EqEmu\zlib
In the Show directories for dropdown, select "Library files"

http://www.eqemulator.net/merth/ide-04.jpg
At the end of the list, add the following directory:
c:\mysql\lib\opt

http://www.eqemulator.net/merth/ide-05.jpg


Compile EMuShareMem

Open EMuShareMem.dsp from the directory C:\EqEmu\cvs\eqemu\NewSource\EMuShareMem
Choose 'yes' for converting project to new format (may not apply to your compiler)

http://www.eqemulator.net/merth/compile-02.jpg
Click on the menu Build/Rebuild Solution. Watch it compile!


Compile World

Open World.sln from the directory C:\EqEmu\cvs\eqemu\NewSource\World
Click on the menu Build/Rebuild Solution. Watch it compile!


Compile Zone

Open Zone.sln from the directory C:\EqEmu\cvs\eqemu\NewSource\Zone
Click on the menu Build/Rebuild Solution. Watch it compile!


Start mysql
NOTE: This section can get tricky - and is still under investigation

Run c:\mysql\bin\winmysqladmin.exe
NOTE: Make sure this is the first time you are running this. If it's not the first time, uninstall and re-install from scratch
Wait 20 seconds
The main window should have disappeared by now
A username/password window should have appeared

http://www.eqemulator.net/merth/mysql-install-02.jpg
Enter in the username and password you will use to administer the database. Don't use the same username and password as your forum account.
NOTE: In this sample, I use test/test
NOTE: Some people don't see this dialog. If that's you, visit http://www.mysql.com/doc/en/Adding_users.html and figure out how to add a user manually.
You should now see a stoplight icon in the systray.

http://www.eqemulator.net/merth/mysql-install-03.jpg


Create EQ Database

Make sure you followed the instructions in the cvs section for adding mysql binaries to the %path%.
Open a DOS prompt
Win98/95/ME - start->run->command
Win2k/XP/2k3 - start->run->cmd
Type in the following:
c:
cd "\eqemu\cvs\eqemu\eqemu release"
mysql -u root mysql
Inside of mysql, type these commands:
create database eq;
grant all privileges on *.* to test@localhost identified by 'test' with grant option;
quit
You should see the following as output from above:
C:\EqEmu\cvs\eqemu\EQEMu Release>mysql -u root mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22 to server version: 3.23.57-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database eq;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on eq.* to test@localhost identified by 'test'
with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

C:\EqEmu\cvs\eqemu\EQEMu Release>

Back in the DOS prompt, type this command:
mysql -u test -p eq
You should see a password prompt - enter in your password ('test' in this sample). You should see the following:
C:\EqEmu\cvs\eqemu\EQEMu Release>mysql -u test -p eq
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24 to server version: 3.23.57-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
Time to load a blank database. Type in the following command:
source db.sql;
You will see the following for a LONG time:
mysql> source db.sql;
Query OK, 0 rows affected (0.03 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.00 sec)
(... repeat about fifteen thousand times)
You now have an EQ database with NO ITEMS/MOBS/ETC. See http://www.eqemulator.net/forums/viewtopic.php?t=6176 for info on populating your database.
0.5.0-DR3 - While 0.5.0 is still under development, you will need to run these temporary scripts to create tables that hold our work in progress:
source doors_objects.sql;
source pets.sql;
Close out the DOS window. You are done with it.


Copy Files

Copy the following files from c:\EqEmu\cvs\eqemu\EQEMu Release to c:\EqEmu\cvs\eqemu\NewSource\Build
addon.ini
Boot5zones.bat
db.ini
LoginServer.ini
Copy the following file from your fully patched everquest directory to c:\eqemu\cvs\eqemu\newsource\build:
spells_en.txt


Edit Startup Files
NOTE: The files edited in this section should now be found in c:\eqemu\cvs\eqemu\newsource\build after the previous step.

Replace the contents of db.ini with the following:
[Database]
host=localhost
user=test
password=test
database=eq
compression=off
Replace the contents of LoginServer.ini with the following:
[LoginServer]
loginserver=eqlogin1.eqemulator.net
loginport=5997
worldname=Bob's Super Duper
worldaddress=999.999.999.999
locked=false

[WorldServer]
Defaultstatus=0
Unavailzone=
NOTE: Replace 999.999.999.999 above with your external IP address. Visit http://www.whatismyip.com/ to determine your IP.
NOTE: Make sure your worldname is more than 10 characters long, less than 30 characters long, and does not contain the word "Server"
Replace the contents of Boot5zones.bat with the following:
if NOT exist spells_en.txt goto NOSPELL

start ZoneDebug.exe . 999.999.999.999 7995 192.168.999.999
start ZoneDebug.exe . 999.999.999.999 7996 192.168.999.999
start ZoneDebug.exe . 999.999.999.999 7997 192.168.999.999
start ZoneDebug.exe . 999.999.999.999 7998 192.168.999.999
start ZoneDebug.exe . 999.999.999.999 7999 192.168.999.999
exit
cls

:NOSPELL
echo You did not copy the spells_en.txt from your everquest directory to this one. Please do so or zones will crash on startup.
PAUSE
NOTE: Replace 999.999.999.999 above with your external IP address. Visit http://www.whatismyip.com/ to determine your IP.
NOTE:Replace 192.168.999.999 above with your internal IP address. There are many things to try here: localhost, 127.0.0.1, your external IP address, or the IP shown in ipconfig/winipcfg. For my home network, 192.168.1.3 worked, as I manually assigned my computer that IP address.


Start EQEMu

Run WorldDebug.exe from c:\EqEmu\cvs\eqemu\NewSource\Build. Just double click on it from windows explorer.
NOTE: If it opens and disappears really quickly, you have a problem. Run WorldDebug.exe from the command prompt instead of double clicking on it, and it won't disappear (allowing you to see error). If you can't figure out how to run from a command prompt, please continue no further. Sorry, running a server is for advanced users only.
Once successful, you will see these three lines (even though you may see some errors)
TCP listening on: 999.999.999.999:9000
World server listening on: 999.999.999.999:9000
Connected to LoginServer: eqlogin1.eqemulator.net:5997


Run EQ!

Run EQ and connect to your server! See http://www.eqemulator.net/forums/viewtopic.php?t=9649 for more information on how to run the EQ client.


Create ServerOP

After verifying that you can connect to your server, you are ready to create a ServerOP user for your server. This user has more power than the Lead-GM, so be careful in choosing your serverop (how about choosing yourself?).
When you have chosen your serverop, logon to your server from EQ at least once, using the account chosen to be ServerOP.
Open mysql in DOS once again (mysql -u test -p eq) and enter in the following command:
NOTE: Replace "User" with the name of the forum account who will be logging in as ServerOP.
NOTE: The password can be anything you wish, but will only be used for an advanced feature (telnet) - THIS PASSWORD IS NOT USED TO LOGON TO EQEMU FROM INSIDE EQ!
NOTE: Do not use a tick mark (') in your password
update account set status=200, password='BobsPassword' where name='SuperDuperBob';
You should see the following:
mysql> update account set status=200, password='BobsPassword' where name='SuperDuperBob';
Query OK, 1 row affected (0.00 sec)


[/list:o:4ac0f31da4]


Notes:

For now, make sure your firewalls are turned off. This includes the Windows XP/2k3 software firewall. After you get things running, see http://www.eqemulator.net/forums/viewtopic.php?t=4177 for more information about running behind a firewall. It can be done! I'm living proof!
At this time, there are no valid database scripts that correctly populate the world. Telmet's and Drawde's scripts do not yet work on 0.5.0.
At this time, the tutorial only applies to 0.5.0-DR3.

Merth
09-22-2003, 02:03 AM
Bump: This still works: 9-22-2003. Don't be afraid to use it.