this is my first post on this forum, so let´s make it a good one, shall we. I do hope this is the right board, couldn´t find a more appropriate section.
So is there a native linux port of the DServer.exe now, you might ask? No, but it runs very (!) good and stable under wine, at least on my side of things. But there are some pitfalls, that I have fallen into, so I will hopefully cover that, so it is time and pain and suffering saved for everyone else.
Basically this is aimed at admins of remote servers, which are only reachable by means of "MS Remote Desktop Client" or VNC or stuff like that to provide a graphical user interface. But as long as you can use ssh or Putty to connect to and control the server you won´t even need such things, see for added coolness below.
You do have to run many commands in a terminal window though, think MS-DOS command prompt on steroids. Don´t worry it is half as bad as it sounds.
And for the added coolness, I will show how to run the dedicated server, so it looks like a local application on your home desktop, even though the dedicated server it is actually running on might be half way around the globe, and I don´t mean VNC or Remote Desktop. And a little further down the road there will be the possibility to automatically start the DServer upon server restarts, without any human intervention whatsoever! But that will have to wait until we have the basic stuff running, meaning wine.
First, I´d like to point you to:
http://en.wiki.riseo...edicated_server" onclick="window.open(this.href);return false;">http://en.wiki.riseo...ght.com/index.p … ted_server
A dedicated server on a remote machine for dummies
since those pretty much cover the general way to set the server up, would you be using a MS Windows machine. I am going to cover the differences, mainly getting wine to work and installing, running DServer.exe is very straight forward from then on.
(NOTE: Don´t download ROF_Free2Play_Client_1025b.zip, it won´t unzip properly! Download
http://www.riseoffli..._Demo_1021b.exe" onclick="window.open(this.href);return false;">http://www.riseoffli...emo.com/ROF_Dem … _1021b.exe
instead and use the rof_updater.exe to update to the latest version.)
I am using a Debian 6.0.5 (aka squeeze aka stable as of now) box, so some parts here contain Debian specific commands (which should apply to Ubuntu just as well) but I suppose there are equivalents in non-Debian based distributions for them (contributions welcome).
So let´s get right to it. There are two options to running in wine:
1. Use wine up to and including version 1.1.26
2. Patch and compile wine (>=1.1.27) yourself (no worries I will try and make this as painless as possible, so anybody who is able to insert smileys in chats should be able to follow)
Please note, that I´m trying to make this as easy as possible for any non-tech-savvy user, so those with experience in linux should get along without reading any further (Feedback and contributions are very welcome though). For all the others which this Howto is aimed at, please let me know if I overcomplicate things or where there is something unclear. Don´t hesitate to ask.
root# <command>means that <command> must be run as root/superuser/admin whatever you like to call it. There are several ways to do this, either type "su" in the shell prompt and supply your root password before actually running the command (or 'su -c "<command>"' for that matter) or if you have sudo set up then "sudo <command>" and supplying your user password is equivalent. Note that you shouldn´t run as root if not neccessary, so do yourself the favour to "exit" the root shell after those commands by either executing the command "exit" or by hitting CTRL+D.
user$ <command>means that <command> can and should be run as the normal user you login as. (Running commands as root unnecessarily is just asking for trouble! You have been warned, twice!)
#without anything else and somewhere inline either in a command line or anywhere else shall be a comment and does nothing other than be a bit more verbose about what is about to hapen or whatever.
So now let´s really get started and take the gloves off.
- Install wine (<=1.1.26)
- Install ROF_ICE_Unlimited_Demo_1021b.exe
- Update the game content
- Run DServer.exe You should have edited your .sds file as shown on the wiki, see the link above.
root# apt-get install wineIn Debian squeeze you will get wine 1.0.1 installed which will install RoF Demo and run DServer just fine, but other programs (like Iron Front dedicated server) might not want to run properly with such an admittedly ancient version of wine, which is the reason, I had to find Option 2 the hard way.
user$ wine path/to/ROF_ICE_Unlimited_Demo_1021b.exeNote: This will unpack silently to a folder called temp_RoF in your present working directory (type "pwd" to get where this is). I only make this a note, because the folder wasn´t removed after intallation. So if you ever run low on disk space you might want to remember this or you could use the contents of temp_RoF for reinstallation, since that skips the initial unpacking procedure. After the installation is finished, that post-install screen will popup and ask what else to install/do, uncheck everything except "Install MS VC++ 2005 Reditributable" unless you actually want to play RoF under wine (haven´t tried that).
# change present working directory after finding where rof_updater.exe is and run rof_updater # this is a nested shell command to do the magic for you # just copy from your browser (without the "user$" and paste to the terminal with SHIFT+INSERT or middle mouse click) user$ cd "$(dirname "$(find ~/.wine -name rof_updater.exe)")" && wine rof_updater.exeLet the rof_updater do its thing. After successfully updating the game content the DirectX Setup window will popup, just click cancel there. Because of that there will be an error message about a failed update, just ignore it and click "Cancel" in the RoF updater as well, the game content will have been updated properly nonetheless.
# again a little shell magic to find and change directory to where DServer.exe is and run it user$ cd "$(dirname "$(find ~/.wine -name DServer.exe)")" user$ wine DServer.exe [path/to/sds-file.sds]path/to/sds-file.sds is optional which is why it is in , omit the  when you actually run the command, but you can always use the open dialog from the menu.
- Get the build dependencies for wine
- Get the source code of wine http://sourceforge.n...e/files/Source/" onclick="window.open(this.href);return false;">http://sourceforge.n...e/files/Source/ As of this writing the current stable version is 1.4.1 and I recommend downloading it.
- Unpack the source code archive
- Patch the source code Go to http://bugs.winehq.o...rs=1&format=raw" onclick="window.open(this.href);return false;">http://bugs.winehq.o...ttachment.cgi?i … format=raw and save it as say wine-RoF-no-hang-on-exit.patch but the name and file ending don´t matter at all, you just have to remember what you called it and where you put it. Preferably save it directly in the source directory ~/src/wine-1.4.1/
- Configure and compile wine
root# apt-get build-dep wineThis will install all the packages the Debian developers use for building wine-1.0.1 on a Debian squeeze system.
# You should be in a directory where you have write permission # I usually use ~/src (Note the ~ which is a shorthand for your home directory) # make the directory if it doesn´t exist already user$ mkdir -p ~/src # -p switch to stop the complaints if the directory already exists user$ cd ~/src user$ tar xvjf /path/to/wine-1.4.1.tar.bz2 # You´ll see lots of files shown on the terminal # now go to the new directory wine-1.4.1 which was just created during unpacking user$ cd wine-1.4.1
# Check, whether the "patch" program is installed and if not install it user$ patch –version # If you see some output about the version, copyright, warranty etc. you´re good to go. # If not, install it via root# apt-get install patch # Double check if we are still in the source directory user$ pwd # Should output something like /home/.../src/wine-1.4.1 # Alright and now let´s patch it up: user$ patch -p1 < wine-RoF-no-hang-on-exit.patch patching file server/sock.c Hunk #1 succeeded at 595 (offset 7 lines).
# speedup "make" by running in parallel user$ alias make="make -j4" # This means, that everytime the command "make" is to be executed # the shell will replace it with "make -j4", which is just the same # but make will run 4 tasks at a time. So replace "4" with the number # of cores your CPU has (the number_of_cores*2 for a hyperthreaded Processor) # run ./configure and disable some unnecissary code we won´t use or need user$ ./configure –disable-tests # at the very end there will most certainly be some warnings # about some missing build dependencies. You can´t have them all can you? ;) # Let´s ignore these for now, if we are on a Debian squeeze system, # because apt-get build-dep got us the essential ones already. # Otherwise, if you opted to not use apt-get build-dep or are running # a different system, please refer to the WineHQ-Wiki. # # now let´s do the real compiling. user$ make depend && make # This will produce all kinds of cryptic output for the non-technical # user and it will take quite long, in my case about 20 minutes. # Grab a coffee and enjoy this new kind of screensaver. ;-D # [...] # Now if everything went well, and why shouldn´t it, you will see # "Wine build complete" and proceed to installing it by root# make installGreat, now proceed with Option 1 step 2.
Note: fixme:… messages on the terminal are not error messages, you can get rid of them by prepending WINEDEBUG=fixme-all before wine on the command line, i.e.
user$ WINEDEBUG=fixme-all wine DServer.exe
Added coolness 1
Download and install "Window Switch" by following the instructions for your respective linux distribution. Also install the Windows version on your local desktop but don´t connect to your server yet!
Now on your remote host run
user$ xpra start :333The number after the : doesn´t really matter but should be somewhere above 100 I´d say, since some other graphical user interfaces like VNC or Remote Dektop might wan´t to claim this range. I don´t know all the reserved ranges though. If you get an error just try another one.
What this does is start a dummy display where you can redirect the graphical output (windows) of any application that has such thing like our dear DServer.exe or rof_updater.exe.
So let´s try it
# cd /path/to/where/the/DServer.exe/is user$ cd "$(dirname "$(find ~/.wine -name DServer.exe)")" user$ DISPLAY=:333 wine DServer.exe [path/to/sds-file.sds]See Option 1 step 4 for reference, the only difference here is the prepended DISPLAY=:333, which tells wine to use this display instead of the default one. And what will you see on the display you are looking at? Exactly nothing, which is the whole point of this exercise.
Now let´s configure a connection in the window switch client on your local machine, see http://winswitch.org...tion/start.html" onclick="window.open(this.href);return false;">http://winswitch.org...tion/start.html for reference:
Left mouse click on the system tray icon brings up the menu, click on "New connection" and enter the IP address or hostname of the remote machine, enter the username you started wine and xpra with. You can either enter the password right there or leave it empty and click "connect", You will then be asked to confirm the SSH Host key fingerprint, just do so and if you haven´t provided your password already, do so now.
Wait a little and you will see a balloon message from the window switch tray icon, cheering out the successful connection, now click that icon again and see the changed menu. The interesting part is the "unknown", click there and then in the submenu resume.
Et voila, there is the window of the DServer.exe. So the application itself runs on the remote machine but redirects its windows to xpra, which "parks" it on a dummy display while you are not connected and redirects it again when you connect via window switch.
Now this is the essential building block to enable running DServer on machine reboot on the remote host, because there is no need to login to a GUI Desktop of any kind to start it. This will be part of "Added coolness 2", where we will see how we can put this all together into a nice, selfrestarting service (or daemon as it is called in linux), which will start running as soon as the machine is up.
Now show me how that would even be possible in Windows!
To be continued… (need a break right now)
TODO: "Added coolness 2" How to actually make the DServer autostart with the operating system on reboots.