This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make sure to adjust ALL paths and user/group in the service file (also the ones under "Security and Sandboxing") | |
[Unit] | |
Description=Valheim dedicated server | |
Wants=network-online.target | |
After=syslog.target network.target nss-lookup.target network-online.target | |
[Service] | |
Environment="LD_LIBRARY_PATH=/home/steam/servers/valheim/linux64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reads a files content by a given filename and returns it as a byte[] | |
// returns null if there are problems reading the file | |
public byte[] readBytesFromFileInDownloadsDir(String filename) { | |
if(Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { | |
// we look for the filename in the "Downloads" directory on the sdcard | |
File path = Environment.getExternalStoragePublicDirectory( | |
Environment.DIRECTORY_DOWNLOADS); | |
File file = new File(path, filename); |