From 1342f34e3ad993d99b9a3665d1627c87c8a0eceb Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Fri, 25 Dec 2015 13:34:51 +0100 Subject: [PATCH] initial commit --- README | 108 ++++++++++++++++ README.md | 2 - installed_packages.txt | 106 ++++++++++++++++ rust.service | 15 +++ server_commands.txt | 272 +++++++++++++++++++++++++++++++++++++++++ wine_rust_instance.sh | 57 +++++++++ wine_update_rust.sh | 5 + 7 files changed, 563 insertions(+), 2 deletions(-) create mode 100644 README delete mode 100644 README.md create mode 100644 installed_packages.txt create mode 100644 rust.service create mode 100644 server_commands.txt create mode 100755 wine_rust_instance.sh create mode 100755 wine_update_rust.sh diff --git a/README b/README new file mode 100644 index 0000000..d46280b --- /dev/null +++ b/README @@ -0,0 +1,108 @@ +Linux scripts for Rust + +Rust homepage: http://playrust.com + http://playrust.com/dedicated-server/ + +By the date 2015-12-25 there is no native Linux dedicated server for Rust. +It is possible to install the dedicated with some effort, but one of the +libraries as unsolvable dependencies to GLX-functions. It seems this is +a packaging/build problem of the Rust developers. +The most (community) recommended way for a Linux dedicated Server is running +wine as emulation. At least wine 1.7 is required. + +I'm using Archlinux, because it uses the latest possible wine version. +The following scripts should help you to create a linux dedicated server +including systemd start/stop stuff. +I also included inside the startscript a few comments about command line +parameters. + +To Install wine, you need to enable the "multilib" repository for pacman, +see: + + https://wiki.archlinux.org/index.php/Multilib + +Some informations about wine: + https://wiki.archlinux.org/index.php/Wine + +I installed the following packages for wine: + + wine wine-mono wine_gecko winetricks + +The wine application will run inside a x11 framebuffer version, which +we won't directly access using "xvfb-run", this needs the package: + + extra/xorg-server-xvfb + +A complete list of the installed packages can be found in installed_packages.txt + +I'm running the server under an extra user called "rust", which you need to +create as root user and set a password: + + useradd -m rust + passwd rust + +Login via SSH to your new rust account rust@servername and do the following +steps: + + # git clone https://github.com/MaStr/rust_dedicated_linux.git + +Get the Rust server, this URL may change, check rust homepage link above: + + # wget http://playrust.com/wp-content/uploads/2015/04/Rust_Server.zip + # unzip Rust_Server.zip + +Now prepare the server + + # ~/rust_dedicated_linux/wine_update_rust.sh + +The next step is to create a copy of the instance script with your details + + # cd ~/rust_dedicated_linux/ + # cp wine_rust_instance.sh wine_rust_myserver.sh + +Edit and adjust your server settings: + + # nano wine_rust_myserver.sh + +Test the server instance, the startup may take a while: + + # ./wine_rust_myserver.sh + +To check what is going on, open a second session, change the folder, you +will find a logfile named by your server instace file: + + # cd ~/Server/rustds/ + # tail myserver_output.txt + +Maybe you can't find the server in your client's server list (community servers), +so to connect to your server by hand, open up the console with the "F1" key. +Enter the following line to manually connect to your server: + + client.connect : + + +---- Prepare for automatic startup +Create a copy of the service file and adjust it with your script name + + # cp rust.service rustmyserver.service + # nano rustmyserver.service + +Switch to user root (su) and that place the file to your service folders: + + # cp rustmyserver.service /etc/systemd/system/ + # systemct daemon-reload + +To start the server run + + # systemctl start rustmyserver.service + +To enable autostart + + # systemctl enable rustmyserver.service + +The service-file will restart the dedicated server if it fails unexpectetly. + +---- RCON tools +I wasn't able to find a command line tool for connecting to the server, so you +need at least a windows tool like "Rusty" for remote administration: + http://oxidemod.org/threads/rusty-server-rcon-administration-tool.543/page-30 diff --git a/README.md b/README.md deleted file mode 100644 index d280cb4..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# rust_dedicated_linux -Scripts for running a rust dedicated server - wine based diff --git a/installed_packages.txt b/installed_packages.txt new file mode 100644 index 0000000..2c63c97 --- /dev/null +++ b/installed_packages.txt @@ -0,0 +1,106 @@ +bash +bzip2 +coreutils +cryptsetup +device-mapper +dhcpcd +diffutils +e2fsprogs +file +filesystem +findutils +gawk +gcc-libs +gettext +glibc +grep +gzip +htop +inetutils +iproute2 +iputils +jfsutils +less +lib32-ocl-icd +licenses +linux +logrotate +lvm2 +man-db +man-pages +mdadm +nano +net-tools +netctl +ocl-icd +openssh +pacman +pciutils +pcmciautils +perl +procps-ng +psmisc +pulseaudio +pulseaudio-alsa +reiserfsprogs +s-nail +sed +shadow +sudo +sysfsutils +syslinux +systemd-sysvcompat +tar +texinfo +usbutils +util-linux +vim +wget +which +wine +wine-mono +wine_gecko +winetricks +xf86-video-fbdev +xf86-video-vesa +xfsprogs +xorg-bdftopcf +xorg-iceauth +xorg-luit +xorg-mkfontdir +xorg-mkfontscale +xorg-server +xorg-server-utils +xorg-server-xvfb +xorg-sessreg +xorg-setxkbmap +xorg-smproxy +xorg-x11perf +xorg-xauth +xorg-xbacklight +xorg-xcmsdb +xorg-xcursorgen +xorg-xdpyinfo +xorg-xdriinfo +xorg-xev +xorg-xgamma +xorg-xhost +xorg-xinput +xorg-xkbcomp +xorg-xkbevd +xorg-xkbutils +xorg-xkill +xorg-xlsatoms +xorg-xlsclients +xorg-xmodmap +xorg-xpr +xorg-xprop +xorg-xrandr +xorg-xrdb +xorg-xrefresh +xorg-xset +xorg-xsetroot +xorg-xvinfo +xorg-xwd +xorg-xwininfo +xorg-xwud diff --git a/rust.service b/rust.service new file mode 100644 index 0000000..cb9c0db --- /dev/null +++ b/rust.service @@ -0,0 +1,15 @@ +[Unit] +Description=Rust-Server +After=syslog.target network.target + +[Service] +ExecStart=/home/rust/rust_dedicated_linux/wine_rust_myserver.sh +User=rust +Group=rust +Type=simple +Restart=on-failure +RestartSec=42s + + +[Install] +WantedBy=multi-user.target diff --git a/server_commands.txt b/server_commands.txt new file mode 100644 index 0000000..14bf756 --- /dev/null +++ b/server_commands.txt @@ -0,0 +1,272 @@ +You can get this list via RCON tool using the command "help" or "find ." . + +The following list is by date 2015-12-25: + + +====> EACH Variable can be used/added as a + option in wine_rust_instance.sh + + +Variables: +aianimation.groundorient no description (True) +aianimation.speedscale no description (True) +aianimation.qualitydistance no description (100) +lerp.enabled Enables interpolation on network positions (True) +lerp.smoothing The higher this value the more post process smoothing applied. 0 = accurate, 1 = smooth (0.5) +lerp.time How many seconds behind to lerp. 0 is the most accurate but can be the most jittery (0.1) +ai.think no description (True) +ai.move no description (True) +ai.sensetime no description (1) +ai.frametime no description (5) +ai.tickrate no description (5) +antihack.enabled is antihack enabled at all (True) +antihack.admincheat are admins allowed to use their admin cheat (True) +antihack.objectplacement use antihack to verify object placement by players (True) +antihack.playerdamage use antihack to verify damage caused by players (True) +antihack.userlevel 0 == users, 1 == admins, 2 == developers (2) +antihack.enforcementlevel 0 == no enforcement, 1 == kick, 2 == ban (DISABLED) (0) +antihack.relaxationrate the rate at which violation values go back down (0.1) +antihack.relaxationpause the time before violation values go back down (5) +antihack.maxviolation violation value above this results in enforcement (5) +antihack.noclip_protection 0 == disabled, 1 == raycast, 2 == spherecast (2) +antihack.noclip_reject whether or not to reject movement when noclip is detected (True) +antihack.noclip_penalty violation penalty to hand out when noclip is detected (4) +antihack.speedhack_protection 0 == disabled, 1 == enabled (1) +antihack.speedhack_reject whether or not to reject movement when speedhack is detected (False) +antihack.speedhack_penalty violation penalty to hand out when speedhack is detected (4) +antihack.speedhack_forgiveness speed threshold to assume speedhacking, lower value = more false positives (2) +antihack.speedhack_deltatime time interval to calculate speed in, lower value = more false positives (0.2) +antihack.speedhack_tickets required number of speeding tickets to trigger a violation (15) +antihack.speedhack_history speeding ticket history length (20) +antihack.flyhack_protection 0 == disabled, 1 == simple, 2 == advanced (DISABLED) (1) +antihack.flyhack_reject whether or not to reject movement when flyhack is detected (False) +antihack.flyhack_penalty violation penalty to hand out when flyhack is detected (4) +antihack.flyhack_forgiveness distance threshold to assume flyhacking, lower value = more false positives (2) +antihack.debuglevel 0 == silent, 1 == print max violation, 2 == print every violation (1) +audio.master Volume (1) +audio.music Volume (1) +audio.game Volume (1) +audio.voices Volume (1) +audio.ambience Ambience System (True) +audio.speakers Volume (2) +batching.colliders no description (True) +batching.verbose no description (0) +chat.enabled Enable or disable chat displaying (True) +chat.serverlog no description (True) +construct.frameminutes How many minutes before a placed frame gets destroyed (30) +craft.instant no description (False) +decay.scale no description (1) +decay.debug no description (False) +env.time no description (12.0159) +env.day no description (25) +env.month no description (5) +env.year no description (2024) +file.time no description (False) +fps.limit The maximum number of frames to render per second (256) +fps.graph no description (0) +gc.interval no description (-1) +global.gamepool no description (False) +global.safemode no description (False) +global.debugmode no description (False) +global.shaderwarmup no description (1) +global.assetwarmup no description (1) +global.prefabwarmup no description (1) +global.maxthreads no description (8) +global.censornudity no description (True) +global.perf no description (0) +global.god If you're an admin this will enable god mode (False) +global.skincol If you're an admin you can change your skin colour using this variable (0-1) (-1) +global.skintex If you're an admin you can change your skin texture using this variable (0-1) (-1) +global.skinmesh If you're an admin you can change your head mesh using this variable (0-1) (-1) +global.timewarning no description (False) +global.developer no description (0) +graphics.shadowlights no description (1) +graphics.drawdistance no description (2500) +graphics.hud no description (True) +graphics.chat no description (True) +graphics.branding no description (True) +graphics.dof no description (False) +graphics.dof_aper no description (12) +graphics.dof_blur no description (1) +graphics.quality The currently selected quality level (0) +graphics.shadowdistance no description (100) +graphics.shadowcascades no description (1) +graphics.fov no description (75) +graphics.lodbias no description (0.5) +graphics.shaderlod no description (2147483647) +graphics.uiscale no description (1) +graphics.af no description (1) +graphics.parallax no description (0) +heli.lifetimeminutes no description (15) +heli.guns no description (1) +heli.bulletdamagescale no description (1) +heli.bulletaccuracy no description (2) +net.visdebug Turns on debug display of network visibility (False) +net.debug no description (False) +net.log no description (False) +physics.droppedmode The physics mode that dropped items and corpses should use. good, tempgood or fast. fast + tempgood might cause objects to fall through other objects. (good) +physics.bouncethreshold no description (2) +physics.sleepthreshold no description (0.005) +physics.solveriterationcount The default solver iteration count permitted for any rigid bodies (default 7). Must be positive (3) +physics.steps The amount of physics steps per second (10) +sentry.targetall target everyone regardless of authorization (False) +server.ip no description () +server.port no description (28015) +server.maxplayers no description (10) +server.hostname no description (AoD) +server.identity no description (AoD1) +server.level no description (Procedural Map) +server.seed no description (innnnnn) +server.salt no description (0) +server.worldsize no description (0) +server.saveinterval no description (600) +server.secure no description (True) +server.tickrate no description (10) +server.entityrate no description (16) +server.official no description (False) +server.globalchat no description (True) +server.stability no description (True) +server.radiation no description (False) +server.itemdespawn no description (180) +server.pve no description (False) +server.description no description () +server.headerimage no description () +server.url no description () +server.eac no description (1) +server.updatebatch How many entity updates should we send per loop. Setting this > 1000 might cause lag when a player first joins your server. (128) +server.planttick Plants tick every x seconds. This is how many seconds between ticks. (60) +server.planttickscale Setting this to 2 will make plants grow, fruit and die two times faster than normal. (1) +server.respawnresetrange Distance from sleeping bag to reset other sleeping bags/beds. (50) +server.maxunack Max amount of unacknowledged messages before we assume we're congested (4) +server.rootfolder no description (server/AoD1) +server.backupfolder no description (backup/0/AoD1) +server.backupfolder1 no description (backup/1/AoD1) +server.backupfolder2 no description (backup/2/AoD1) +server.backupfolder3 no description (backup/3/AoD1) +server.compression no description (False) +server.netlog no description (False) +spawn.min_rate no description (0.1) +spawn.max_rate no description (1) +spawn.min_density no description (0.1) +spawn.max_density no description (1) +stability.verbose no description (0) +stability.queuewarmup no description (True) +stability.passes no description (10) +terrain.quality no description (100) +terrain.pvt no description (False) +time.fixeddelta Fixed delta time in seconds (0.1) +time.maxdelta The minimum amount of times to tick per frame (0.33) +vis.damage Turns on debug display of damages (False) +vis.attack Turns on debug display of attacks (False) +vis.triggers Show trigger entries (False) +voice.loopback no description (False) +water.quality no description (0) +xmas.enabled no description (True) +xmas.spawnrange no description (50) +xmas.giftsperplayer no description (2) +rcon.password no description (xxxx) +rcon.port no description (28016) +rcon.ip no description (0.0.0.0) +nametags.enabled no description (True) + + + + +Commands: +global.status( ) Print out currently connected clients etc +global.kick( void ) no description +global.kickall( void ) no description +global.ban( void ) no description +global.moderatorid( void ) no description +global.ownerid( void ) no description +global.removemoderator( void ) no description +global.removeowner( void ) no description +global.banid( void ) no description +global.unban( void ) no description +global.players( ) Print out currently connected clients etc +global.say( ) Sends a message in chat +global.users( ) Show user info for players on server. +global.banlist( ) List of banned users (sourceds compat) +global.banlistex( ) List of banned users - shows reasons and usernames +global.listid( ) List of banned users, by ID (sourceds compat) +global.mutevoice( void ) no description +global.unmutevoice( void ) no description +global.mutechat( void ) no description +global.unmutechat( void ) no description +global.clientperf( void ) no description +batching.status( void ) no description +chat.say( void ) no description +craft.add( void ) no description +craft.canceltask( void ) no description +craft.cancel( void ) no description +data.export( void ) no description +debug.flushgroup( ) Takes you in and out of your current network group, causing you to delete and then download all entities in your PVS again +debug.breakheld( ) Break the current held object +debug.breakitem( ) Break all the items in your inventory whose name match the passed string +entity.debug_toggle( void ) no description +entity.nudge( void ) no description +env.addtime( void ) no description +gc.collect( void ) no description +gc.unload( void ) no description +global.warmup( void ) no description +global.restart( ) Restart the server - with 60 seconds warning +global.quit( ) Leave the game +global.report( void ) no description +global.objects( void ) no description +global.textures( void ) no description +global.colliders( void ) no description +global.error( void ) no description +global.queue( void ) no description +global.setinfo( void ) no description +global.sleep( void ) no description +global.kill( void ) no description +global.respawn( void ) no description +global.injure( void ) no description +global.spectate( void ) no description +global.respawn_sleepingbag( void ) no description +global.respawn_sleepingbag_remove( void ) no description +global.status_sv( void ) no description +global.status_cl( void ) no description +global.teleport( void ) no description +global.teleport2me( void ) no description +global.teleportany( void ) no description +global.cleanup( void ) no description +global.version( void ) no description +global.sysinfo( void ) no description +heli.drop( void ) no description +heli.calltome( void ) no description +heli.call( void ) no description +heli.strafe( void ) no description +hierarchy.ls( void ) no description +hierarchy.cd( void ) no description +hierarchy.del( void ) no description +inventory.endloot( void ) no description +inventory.give( void ) no description +inventory.giveall( void ) no description +inventory.givebpall( void ) no description +inventory.giveto( void ) no description +inventory.giveid( void ) no description +inventory.givearm( void ) no description +inventory.givebp( void ) no description +pool.stats( void ) no description +pool.prefabs( void ) no description +pool.assets( void ) no description +pool.clear( void ) no description +server.start( ) Starts a server +server.stop( string DisconnectMessage ) Stops a server +server.backup( ) Backup server folder +server.writecfg( ) Writes config files +server.fps( void ) no description +server.save( ) Force save the current game +server.readcfg( void ) no description +spawn.fill_populations( void ) no description +spawn.fill_groups( void ) no description +weather.clouds( void ) no description +weather.fog( void ) no description +weather.wind( void ) no description +weather.rain( void ) no description +world.monuments( void ) no description +xmas.refill( void ) no description +global.dump( void ) no description +global.find( string Name ) Search for a command +global.echo( string output ) Prints something to the debug output +cui.test( void ) no description diff --git a/wine_rust_instance.sh b/wine_rust_instance.sh new file mode 100755 index 0000000..e7106b0 --- /dev/null +++ b/wine_rust_instance.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +## Create a copy for each your instance + +## Remote Administration Options +rcon_ip="0.0.0.0" +rcon_port=28016 # This port is TCP +rcon_password="yourPassword" + +## Server configuration +server_hostname="my Server" +server_port="28015" # This port is UDP +server_identity="identity" +server_maxplayers="100" +server_level="Procedural Map" # Don't change +server_url="" # URL displayed at login screen +server_description="" # Description displayed while login +server_seed="nnnnnn" # Replace with a random number + +# InGame variables +decay_scale=1 # 1 = Decay player buildings afert certain amount + # of time + # 0 = Buildings last until reset + + +logfile="${server_identity}_output.txt" + +#Save last Logfile +mv ~/Server/rustds/${logfile} ~/Server/rustds/${logfile}.old + +export WINEARCH=win64 +export WINEPREFIX=/home/rust/.wine64 + +cd ~/Server/rustds +xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' \ + wine RustDedicated.exe \ + -load \ + -batchmode \ + -logFile $logfile \ + -autoupdate \ + +rcon.ip "${rcon_ip}" \ + +rcon.port "${rcon_port}" \ + +rcon.password "${rcon_password}" \ + +server.hostname "${server_hostname}" \ + +server.port "${server_port}" \ + +server.identity "${server_identity}" \ + +server.maxplayers "${server_maxplayers}" \ + +server.level "${server_level}" \ + +server.url "${server_url}" \ + +server.description "${server_description}" \ + +server.seed "${server_seed}" \ + +decay.scale "${decay_scale}" + +## -load => Loads a previously saved map (same seed needed) +## -batchmode => ?? +## -logFile => Writes server output to a txt file +## -autoupdate => Perform server updates if needed diff --git a/wine_update_rust.sh b/wine_update_rust.sh new file mode 100755 index 0000000..e1377bd --- /dev/null +++ b/wine_update_rust.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cd ~/Server/steam +wine steamcmd.exe +runscript ../update_script.txt +