WindowsTutorial

Version 4 (Mamoru, 07/24/2012 08:04 pm)

1 1 Mamoru
h1. Ryzom Core for Windows tutorial
2 1 Mamoru
3 1 Mamoru
*In this tutorial you will get, build and run a local Ryzom server and use a pre-built client to test the newbieland map which is freely available and part of the source. You will also be able to have a peak at the server administration website at http://localhost/ once you're done. You will not be able to let others connect to your server using this tutorial alone.*
4 1 Mamoru
5 1 Mamoru
h2. Assumptions for this tutorial
6 1 Mamoru
7 1 Mamoru
The folder C:\ryzom is used as a base for all Ryzom related files (you may change it, but be consistent). This tutorial was written using a Windows 7 64-bit system and the free Microsoft Visual Studio C++ 2008 Express Edition to build a 32-bit Ryzom Core. You will probably also be able to follow this tutorial on an updated XP, Vista or Windows 7 system that is either 32-bit or 64-bit (you will need to pick software versions available to your system). Each application download instruction has the name of the setup file used for this tutorial listed (for Win7 x64 at the moment of writing), all applications are set to use English for the purpose of this tutorial. Using the command line is avoided as much as possible in this tutorial, using a graphical user interface is preferred.
8 1 Mamoru
9 1 Mamoru
h2. Getting Source
10 1 Mamoru
11 1 Mamoru
Download latest TortoiseHg for Windows (tortoisehg-2.4.2-hg-2.2.3-x64.msi) from http://tortoisehg.bitbucket.org/download/ and install fully.
12 1 Mamoru
Start TortoiseHg Workbench from start menu, open the File menu and choose Clone Repository... then enter the following paths and click Clone (takes a while).
13 1 Mamoru
* Source: http://ryzom.hg.sourceforge.net:8000/hgroot/ryzom/ryzom
14 1 Mamoru
* Destination: C:\ryzom\ryzom
15 1 Mamoru
16 1 Mamoru
h2. Building Ryzom Core including NeL with CMake under Windows
17 1 Mamoru
18 1 Mamoru
Download latest DirectX Software Development Kit (DXSDK_Jun10.exe) from http://www.microsoft.com/en-us/download/details.aspx?id=6812 and install fully.
19 1 Mamoru
Download latest CMake installer for Windows (cmake-2.8.8-win32-x86.exe) from http://www.cmake.org/cmake/resources/software.html and install fully.
20 1 Mamoru
Download latest 7-Zip (7z920-x64.msi) for Windows from http://www.7-zip.org/download.html and install.
21 1 Mamoru
Download latest Microsoft Visual C++ 2008 Express (vcsetup.exe SP1 8/11/2008) from http://www.microsoft.com/en-us/download/details.aspx?id=14597 and install.
22 1 Mamoru
Download third party libraries from http://sourceforge.net/projects/ryzom/files/external_vc9.7z/download and extract to C:\ryzom\ryzom\external
23 1 Mamoru
After that, you can delete all downloaded installers and external_vc9.7z
24 1 Mamoru
25 1 Mamoru
Launch Start Menu > CMake > CMake (cmake-gui), fill in the following paths:
26 1 Mamoru
* Where is the source code: D:/ryzom/ryzom/code
27 1 Mamoru
* Where to build the binaries: D:/ryzom/ryzom/code/build
28 1 Mamoru
29 1 Mamoru
Click Configure, select Visual Studio 9 2008 as the generator and click Finish.
30 1 Mamoru
Check for errors (text in red) in the text area at the bottom and try to fix if any occur. If there are no errors, click Configure once more, followed by Generate.
31 1 Mamoru
32 1 Mamoru
This is also where you may set build options. More info: http://dev.ryzom.com/projects/ryzom/wiki/CMakeOptions
33 1 Mamoru
When you change settings you need to click Configure and Generate again.
34 1 Mamoru
The file RyzomCore.sln in C:\ryzom\ryzom\code\build\ will be generated. Double-click RyzomCore.sln to open in Visual C++ and press F7 to compile all projects (takes a while)
35 1 Mamoru
36 1 Mamoru
For connecting to a running game-server you have to install Apache and MySQL, to keep things simple this tutorial uses XAMPP Lite for Windows.
37 1 Mamoru
Download XAMPP USB Lite (xampp-win32-1.8.0-usb-lite.7z) from http://www.apachefriends.org/en/xampp-windows.html
38 1 Mamoru
Extract XAMPP USB Lite to D:\ and install by running D:\xampp\setup_xampp.bat (registry and system variables won't be changed, to delete XAMPP later just delete the folder).
39 1 Mamoru
40 1 Mamoru
Launch D:\xampp\xampp_start.exe and keep it running to start Apache and MySQL (you probably need to allow those in firewall upon first run).
41 1 Mamoru
To stop XAMPP later you need to run D:\xampp\xampp_stop.exe
42 1 Mamoru
Open your browser and go to http://localhost/ to open the XAMPP first-run page where you may select a language.
43 1 Mamoru
44 1 Mamoru
If you can't connect to localhost and you are using Windows Vista or 7, remove # from the line "127.0.0.1 localhost" in the file "c:\windows\system32\drivers\etc\hosts" (save as "hosts" without .txt) and retry (no restart needed).
45 1 Mamoru
(If your are not logged in with an Administrator account, you will have to run your text editor using right click "run as Administrator" to edit the file.)
46 1 Mamoru
47 1 Mamoru
Click the link to Security in the menu to the left to open the XAMPP security panel.
48 1 Mamoru
Find the link to "Make XAMPP more safe.." and set the root/admin user for XAMPP and MySQL (use only a-z,A-Z,0-9 here to prevent problems later on - make sure to remember or write them down)
49 1 Mamoru
Close the pages/browser and launch D:\xampp\xampp_stop.exe
50 1 Mamoru
51 1 Mamoru
Open D:\xampp\apache\conf\extra\httpd-vhosts.conf in a text editor and add the following to the bottom:
52 1 Mamoru
53 1 Mamoru
<pre>
54 1 Mamoru
Listen 40916
55 1 Mamoru
<VirtualHost *:40916>
56 1 Mamoru
  <Directory "D:/ryzom/ryzom/code/ryzom/tools/server">
57 1 Mamoru
     Options -Indexes +FollowSymLinks +MultiViews
58 1 Mamoru
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
59 1 Mamoru
     AllowOverride All
60 1 Mamoru
     Order allow,deny
61 1 Mamoru
     Allow from all
62 1 Mamoru
     
63 1 Mamoru
     AddType text/html .php .phps
64 1 Mamoru
     AddHandler application/x-httpd-php .php
65 1 Mamoru
     AddHandler application/x-httpd-php-source .phps
66 1 Mamoru
  </Directory> 
67 1 Mamoru
  ServerAdmin admin@localhost
68 1 Mamoru
  DocumentRoot "D:/ryzom/ryzom/code/ryzom/tools/server/www" 
69 1 Mamoru
  ServerName localhost
70 1 Mamoru
</VirtualHost>
71 1 Mamoru
<VirtualHost *:80>
72 1 Mamoru
  <Directory "D:/ryzom/ryzom/code/ryzom/tools/server/">
73 1 Mamoru
     Options -Indexes +FollowSymLinks +MultiViews
74 1 Mamoru
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
75 1 Mamoru
     AllowOverride All
76 1 Mamoru
     Order allow,deny
77 1 Mamoru
     Allow from all
78 1 Mamoru
     
79 1 Mamoru
     AddType text/html .php .phps
80 1 Mamoru
     AddHandler application/x-httpd-php .php
81 1 Mamoru
     AddHandler application/x-httpd-php-source .phps
82 1 Mamoru
  </Directory> 
83 1 Mamoru
  ServerAdmin admin@localhost
84 1 Mamoru
  DocumentRoot "D:/ryzom/ryzom/code/ryzom/tools/server/admin" 
85 1 Mamoru
  ServerName localhost
86 1 Mamoru
</VirtualHost>
87 1 Mamoru
</pre>
88 1 Mamoru
89 1 Mamoru
Save the file and open C:\ryzom\ryzom\code\ryzom\tools\server\admin\config.php with your text editor
90 4 Mamoru
91 4 Mamoru
Change: define('NELTOOL_SITEBASE','http://open.ryzom.com/');
92 4 Mamoru
To: define('NELTOOL_SITEBASE','http://localhost/');
93 4 Mamoru
94 4 Mamoru
Change: define('NELTOOL_SYSTEMBASE','/home/nevrax/hg/code/ryzom/tools/server/admin/');
95 4 Mamoru
To: define('NELTOOL_SYSTEMBASE','C:/ryzom/ryzom/code/ryzom/tools/server/admin/')
96 4 Mamoru
97 1 Mamoru
Save the file and create folder "rrd_graphs" in C:\ryzom\ryzom\code\ryzom\server\save_shard
98 1 Mamoru
Set $LogRelativePath to 'logs/' in C:\ryzom\ryzom\code\ryzom\tools\server\www\login\config.php
99 1 Mamoru
(NOTE: log directory has to be writeable by webserver and it's not wise to give it write access to the directory where script is).
100 1 Mamoru
Create folder "logs" in C:\ryzom\ryzom\code\ryzom\tools\server\www\login
101 1 Mamoru
102 1 Mamoru
Now start XAMPP again by launching (and keep running) D:\xampp\xampp_start.exe
103 1 Mamoru
In your browser, go to http://localhost/phpmyadmin/ and log in with the MySQL account you created earlier in the XAMPP Security panel.
104 1 Mamoru
Select Databases from the top create a new database called "nel" (without quotes). Create two more databases called "nel_tool" and "ring_open".
105 1 Mamoru
Next, you will need to create a user for your new databases and grant that user privileges on all tables for each database: nel, nel_tool, and ring_open.
106 1 Mamoru
The configuration files in code/ryzom/server expect your user to be named 'shard' with NO PASSWORD.
107 1 Mamoru
If you decide to use a different name for your MySQL user, or assign it a password, you will need to go through the .cfg files and change these values from 'shard' and "" wherever they appear.(they appear in several of the .cfg files)
108 1 Mamoru
To create a new user, go to SQL at the top and enter the following lines, then click Go
109 1 Mamoru
110 1 Mamoru
<pre>
111 1 Mamoru
GRANT ALL ON nel.* TO shard@localhost;
112 1 Mamoru
GRANT ALL ON nel_tool.* TO shard@localhost;
113 1 Mamoru
GRANT ALL ON ring_open.* TO shard@localhost;
114 1 Mamoru
</pre>
115 1 Mamoru
116 1 Mamoru
The result window will show "# MySQL returned an empty result set (i.e. zero rows)." this is not an error.
117 1 Mamoru
Go to the Users tab this time and click "reload the privileges" in the note at the bottom.
118 1 Mamoru
Open the folder C:\ryzom\ryzom\code\ryzom\tools\server\sql and open ryzom_admin_default_data.sql in a text editor.
119 1 Mamoru
Search for /home/nevrax/ and replace it with D:/ryzom/ryzom/
120 1 Mamoru
Save this file and open ryzom_default_data.sql in a text editor.
121 1 Mamoru
Change all occurrences of open.ryzom.com to localhost, but remember to keep the ports (:4999 etc.) untouched.
122 1 Mamoru
Go to C:\ryzom\ryzom\code\ryzom\tools\server\admin\templates and copy contents of folder "default" to folder "default_c".
123 1 Mamoru
124 1 Mamoru
Reopen your browser with PhpMyAdmin (http://localhost/phpmyadmin) select the nel database to the left and go to the Import tab in the navigation bar along the top.
125 1 Mamoru
* Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_tables.sql and click Go.
126 1 Mamoru
You should see at the top: Import has been successfully finished, 65 queries executed. (ryzom_tables.sql)
127 1 Mamoru
Again, select the nel database to the left and go to the Import tab.
128 1 Mamoru
* Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_default_data.sql and click Go.
129 1 Mamoru
You should see at the top: Import has been successfully finished, 25 queries executed. (ryzom_default_data.sql)
130 1 Mamoru
This time, select the nel_tool database to the left and go to the Import tab.
131 1 Mamoru
* Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_admin_default_data.sql and click Go.
132 1 Mamoru
You should see at the top: Import has been successfully finished, 61 queries executed. (ryzom_admin_default_data.sql)
133 1 Mamoru
Once you have imported these files, you need to make a change to some of the data in your new databases.
134 1 Mamoru
Navigate to the nel_tool database, then to the neltool_domains table, find the record with a domain_id of "12"
135 1 Mamoru
Then edit that row by clicking on the little pencil icon to the left, change the domain_as_host field to localhost and click Go. You should see: 1 row affected.
136 1 Mamoru
137 1 Mamoru
Open C:\ryzom\ryzom\code\ryzom\server\frontend_service.cfg in a text editor and set FSListenHost to "localhost" (with quotes).
138 1 Mamoru
Save the file, open C:\ryzom\ryzom\code\ryzom\server\shard_start_cmake.bat in a text editor and change
139 1 Mamoru
MODE=..\..\build\bin\Release to MODE=..\..\build\bin\Debug depending on your CMake settings.
140 1 Mamoru
Save the file, open C:\ryzom\ryzom\code\ryzom\server\shard_stop_cmake.bat in a text editor and change
141 1 Mamoru
ryzom_session_browser_server.exe to ryzom_session_browser_service.exe and save this file as well.
142 1 Mamoru
143 1 Mamoru
At this point, you should be able to start the server using the shard_start_cmake.bat file in the C:\ryzom\ryzom\code\ryzom\server folder.
144 1 Mamoru
145 1 Mamoru
Several console windows will open up. Accept any requests for services to be allowed by firewall.
146 1 Mamoru
Give everything a few minutes to start, then you should be able to start your client and connect to your new server using the Client.
147 1 Mamoru
148 1 Mamoru
To stop the services launch C:\ryzom\ryzom\code\ryzom\server\shard_stop_cmake.bat
149 1 Mamoru
Several debug windows might pop-up. Tick "Don't sent the report" if possible and click Ignore on all of them. Change the build to Release instead of Debug to prevent the debug windows from appearing. This is done in CMake.
150 1 Mamoru
151 1 Mamoru
h2. Running Ryzom Client
152 1 Mamoru
153 1 Mamoru
If you are using your own shard, you may want to use a pre-built client executable file to confirm whether your shard is okay. Then if your client has problems, you can know it isn't your shard's fault.
154 3 Mamoru
You can find pre-built Windows binaries here: http://dev.ryzom.com/projects/ryzom/wiki/WindowsBinaries
155 3 Mamoru
At the moment of writing this tutorial, this is the latest pre-built client available:
156 3 Mamoru
* Molator's Downloads
157 3 Mamoru
Client - Platform: Win x86 Stlport - Date: 2011-09-20 - Version: 0.8.0.1785 - Size: 616MB
158 3 Mamoru
159 3 Mamoru
Extract to e.g. C:\ryzom\client and start ryzom_client_r.exe in there (after starting XAMPP and Ryzom server).
160 1 Mamoru
Enter an account name and password and click Connect four times (don't use any of the other buttons besides Exit, you may change resolution and level of detail though).
161 1 Mamoru
Next, click Create New and customize your character - don't worry about this too much, only you will be able to connect to this server.
162 1 Mamoru
When done, click Finish and pick the Open community (your local shard). Select your preferred key binds and pick a name for your character.
163 1 Mamoru
Finally, click Play and wait for your client to load. You should now appear in the Ranger camp of the newbieland map.
164 1 Mamoru
Have fun doing tests, tweaking and hacking the source code :)
165 1 Mamoru
166 1 Mamoru
More instructions on running/building the client found here: http://dev.ryzom.com/projects/ryzom/wiki/RunClientOnWindows
167 1 Mamoru
If your client gives you error messages on connect, check http://dev.ryzom.com/projects/ryzom/wiki/ClientConnectErrors
168 1 Mamoru
169 1 Mamoru
h2. How to Restart EGS / Entities Service
170 1 Mamoru
171 1 Mamoru
Create and a file called entities_restart.bat with the following contents:
172 1 Mamoru
173 1 Mamoru
<pre>
174 1 Mamoru
@echo off
175 1 Mamoru
set MODE=C:\ryzom\ryzom\code\build\bin\Debug
176 1 Mamoru
ping -n 2 127.0.0.1 > NUL 2>&1
177 1 Mamoru
start %MODE%\ryzom_entities_game_service --writepid
178 1 Mamoru
</pre>
179 1 Mamoru
180 1 Mamoru
Run this file in order to restart the entities service (when it crashes).
181 1 Mamoru
Again, when you've changed the CMake build to Release you have to replace Debug with that.
182 1 Mamoru
183 2 Mamoru
h2. Known problems
184 2 Mamoru
185 2 Mamoru
h3. CMake: Compiler not found
186 2 Mamoru
187 2 Mamoru
When clicking Configure in CMake these errors (or similar) show up in red:
188 2 Mamoru
<pre>
189 2 Mamoru
The CXX compiler identification is unknown
190 2 Mamoru
The C compiler identification is unknown
191 2 Mamoru
Check for working CXX compiler: bcc32
192 2 Mamoru
CMake Error: your CXX compiler: "bcc32" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
193 2 Mamoru
...
194 2 Mamoru
</pre>
195 2 Mamoru
196 2 Mamoru
You have selected the wrong compiler for CMake
197 2 Mamoru
Please make sure you have downloaded the latest Microsoft Visual C++ 2008 Express (vcsetup.exe SP1 8/11/2008) from http://www.microsoft.com/en-us/download/details.aspx?id=14597 and installed it.
198 2 Mamoru
Then start CMake (cmake-gui) and select Delete Cache from the File menu.
199 2 Mamoru
Now click Configure and make sure to select Visual Studio 9 2008 as the generator.
200 2 Mamoru
Check for errors (text in red) in the text area at the bottom and try to fix if any occur. If there are no errors, click Configure once more, followed by Generate.
201 2 Mamoru
202 1 Mamoru
h2. Questions/errors?
203 1 Mamoru
204 1 Mamoru
Feel free to edit and update this wiki page if you know the answer.
205 1 Mamoru
If not, join #ryzom on irc.freenode.net and ask one of the developers.
206 1 Mamoru
207 1 Mamoru
_Originally written by Edwin "Mamoru" Miltenburg ([email protected])._