Author Topic: HowTo: Set up a Linux Crysis Wars dedicated server  (Read 24895 times)

0 Members and 1 Guest are viewing this topic.

Offline dCK-Apriori

  • MWLL Developer
  • Recruit
  • *
  • Posts: 61
  • l33tp0intz: +6/-0
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #30 on: February 20, 2011, 02:45:33 AM »
@HAARP:
Free NX is not directly a complete X server. I just insist on taking that route because of "convenience" and because of the following points:

1) rcon won't provide you means to update your server
2) complete headless wine won't provide you with direct access to the server (which is sometimes wanted)
3) persistent session support (like your desktop on the server)
4) currently autoupdater won't run too well with wine and you need to dl via torrent using the downloaded update.torrent files

This server is meant to make the whole alpha test procedure a bit more convenient and provide means for non-linux-gurus to update, use, restart and tweak the server.

Offline dCK-Apriori

  • MWLL Developer
  • Recruit
  • *
  • Posts: 61
  • l33tp0intz: +6/-0
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #31 on: February 20, 2011, 03:28:41 PM »
I've got some issues with the server, when a client tries to connect:

Code: [Select]
err:ntdll:RtlpWaitForCriticalSection section 0x1ef5c58 "?" wait timed out in thread 0009, blocked by 0021, retrying (60 sec)
err:ntdll:RtlpWaitForCriticalSection section 0x765090 "?" wait timed out in thread 0021, blocked by 0009, retrying (60 sec)

Did anyone of you see such messages before?

Offline HAARP

  • Living Legend
  • *******
  • Posts: 2332
  • l33tp0intz: +212/-1
  • I regret nothing
    • Clan Jade Wolf
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #32 on: February 20, 2011, 04:24:55 PM »
Oh, these goddamn criticalsection thingies. They alway appear out of nowhere and I have no idea how to debug em. :<
They occasionally happen with many Wine apps and a pita.

Did you deviate from my howto? Tried restarting the server a couple of times? ('wineserver -k' kills all Wine apps) What distro and Wine version? What's the last line in the server.log?
don't bother sending me PMs, I probably won't be reading them in time.

Offline dCK-Apriori

  • MWLL Developer
  • Recruit
  • *
  • Posts: 61
  • l33tp0intz: +6/-0
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #33 on: February 26, 2011, 12:12:44 PM »
Well, no "real" deviation so far. No symlinks in the path tree (which seems to greatly affect the probability of such the critical section thingies). Current version is 1.3.11, still, the server doesn't to be very stable.
Either it is stable from the very beginning or very unstable.

Offline HAARP

  • Living Legend
  • *******
  • Posts: 2332
  • l33tp0intz: +212/-1
  • I regret nothing
    • Clan Jade Wolf
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #34 on: February 27, 2011, 12:00:11 PM »
Ours has been running stable for 6 days now, without a single crash. Granted, nobody plays on it, but it's chugging along nicely and leaking memory as is typical for Cryengine.
I don't know what to tell you, you're doing something differently :/
don't bother sending me PMs, I probably won't be reading them in time.

Offline dCK-Apriori

  • MWLL Developer
  • Recruit
  • *
  • Posts: 61
  • l33tp0intz: +6/-0
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #35 on: February 27, 2011, 03:23:32 PM »
Well, HAARP, the question is, did anyone ever connect to your server? Only in such a case I get the critical section problems (right after the client finished loading and should enter the game).
Mapchanges etc.,  in other words: the server being idle without players works flawless.

Offline HAARP

  • Living Legend
  • *******
  • Posts: 2332
  • l33tp0intz: +212/-1
  • I regret nothing
    • Clan Jade Wolf
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #36 on: February 27, 2011, 03:55:01 PM »
Puretech Sunday is running on our server now. Various maps with up to 22 people on it.
rockstable.
« Last Edit: February 27, 2011, 08:09:08 PM by HAARP »
don't bother sending me PMs, I probably won't be reading them in time.

Offline Seidr

  • Bondsman
  • *
  • Posts: 7
  • l33tp0intz: +2/-0
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #37 on: March 10, 2011, 05:22:32 PM »
Great - thank you for the guide, very helpful. Up and running on Ubuntu 10.10, can't wait to see how it performs! :)

Offline HAARP

  • Living Legend
  • *******
  • Posts: 2332
  • l33tp0intz: +212/-1
  • I regret nothing
    • Clan Jade Wolf
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #38 on: June 04, 2011, 07:12:53 PM »
added crappy server script
don't bother sending me PMs, I probably won't be reading them in time.

Offline ShadoX

  • Bondsman
  • *
  • Posts: 8
  • l33tp0intz: +0/-0
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #39 on: January 02, 2012, 11:34:37 AM »
Hey guys

So im trying to get this going on one of our linux box's but it doesn't seem too want too play

Our box's run Debian 5 and i've compiled and installed Wine 1.3.35 (and it works as our Sven Co-op server, also running in Wine, is running perfectly fine after the upgrade from the v1.1 (or there abouts) that comes in the Debian repository)

Crysis Wars and MWLL were fully updated before it was uploaded too the box also.

Every time i attempt to run the server (using either the command or the script in the first post) it seems to attempt to boot up then throws out the following error
Code: [Select]
err:seh:setup_exception_record stack overflow 820 bytes in thread 0009 eip 7efb09fc esp 00230ffc stack 0x230000-0x231000-0x330000
Which also "locks up" my terminal (doesn't respond to key presses/commands but there is no program running too kill through a 2nd terminal, only way out is too close the terminal and reconnect)

Sometimes randomly it will throw out
Quote
Xvfb failed to start
instead and return me too the terminal

Any ideas? I followed the guide too the letter and rechecked it, everything is definitely in the right spot, is owned by the user whose attempting too start it and is read/writeable (in the /.wine directory)

Happy too provide logs if someone knows where they are :P

Cheers

[edit]

Played around with it a little bit, if i run the Cryswars dedicated server alone with wineconsole (no xvfb) i can see it bootup, gets down to initializing stream engine thats when it throws that error, so its a server error not a MWLL error specifically. Heres what i pulled out of my terminal on boot

Code: [Select]
unicorn:~/.wine/drive_c/Games/CrysisWars/Bin32$ wineconsole CrysisWarsDedicatedS
erver.exe
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:systray:initialize_systray Could not create tray window
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.






               CryEngine2 - Dedicated Server - Version 1.1.1.6729
3DNow!: not present
Serial number not present or disabled
Total number of system cores: 1
Number of cores available to process: 1
---------------------
Windows XP 32 bit SP 4 (build 5.1.2600)
System language: English
Windows Directory: "C:\windows"
Prerequisites...
* Installation of KB940105 hotfix required: no! (either not needed or already i\
nstalled)
Local time is 22:01:34 01/02/12, system running for 0 minutes
2028MB physical memory installed, 1679MB available, 3071MB virtual memory insta\
lled, 17 percent of memory in use
PageFile usage: 0MB, Working Set: 0MB, Peak PageFile usage: 0MB,
Current display mode is 3401428x-1209740777x24, (Unknown graphics card)
IBM enhanced (101/102-key) keyboard and 3+ button mouse installed
-------------------------------------------------------------------------------\
-
Stream Engine Initialization
 Initializing Stream Engine...
] err:seh:setup_exception_record stack overflow 820 bytes in thread 0024 eip 7ef
b09fc esp 00240ffc stack 0x240000-0x241000-0x340000
« Last Edit: January 02, 2012, 12:10:03 PM by ShadoX »

Offline 1N4001

  • Recruit
  • *
  • Posts: 196
  • l33tp0intz: +37/-0
  • no fun allowed
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #40 on: January 02, 2012, 12:13:11 PM »
Check what you defined as the -root parameter (e.g. -root "C:/Games/CrysisWars/server"). The server log should be there. Only the last dozens of lines should be relevant, post those.

Plain wineconsole without X / Xvfb is not going to work.

Offline Mitchpate

  • Star Colonel
  • ****
  • Posts: 1271
  • l33tp0intz: +39/-0
    • NetBattletech
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #41 on: January 02, 2012, 07:43:12 PM »
I hate linux with a fiery passion but a couple things in your error output seem to stick out.  Idk if they're relevant but they certainly seem to be.


Quote
unicorn:~/.wine/drive_c/Games/CrysisWars/Bin32$ wineconsole CrysisWarsDedicatedS
erver.exe
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Is X running and being called correctly?

Quote
Windows XP 32 bit SP 4 (build 5.1.2600)
SP4 doesn't exist.

Quote
PageFile usage: 0MB, Working Set: 0MB, Peak PageFile usage: 0MB
No RAM being allocated to the server?

Quote
Current display mode is 3401428x-1209740777x24, (Unknown graphics card)
Unsupported graphics mode.
Mitchpate
NBT Admin Team

Offline 1N4001

  • Recruit
  • *
  • Posts: 196
  • l33tp0intz: +37/-0
  • no fun allowed
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #42 on: January 02, 2012, 07:58:39 PM »
Mitchpate, he is running neither X nor Xvfb. It can't possibly work, hence the fucked up graphics mode.

I am currently working on updating my server script to make it easier to run these servers. Please be patient.

Offline 1N4001

  • Recruit
  • *
  • Posts: 196
  • l33tp0intz: +37/-0
  • no fun allowed
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #43 on: January 02, 2012, 08:19:58 PM »
Here is the new server script. This script now supersedes the tutorial, so make sure to use the script instead!
Highlights for this version include
- Crysis server console is now available on the controlling terminal. Theres is absolutely no reason at all to ever EVER need an X server now.
- Removed dependency on xvfb-run (not Xvfb!) since not everybody had this script.

For other changes see the changelog at the bottom.

Save it in a file, edit the part indicated by the comments, make the file executable (chmod +x) and run it. Everything should be self-explanatory. If not, ask.

Enjoy!

Code: [Select]
#!/bin/bash

# mwllserver v0.6.1 by haarp
# DO WHAT THE FU CK YOU WANT TO PUBLIC LICENSE

# Run the Windows Crysis Wars dedicated server (+ MWLL mod) with Wine on Xvfb, requiring no X server
# The regular Crysis server console will be available through ncurses on the controlling terminal

# Requirements: Xvfb, xprop, GLX, Wine >=1.3.11, ncurses. screen is recommended.
# - A working Wine environment with Microsoft's vcrun2005 package
# (easy mode: replace the windows folder in DRIVE_C with this one: http://pytak.org/shared/windows.7z )
# - A working Crysis Wars installation

# Useful info:
# http://www.crydev.net/wiki/index.php/Crysis_Wars_Server_Documentation
# http://wiki.mechlivinglegends.net/index.php?title=Dedicated_Server

# !! Set these variables: -------------------------------------------------------------------
DRIVE_C="/home/haarp/.wine/drive_c" # Wine's C: drive
WARS_DIR="Games/CrysisWars" # Crysis Wars install dir. Relative to DRIVE_C!
ROOT_DIR="Games/CrysisWars/server" # Root dir for configs and logs. Relative to DRIVE_C!
# Please remove sv_port and RCon stuff from server.cfg. They are set below:
PORT="64100" # Gameserver port
RCON_PORT="64101" # Ingame RCon port
RCON_HTTP_PORT="64102" # HTTP/XMLRPC RCon port
RCON_PASS="blahblah" # RCon password
# !! ----------------------------------------------------------------------------------------


startserver() {
if [[ "$1" == "debug" ]]; then
winedbg="err-winediag"; backend="user"
else
winedbg="-all"; backend="curses"
fi

echo "Launching Wine..."
DISPLAY=":$xdisplay" WINEDEBUG="$winedbg" wineconsole --backend="$backend" \
"${DRIVE_C}/${WARS_DIR}/Bin32/CrysisWarsDedicatedServer.exe" \
-mod MWLL -root "C:/${ROOT_DIR}" +sv_port "$PORT" +exec server.cfg \
+rcon_startserver port:"$RCON_PORT" pass:"$RCON_PASS" +http_password "$RCON_PASS" +http_startserver port:"$RCON_HTTP_PORT"
echo "Wine has quit."
}

startxvfb() {
xdisplay=10
while [[ -e /tmp/.X${xdisplay}-lock ]]; do
xdisplay=$(( ${xdisplay}+1 ))
done

xvfbout="$(mktemp --suffix ".xvfb")"
Xvfb ":$xdisplay" -screen 0 1x1x24 &>"$xvfbout" &
xvfb_pid=$!
sleep 2

xprop -display ":$xdisplay" -root &>/dev/null || \
{ echo -e "Xvfb failed to start!\n"; tail -n16 "$xvfbout"; rm "$xvfbout"; exit 1; }

echo "Xvfb successfully started on DISPLAY=:"$xdisplay""
rm "$xvfbout"
}

checkrun() {
if [[ -e "${DRIVE_C}/${ROOT_DIR}/.automode" ]]; then
echo "Server already running (auto-mode), aborting!"
echo "If you are sure that it is not, remove ${DRIVE_C}/${ROOT_DIR}/.automode"
exit 1
elif ps -a | grep -q CrysisWarsDed; then
echo "Server already running (single mode?), aborting!"
exit 1
fi
}

usage() {
echo "Usage: $(basename $0) [auto|single|restart|stop] [debug]"
echo -e "\n'auto': Auto-mode; restart the server in the event of a crash."
echo "'single': No Auto-mode; terminate when server shuts down. Great for testing!"
echo "'restart' or 'boot': Restart the currently running auto-mode server."
echo "'stop' or 'kill': Quit the currently running auto-mode server."
echo "'debug': Display Wine log instead of the server console."
echo -e "\nSuggestion: Run through screen once everything is set up and working:"
echo "'screen -S mwll $(basename $0)' (detach with Ctrl+a, d  reattach with 'screen -r mwll')"
exit
}

if [ $# != 1 -a $# != 2 ]; then usage; fi
case "$1" in
auto)
checkrun
startxvfb
trap "rm "${DRIVE_C}/${ROOT_DIR}/.automode" &>/dev/null; killall CrysisWarsDedicatedServer.exe; kill $xvfb_pid; exit" SIGHUP SIGINT SIGTERM

touch "${DRIVE_C}/${ROOT_DIR}/.automode"
while [[ -f "${DRIVE_C}/${ROOT_DIR}/.automode" ]]; do
startserver "$2"
sleep 5
done

sleep 2
kill $xvfb_pid
;;

single)
checkrun
startxvfb
trap "killall CrysisWarsDedicatedServer.exe; kill $xvfb_pid; exit" SIGHUP SIGINT SIGTERM

startserver "$2"

sleep 2
kill $xvfb_pid
;;

restart | boot)
killall CrysisWarsDedicatedServer.exe
;;

stop | kill)
rm "${DRIVE_C}/${ROOT_DIR}/.automode" &>/dev/null
killall CrysisWarsDedicatedServer.exe
;;

*)
usage
;;
esac


# ChangeLog:
# 0.6:
# -Crysis server console is now available on the controlling terminal
# -Revised the entire script for increased durability
# -Added a ton of explanations and infos
# -Added and clarified usage (command-line options)
# -Put paths into variables for easier customization
# -Extracted port and RCON settings into variables
# -Removed dependency on xvfb-run and at the same time slightly improved performance
# -Will no longer kill all instances of Xvfb, only the one it spawned itself
# -Will no longer kill all instances of Wine, only CrysisWarsDedicatedServer.exe
# 0.6.1:
# -Script now checks whether Xvfb started correctly and displays its output if not
# -Automatically find free X display starting at :10  instead of hardcoding :90
# -Added 'debug' command line option to show Wine log instead of server console

# TODO: Allow multiple instances (with different ROOT_DIR and PORT)
# -> remove 'killall CrysisWarsDedicatedServer.exe' in favor of lock files, adjust checkrun
# TODO: Resize wineconsole with controlling terminal
# -> needs newer Wine: http://www.winehq.org/pipermail/wine-patches/2010-November/095899.html
« Last Edit: January 03, 2012, 01:43:29 PM by 1N4001 »

Offline Mitchpate

  • Star Colonel
  • ****
  • Posts: 1271
  • l33tp0intz: +39/-0
    • NetBattletech
Re: HowTo: Set up a Linux Crysis Wars dedicated server
« Reply #44 on: January 02, 2012, 08:31:31 PM »
- Crysis server console is now available on the controlling terminal. Theres is absolutely no reason at all to ever EVER need an X server now.
That eliminates probably 90% of the things that could go wrong with this.  Nice.
Mitchpate
NBT Admin Team