WindowsTutorial

Version 9 (Mamoru, 07/25/2012 01:57 am)

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 6 Mamoru
NOTE: Most of the applications you will use are case-sensitive!
16 1 Mamoru
17 1 Mamoru
h2. Building Ryzom Core including NeL with CMake under Windows
18 1 Mamoru
19 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.
20 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.
21 1 Mamoru
Download latest 7-Zip (7z920-x64.msi) for Windows from http://www.7-zip.org/download.html and install.
22 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.
23 1 Mamoru
Download third party libraries from http://sourceforge.net/projects/ryzom/files/external_vc9.7z/download and extract to C:\ryzom\ryzom\external
24 1 Mamoru
After that, you can delete all downloaded installers and external_vc9.7z
25 1 Mamoru
26 1 Mamoru
Launch Start Menu > CMake > CMake (cmake-gui), fill in the following paths:
27 1 Mamoru
* Where is the source code: D:/ryzom/ryzom/code
28 1 Mamoru
* Where to build the binaries: D:/ryzom/ryzom/code/build
29 1 Mamoru
30 1 Mamoru
Click Configure, select Visual Studio 9 2008 as the generator and click Finish.
31 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.
32 1 Mamoru
33 1 Mamoru
This is also where you may set build options. More info: http://dev.ryzom.com/projects/ryzom/wiki/CMakeOptions
34 1 Mamoru
When you change settings you need to click Configure and Generate again.
35 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)
36 1 Mamoru
37 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.
38 1 Mamoru
Download XAMPP USB Lite (xampp-win32-1.8.0-usb-lite.7z) from http://www.apachefriends.org/en/xampp-windows.html
39 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).
40 1 Mamoru
41 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).
42 1 Mamoru
To stop XAMPP later you need to run D:\xampp\xampp_stop.exe
43 1 Mamoru
Open your browser and go to http://localhost/ to open the XAMPP first-run page where you may select a language.
44 1 Mamoru
45 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).
46 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.)
47 1 Mamoru
48 1 Mamoru
Click the link to Security in the menu to the left to open the XAMPP security panel.
49 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)
50 5 Mamoru
NOTE: You need to set a username for the XAMPP Control Panel and two passwords. You can't change the MySQL username here, this will be "root".
51 5 Mamoru
52 1 Mamoru
Close the pages/browser and launch D:\xampp\xampp_stop.exe
53 1 Mamoru
54 1 Mamoru
Open D:\xampp\apache\conf\extra\httpd-vhosts.conf in a text editor and add the following to the bottom:
55 1 Mamoru
56 1 Mamoru
<pre>
57 1 Mamoru
Listen 40916
58 1 Mamoru
<VirtualHost *:40916>
59 1 Mamoru
  <Directory "D:/ryzom/ryzom/code/ryzom/tools/server">
60 1 Mamoru
     Options -Indexes +FollowSymLinks +MultiViews
61 1 Mamoru
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
62 1 Mamoru
     AllowOverride All
63 1 Mamoru
     Order allow,deny
64 1 Mamoru
     Allow from all
65 1 Mamoru
     
66 1 Mamoru
     AddType text/html .php .phps
67 1 Mamoru
     AddHandler application/x-httpd-php .php
68 1 Mamoru
     AddHandler application/x-httpd-php-source .phps
69 1 Mamoru
  </Directory> 
70 1 Mamoru
  ServerAdmin admin@localhost
71 1 Mamoru
  DocumentRoot "D:/ryzom/ryzom/code/ryzom/tools/server/www" 
72 1 Mamoru
  ServerName localhost
73 1 Mamoru
</VirtualHost>
74 1 Mamoru
<VirtualHost *:80>
75 1 Mamoru
  <Directory "D:/ryzom/ryzom/code/ryzom/tools/server/">
76 1 Mamoru
     Options -Indexes +FollowSymLinks +MultiViews
77 1 Mamoru
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
78 1 Mamoru
     AllowOverride All
79 1 Mamoru
     Order allow,deny
80 1 Mamoru
     Allow from all
81 1 Mamoru
     
82 1 Mamoru
     AddType text/html .php .phps
83 1 Mamoru
     AddHandler application/x-httpd-php .php
84 1 Mamoru
     AddHandler application/x-httpd-php-source .phps
85 1 Mamoru
  </Directory> 
86 1 Mamoru
  ServerAdmin admin@localhost
87 1 Mamoru
  DocumentRoot "D:/ryzom/ryzom/code/ryzom/tools/server/admin" 
88 1 Mamoru
  ServerName localhost
89 1 Mamoru
</VirtualHost>
90 1 Mamoru
</pre>
91 1 Mamoru
92 1 Mamoru
Save the file and open C:\ryzom\ryzom\code\ryzom\tools\server\admin\config.php with your text editor
93 4 Mamoru
94 4 Mamoru
Change: define('NELTOOL_SITEBASE','http://open.ryzom.com/');
95 4 Mamoru
To: define('NELTOOL_SITEBASE','http://localhost/');
96 4 Mamoru
97 4 Mamoru
Change: define('NELTOOL_SYSTEMBASE','/home/nevrax/hg/code/ryzom/tools/server/admin/');
98 4 Mamoru
To: define('NELTOOL_SYSTEMBASE','C:/ryzom/ryzom/code/ryzom/tools/server/admin/')
99 4 Mamoru
100 1 Mamoru
Save the file and create folder "rrd_graphs" in C:\ryzom\ryzom\code\ryzom\server\save_shard
101 1 Mamoru
Set $LogRelativePath to 'logs/' in C:\ryzom\ryzom\code\ryzom\tools\server\www\login\config.php
102 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).
103 1 Mamoru
Create folder "logs" in C:\ryzom\ryzom\code\ryzom\tools\server\www\login
104 1 Mamoru
105 1 Mamoru
Now start XAMPP again by launching (and keep running) D:\xampp\xampp_start.exe
106 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.
107 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".
108 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.
109 1 Mamoru
The configuration files in code/ryzom/server expect your user to be named 'shard' with NO PASSWORD.
110 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)
111 1 Mamoru
To create a new user, go to SQL at the top and enter the following lines, then click Go
112 1 Mamoru
113 1 Mamoru
<pre>
114 1 Mamoru
GRANT ALL ON nel.* TO shard@localhost;
115 1 Mamoru
GRANT ALL ON nel_tool.* TO shard@localhost;
116 1 Mamoru
GRANT ALL ON ring_open.* TO shard@localhost;
117 1 Mamoru
</pre>
118 1 Mamoru
119 1 Mamoru
The result window will show "# MySQL returned an empty result set (i.e. zero rows)." this is not an error.
120 1 Mamoru
Go to the Users tab this time and click "reload the privileges" in the note at the bottom.
121 1 Mamoru
Open the folder C:\ryzom\ryzom\code\ryzom\tools\server\sql and open ryzom_admin_default_data.sql in a text editor.
122 1 Mamoru
Search for /home/nevrax/ and replace it with D:/ryzom/ryzom/
123 1 Mamoru
Save this file and open ryzom_default_data.sql in a text editor.
124 1 Mamoru
Change all occurrences of open.ryzom.com to localhost, but remember to keep the ports (:4999 etc.) untouched.
125 1 Mamoru
Go to C:\ryzom\ryzom\code\ryzom\tools\server\admin\templates and copy contents of folder "default" to folder "default_c".
126 1 Mamoru
127 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.
128 1 Mamoru
* Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_tables.sql and click Go.
129 1 Mamoru
You should see at the top: Import has been successfully finished, 65 queries executed. (ryzom_tables.sql)
130 1 Mamoru
Again, select the nel 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_default_data.sql and click Go.
132 1 Mamoru
You should see at the top: Import has been successfully finished, 25 queries executed. (ryzom_default_data.sql)
133 1 Mamoru
This time, select the nel_tool database to the left and go to the Import tab.
134 1 Mamoru
* Browse your computer: C:\ryzom\ryzom\code\ryzom\tools\server\sql\ryzom_admin_default_data.sql and click Go.
135 1 Mamoru
You should see at the top: Import has been successfully finished, 61 queries executed. (ryzom_admin_default_data.sql)
136 7 Mamoru
137 1 Mamoru
Once you have imported these files, you need to make a change to some of the data in your new databases.
138 7 Mamoru
Open the SQL tab (top of the page in PhpMyAdmin) and enter the following line, followed by clicking Go
139 7 Mamoru
140 7 Mamoru
<pre>
141 7 Mamoru
UPDATE `nel_tool`.`neltool_domains` SET `domain_as_host` = 'localhost' WHERE `neltool_domains`.`domain_id` =12;
142 7 Mamoru
</pre>
143 1 Mamoru
144 1 Mamoru
Open C:\ryzom\ryzom\code\ryzom\server\frontend_service.cfg in a text editor and set FSListenHost to "localhost" (with quotes).
145 1 Mamoru
Save the file, open C:\ryzom\ryzom\code\ryzom\server\shard_start_cmake.bat in a text editor and change
146 1 Mamoru
MODE=..\..\build\bin\Release to MODE=..\..\build\bin\Debug depending on your CMake settings.
147 1 Mamoru
Save the file, open C:\ryzom\ryzom\code\ryzom\server\shard_stop_cmake.bat in a text editor and change
148 1 Mamoru
ryzom_session_browser_server.exe to ryzom_session_browser_service.exe and save this file as well.
149 1 Mamoru
150 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.
151 1 Mamoru
152 1 Mamoru
Several console windows will open up. Accept any requests for services to be allowed by firewall.
153 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.
154 1 Mamoru
155 1 Mamoru
To stop the services launch C:\ryzom\ryzom\code\ryzom\server\shard_stop_cmake.bat
156 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.
157 1 Mamoru
158 1 Mamoru
h2. Running Ryzom Client
159 1 Mamoru
160 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.
161 3 Mamoru
You can find pre-built Windows binaries here: http://dev.ryzom.com/projects/ryzom/wiki/WindowsBinaries
162 3 Mamoru
At the moment of writing this tutorial, this is the latest pre-built client available:
163 3 Mamoru
* Molator's Downloads
164 3 Mamoru
Client - Platform: Win x86 Stlport - Date: 2011-09-20 - Version: 0.8.0.1785 - Size: 616MB
165 3 Mamoru
166 3 Mamoru
Extract to e.g. C:\ryzom\client and start ryzom_client_r.exe in there (after starting XAMPP and Ryzom server).
167 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).
168 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.
169 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.
170 1 Mamoru
Finally, click Play and wait for your client to load. You should now appear in the Ranger camp of the newbieland map.
171 1 Mamoru
Have fun doing tests, tweaking and hacking the source code :)
172 1 Mamoru
173 1 Mamoru
More instructions on running/building the client found here: http://dev.ryzom.com/projects/ryzom/wiki/RunClientOnWindows
174 1 Mamoru
If your client gives you error messages on connect, check http://dev.ryzom.com/projects/ryzom/wiki/ClientConnectErrors
175 1 Mamoru
176 1 Mamoru
h2. How to Restart EGS / Entities Service
177 1 Mamoru
178 1 Mamoru
Create and a file called entities_restart.bat with the following contents:
179 1 Mamoru
180 1 Mamoru
<pre>
181 1 Mamoru
@echo off
182 1 Mamoru
set MODE=C:\ryzom\ryzom\code\build\bin\Debug
183 1 Mamoru
ping -n 2 127.0.0.1 > NUL 2>&1
184 1 Mamoru
start %MODE%\ryzom_entities_game_service --writepid
185 1 Mamoru
</pre>
186 1 Mamoru
187 1 Mamoru
Run this file in order to restart the entities service (when it crashes).
188 1 Mamoru
Again, when you've changed the CMake build to Release you have to replace Debug with that.
189 1 Mamoru
190 2 Mamoru
h2. Known problems
191 2 Mamoru
192 2 Mamoru
h3. CMake: Compiler not found
193 2 Mamoru
194 2 Mamoru
When clicking Configure in CMake these errors (or similar) show up in red:
195 2 Mamoru
<pre>
196 2 Mamoru
The CXX compiler identification is unknown
197 2 Mamoru
The C compiler identification is unknown
198 2 Mamoru
Check for working CXX compiler: bcc32
199 2 Mamoru
CMake Error: your CXX compiler: "bcc32" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
200 2 Mamoru
...
201 2 Mamoru
</pre>
202 2 Mamoru
203 2 Mamoru
You have selected the wrong compiler for CMake
204 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.
205 2 Mamoru
Then start CMake (cmake-gui) and select Delete Cache from the File menu.
206 2 Mamoru
Now click Configure and make sure to select Visual Studio 9 2008 as the generator.
207 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.
208 2 Mamoru
209 8 Mamoru
h3. No bin folder
210 9 Mamoru
211 8 Mamoru
Have you configured and generated the build files using CMake?
212 8 Mamoru
Have you compiled the binaries with the following step?
213 8 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)_
214 8 Mamoru
215 1 Mamoru
h2. Questions/errors?
216 1 Mamoru
217 1 Mamoru
Feel free to edit and update this wiki page if you know the answer.
218 1 Mamoru
If not, join #ryzom on irc.freenode.net and ask one of the developers.
219 1 Mamoru
220 1 Mamoru
_Originally written by Edwin "Mamoru" Miltenburg ([email protected])._