Fixing Windows Batch

You can now ignore that wiki.
Just edit shard_start_cmake.bat in code/ryzom/server to match your path and run the script.

Previous solution

This document aims at configuring the Windows shard_start.bat and shard_stop.bat files to work with the recent changes in the way that the Ryzom project is built. This page also assumes that cmake was used to prepare the project for building based upon:

Please note that shard_start.bat in fact starts the server, but that doesn't mean you can connect to it with a client:
You need a running webserver and sql-database, as described in http://dev.ryzom.com/projects/ryzom/wiki/EverythingWindows#Setting-up-ApachePHP (note that the first part of that page is outdated).

Windows Known Issues

There is a known issue with the current state of the shard_start.bat file that keeps servers built on Windows from starting properly. These issues are:

  1. The current build leaves the executable somewhere other than where the bat file expects them
  1. The current build renames some of the executables to something other than what the bat file expects them

This also means that the shard_stop.bat file suffers from:

  1. The bat file cannot stop any of the processes due to the now incorrect naming convention

To fix these problems there are a couple of ways to fix these errors.

How to Fix the Location

The current location that Visual Studio 2008 stores the compiled files is located at:

PATH\code\build\bin\

There will be either a Release or Debug folder located there depending upon your settings in Cmake.

  • NOTE: PATH is the base of where the Ryzom source is located. For example mine is located at C:\ryzom\ryzom\code\build\bin

This can be fixed by one of two ways.

Leave the Files

The files can be moved from PATH\code\build\bin and placed into PATH\code\ryzom\server\release or PATH\code\ryzom\server\debug. Then inside of the batch file, found at PATH\code\ryzom\server\shard_start.bat, the following lines need to be changed from:

set MODE=Debug
REM set MODE=Release

To the following:

REM modify this to fit you directories:
SET RYZOMSTART=R:\Projects\Ryzom\code\ryzom\server

cd /D %RYZOMSTART%

REM modify this to fit you directories:
SET RYZOMPATH=R:\Projects\Ryzom\code\build\bin

REM set MODE=%RYZOMPATH%\Debug
set MODE=%RYZOMPATH%\Release

Once that is done, the following needs to be changed in the bat file as well.

start %MODE%\admin_service.exe --fulladminname=admin_executor_service --shortadminname=AES

start %MODE%\backup_service --writepid -P49990

start %MODE%\entities_game_service --writepid

start %MODE%\gpm_service --writepid

start %MODE%\input_output_service --writepid

start %MODE%\naming_service --writepid

start %MODE%\welcome_service --writepid

start %MODE%\tick_service --writepid

start %MODE%\mirror_service --writepid

start %MODE%\ai_service --writepid -mCommon:Newbieland:Post

start %MODE%\mail_forum_service --writepid

start %MODE%\shard_unifier_service --writepid

start %MODE%\frontend_service --writepid

start %MODE%\session_browser_service --writepid

start %MODE%\logger_service --writepid

start %MODE%\admin_server --fulladminname=admin_service --shortadminname=AS --writepi

And changed to:

start %MODE%\ryzom_admin_service.exe --fulladminname=admin_executor_service --shortadminname=AES

start %MODE%\ryzom_backup_service --writepid -P49990

start %MODE%\ryzom_entities_game_service --writepid

start %MODE%\ryzom_gpm_service --writepid

start %MODE%\ryzom_ios_service --writepid

start %MODE%\ryzom_naming_service --writepid

start %MODE%\ryzom_welcome_service --writepid

start %MODE%\ryzom_tick_service --writepid

start %MODE%\ryzom_mirror_service --writepid

start %MODE%\ryzom_ai_service --writepid -mCommon:Newbieland:Post

start %MODE%\ryzom_mail_forum_service --writepid

start %MODE%\ryzom_shard_unifier_service --writepid

start %MODE%\ryzom_frontend_service --writepid

start %MODE%\ryzom_session_browser_service --writepid

start %MODE%\ryzom_logger_service --writepid

start %MODE%\ryzom_admin_service --fulladminname=admin_service --shortadminname=AS --writepi

Now save this file anywhere you want, to keep it save if you update your sourcecode from mercurial.

Once these changes have been made, then you can proceed to run shard_start.bat and watch as your bar sprouts multiple windows. While this happens, you might be prompted by your firewall for permissions for internet access. For this guide, full access has been given to the applications for both private and public networks.

Tip: These are many windows, they are overlapping, and later on you might not be interested in watching them clutter your screen. Then, replace "start" with "start /min" for the respective service. Note that from a system engineers view, these are not true services, but programs. This can be important if you optimize your system for "programs" or "background services" in the systems panel. You also have to be logged in all the time (which allows for some security breaches). As you should use Windows only for coding and testing, but not for true operating, this shouldn't be that important...

To End the Services

In order for the shard_stop.bat file to operate correctly, the same renaming as above needs to be done. Since this bat file is more simplistic, below is the whole file fully modified.

@echo off

REM This script will kill all the services launched by shard_start.bat

rem AS
taskkill /IM ryzom_admin_service.exe

rem  bms_master
taskkill /IM ryzom_backup_service.exe

rem  egs
taskkill /IM ryzom_entities_game_service.exe

rem  gpms
taskkill /IM ryzom_gpm_service.exe

rem  ios
taskkill /IM ryzom_ios_service.exe

rem  rns
taskkill /IM ryzom_naming_service.exe

rem  rws
taskkill /IM ryzom_welcome_service.exe

rem  ts
taskkill /IM ryzom_tick_service.exe

rem  ms
taskkill /IM ryzom_mirror_service.exe

rem  ais_newbyland
taskkill /IM ryzom_ai_service.exe

rem  mfs
taskkill /IM ryzom_mail_forum_service.exe

rem  su
taskkill /IM ryzom_shard_unifier_service.exe

rem  fes
taskkill /IM ryzom_frontend_service.exe

rem  sbs
taskkill /IM ryzom_session_browser_service.exe

rem  lgs
taskkill /IM ryzom_logger_service.exe

rem  ras
taskkill /IM ryzom_admin_service.exe

Test the file! If you find some services not stopping, copy the relevant lines to the end of the file, and replace "/IM" with "/F /IM".
Don't do this in the lines above, because it's always better to try to stop services without "/F" first.

That is all that needs to be done for the shard_stop.bat file. These changes are independent of the files actual locations as this is to close the processes running on the system.

Move the Files

If you decide to move the files, the files will need to be moved from:

../code/build/bin/{Release or Debug}

and either copied, or moved into:

../code/ryzom/server/{Release or Debug}

Release or Debug will depend upon if the MODE line is REM*med out for *Release or Debug.

Again, once these changes have been made, shard_start.bat should be able to run without failures.

Here a batch to copy and rename the services:
https://docs.google.com/leaf?id=0B3LX3q7MsUEGNGNmOGYxMGEtZDUwYi00Y2FlLTg1ZGUtNjE1MjE1M2YwYTVl

Edit the batch and change the paths following your own.

Conclusion

These changes, while slightly annoying, will be more permanently fixed and there will no longer be a need to modify these settings in this way. Until there is time to make the changes, the above solution is what is necessary in order to have the server start without the errors that plague the file location and naming structure.

Also, once these changes have been made, it is strongly suggested that the shard_start.bat file be saved outside of the ../code/ directory so that the work done will not need to be reproduced when new server codes are updated.

Versioning

If there are any obmissions or errors, please edit this page for accuracy, and update the revision below:

  • Revision : Initial : Created document based upon two known issues in the shard_start.bat file : 13 - Nov - 2010
    0.1 : Fixed some small issues with pathes, added hints for webserver and sql-server : 12 - Dez - 2010

How to Restart EGS / Entities Service

In order to restart the entities service, please modify the attached bat file and change the MODE line in the same manner that was done earlier:

set MODE=Debug
REM set MODE=Release

To the following:

set MODE=PATH\code\build\bin\Debug
REM set MODE=PATH\code\build\bin\Release

entities_restart.bat (442 Bytes) Lukan, 11/16/2010 04:20 pm