GithubHelp home page GithubHelp logo

Linux gsm about valheimplus HOT 14 CLOSED

valheimplus avatar valheimplus commented on May 22, 2024
Linux gsm

from valheimplus.

Comments (14)

That3DPrinterGuy avatar That3DPrinterGuy commented on May 22, 2024 1

Thank you so much for posting this, everything's working and v+ is working wonderfully.

from valheimplus.

That3DPrinterGuy avatar That3DPrinterGuy commented on May 22, 2024

Could you share what your file looks like? I've tried a few edits after " ## Special case: if there is an arg, use that as executable path ..." but nothing seems to be working so having a copy to look at and compare would be super helpful. Also could you share what your vhserver.cfg looks like?

Thank you for making this post btw, was pulling my hair out on how to add it to gsm, now only if i could get it to run. (Server starts but doesn't stay running and I'm not sure why)

from valheimplus.

finalsolarflare avatar finalsolarflare commented on May 22, 2024

Could you share what " ## Special case: if there is an arg, use that as executable path ..." looks like on yours?

Thank you for making this post btw, was pulling my hair out on how to add it to gsm, now only if i could get it to run. (Server starts but doesn't stay running and I'm not sure why)

This is what I commented out:

## Special case: if there is an arg, use that as executable path
## Linux: arg is path to the executable
## MacOS: arg is path to the .app folder which we need to resolve to the exectuable
#if [ -n "$1" ]; then
#    case $os_type in
#        Linux*)
#            executable_path="$1"
#            #echo "executeable_path ${executable_path}"
#	    #exit 1
#            ;;
#        Darwin*)
#            # Special case: allow to specify path to the executable within .app
#            full_path_part=`echo "$1" | grep "\.app/Contents/MacOS"`
#            if [ -z "$full_path_part" ]; then
#                executable_name=`basename "$1" .app`
#                real_executable_name=`defaults read "$1/Contents/Info" CFBundleExecutable`
#                executable_path="$1/Contents/MacOS/${real_executable_name}"
#            else
#                executable_path="$1"
#            fi
#            ;;
#    esac
#fi

from valheimplus.

That3DPrinterGuy avatar That3DPrinterGuy commented on May 22, 2024

I've done that/removed it at one point, what I'm having trouble with is what to do / where to put

"do
case $arg in
-name)
argName=$2
shift 2
;;
-password)
argPassword=$2
shift 2
;;
-port)
argPort=$2
shift 2
;;
-world)
argWorld=$2
shift 2
;;
-public)
argPublic=$2
shift 2
;;
esac
done "
When I add the above code (with Do/Done) and try to start the server it says (In red) Fail no server running on /tmp/tmux-1005/default

If I add the above code without the (Do/Done ((Leaving the rest of the Case code)) ) and start the server I get (in green) OK and looks to start. If I run details it'll show offline, looking at the log file I see "password to short" (zodm1) but I've tried "ThisLongPass" and still it quits on me with the same password to short error, I can share my log file if needed.

from valheimplus.

finalsolarflare avatar finalsolarflare commented on May 22, 2024

Probably easier if I share the whole file

#!/bin/sh
# BepInEx running script
#
# This script is used to run a Unity game with BepInEx enabled.
#
# Usage: Configure the script below and simply run this script when you want to run your game modded.

# -------- SETTINGS --------
# ---- EDIT AS NEEDED ------

# EDIT THIS: The name of the executable to run
# LINUX: This is the name of the Unity game executable 
# MACOS: This is the name of the game app folder, including the .app suffix
executable_name="valheim_server.x86_64"

# The rest is automatically handled by BepInEx

# Whether or not to enable Doorstop. Valid values: TRUE or FALSE
export DOORSTOP_ENABLE=TRUE

# What .NET assembly to execute. Valid value is a path to a .NET DLL that mono can execute.
export DOORSTOP_INVOKE_DLL_PATH="${PWD}/BepInEx/core/BepInEx.Preloader.dll"

# ----- DO NOT EDIT FROM THIS LINE FORWARD  ------
# ----- (unless you know what you're doing) ------

if [ ! -x "$1" -a ! -x "$executable_name" ]; then
    echo "Please open run.sh in a text editor and configure executable name."
    exit 1
fi

doorstop_libs="${PWD}/doorstop_libs"
arch=""
executable_path=""
lib_postfix=""

os_type=`uname -s`
case $os_type in
    Linux*)
        executable_path="${PWD}/${executable_name}"
        lib_postfix="so"
        ;;
    Darwin*)
        executable_name=`basename "${executable_name}" .app`
        real_executable_name=`defaults read "${PWD}/${executable_name}.app/Contents/Info" CFBundleExecutable`
        executable_path="${PWD}/${executable_name}.app/Contents/MacOS/${real_executable_name}"
        lib_postfix="dylib"
        ;;
    *)
        echo "Cannot identify OS (got $(uname -s))!"
        echo "Please create an issue at https://github.com/BepInEx/BepInEx/issues."
        exit 1
        ;;
esac

## Special case: if there is an arg, use that as executable path
## Linux: arg is path to the executable
## MacOS: arg is path to the .app folder which we need to resolve to the exectuable
#if [ -n "$1" ]; then
#    case $os_type in
#        Linux*)
#            executable_path="$1"
#            #echo "executeable_path ${executable_path}"
#	    #exit 1
#            ;;
#        Darwin*)
#            # Special case: allow to specify path to the executable within .app
#            full_path_part=`echo "$1" | grep "\.app/Contents/MacOS"`
#            if [ -z "$full_path_part" ]; then
#                executable_name=`basename "$1" .app`
#                real_executable_name=`defaults read "$1/Contents/Info" CFBundleExecutable`
#                executable_path="$1/Contents/MacOS/${real_executable_name}"
#            else
#                executable_path="$1"
#            fi
#            ;;
#    esac
#fi

executable_type=`LD_PRELOAD="" file -b "${executable_path}"`;

case $executable_type in
    *64-bit*)
        arch="x64"
        ;;
    *32-bit*|*i386*)
        arch="x86"
        ;;
    *)
        echo "Cannot identify executable type (got ${executable_type})!"
        echo "Please create an issue at https://github.com/BepInEx/BepInEx/issues."
        exit 1
        ;;
esac

doorstop_libname=libdoorstop_${arch}.${lib_postfix}
export LD_LIBRARY_PATH="${doorstop_libs}":${LD_LIBRARY_PATH}
export LD_PRELOAD=$doorstop_libname:$LD_PRELOAD
export DYLD_LIBRARY_PATH="${doorstop_libs}"
export DYLD_INSERT_LIBRARIES="${doorstop_libs}/$doorstop_libname"

export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970

### finalsolarflare modifcation ###
argName="Valheim+"
argPassword="password"
argPort=2456
argWorld="world"
argPublic=1

for arg in "$@"
do
	case $arg in
	-name)
	argName=$2
	shift 2
	;;
	-password)
	argPassword=$2
	shift 2
	;;
	-port)
	argPort=$2
	shift 2
	;;
	-world)
	argWorld=$2
	shift 2
	;;
	-public)
	argPublic=$2
	shift 2
	;;
	esac
done

## "${PWD}/${executable_name}" -name "servername" -password "serverpassword" -nographics -batchmode -port 2456 -world "world"

"${PWD}/${executable_name}" -name "${argName}" -password "${argPassword}" -port "${argPort}" -world "${argWorld}" -public "${argPublic}"

export LD_LIBRARY_PATH=$templdpath

from valheimplus.

supermxn avatar supermxn commented on May 22, 2024

https://i.imgur.com/U06Octo.png

Seems like this appears on me

from valheimplus.

finalsolarflare avatar finalsolarflare commented on May 22, 2024

https://i.imgur.com/U06Octo.png

Seems like this appears on me

I think that error is related to binding the server port.
What does the file: ~/lgsm/config-lgsm/vhserver/vhserver.cfg look like? Should look similar to this

#### Game Server Settings ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
servername="Valheim+"
# Minimum password length is 5.
serverpassword="serverpassword"
port=2456
gameworld="${selfname}"
public=1

executable="./run_bepinex.sh"

from valheimplus.

supermxn avatar supermxn commented on May 22, 2024

Same error with putting that as well. I am using Ubuntu 20.04.

from valheimplus.

finalsolarflare avatar finalsolarflare commented on May 22, 2024

I used the following script to try and debug any problems with arguments that were being passed
new file: ~/serverfiles/run_test.sh

#!/bin/sh
for arg in "$@"
do
        case $arg in
                -name)
                servername=$2
                shift 2
                ;;
                -password)
                serverpassword=$2
                shift 2
                ;;
                -port)
                serverport=$2
                shift 2
                ;;
                -world)
                serverworld=$2
                -port)
                serverport=$2
                shift 2
                ;;
                -world)
                serverworld=$2
                shift 2
                ;;
                -public)
                serverpublic=$2
                shift 2
                ;;
        esac
done
echo "vars passed... \n"
echo " -name '${servername}' -password '${serverpassword}' -port '${serverport}' -world '${serverworld}' -public '${serverpublic}'"
while :; do sleep 3600; done;

change lgsm config lgsm/config-lgsm/vhserver/vhserver.cfg
commenting bepinex executable to run_test.sh instead

# executable="./run_bepinex.sh"
executable="./run_test.sh"
  • ./vhserver start
  • tmux a -t vhserver

shows what arguments are being passed

from valheimplus.

gOOvER avatar gOOvER commented on May 22, 2024

-public 1 was removed and is not longer used

from valheimplus.

sirskunkalot avatar sirskunkalot commented on May 22, 2024

Hey, I am writing on a PR that is incorporating am automatic publish system for V+ builds, UnixServer included. I did something similar to this with run_bepinex.sh and would deploy that script on release. I will also add some code which tries to identify (or guess ;)) if it is run within LGSM and act accordingly.

All one needs to do is changing the default.cfg or instance.cfg in LGSM. But maybe we can get them to include some magic into LGSM, too...

from valheimplus.

finalsolarflare avatar finalsolarflare commented on May 22, 2024

I was making it more complicated than it needs to be.
Updated for version 0.8.5 - update the file start_server_bepinex.sh with the following (comment for reference)...

#./valheim_server.x86_64 -name "My server" -port 2456 -world "Dedicated" -password "secret"
./valheim_server.x86_64 "${@}"

Change lgsm config located at ~/lgsm/config-lgsm/vhserver/vhserver.cfg add the following

executable="./start_server_bepinex.sh"

from valheimplus.

sirskunkalot avatar sirskunkalot commented on May 22, 2024

Your version is fine if you want to be LGSM-neutral. Add your params to the run-script or get any of them fomr the arguments.

from valheimplus.

nxPublic avatar nxPublic commented on May 22, 2024

Our start.sh for 0.9.6 should be working on any system now.

from valheimplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.