Page 1 of 1

Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 28 Apr 2016, 14:09
by Miso
So, you want to host a JK2 server? Well, there's a right way and a few wrong ways! This is a step-by-step guide on how to host a base server
for both 1.02 and 1.04 using JK2MV, on both Windows and Linux. I plan on adding more to this as I go along, maybe with some screenshots, setting up with mods, etc.

If you get stuck at all, please post below how you are stuck and your error log (if there is one).
Without further ado, let's get into this.

Windows:

1. Download the Dedicated Server Package on the JK2MV Downloads.
2. Create a "portable" Gamedata folder preferably on your desktop. This part is not necessarily mandatory, however it's much cleaner, and if it's not home-hosted (or on your personal computer), then this step becomes mandatory. Drag all the game contents into this almost as if you are about to play it.
3. Extract the corresponding server executable (ie 32-bit or 64-bit) into your Gamedata. I would avoid putting mods / maps in for now until you have everything running.
4. Now, you'll need a server configuration file, an executable which reads all of the server's settings. Here you can adjust to your liking (Server name, bots, force / no force, weapons / no weapons, server slots, password, connecting message, etc). There's many options. If you're unfamiliar with looking at server configs for JK2, things may confuse you at first. However, I'm attaching a sample server.cfg which explains the most vital points of a server configuration file.

SAMPLE SERVER CONFIG:

Code: Select all

//SAMPLE SERVER CONFIG//
 
seta sv_hostname "My Server"
//This is the name of your server. Color codes work on this.
 
seta g_motd "Enjoy your stay and have fun!"
//This is the message you will see while your game is loading onto the server.
 
//Master Server Settings//
seta sv_master1 "masterjk2.ravensoft.com"
//This is the JK2 master server. Do not change this as it can result in your server not showing up on the list.
 
seta sv_master2 "master.ouned.de"
//This is Ouned's master server; the master that is used for when the Ravensoft master is down.
 
seta mv_serverversion "1.04"
//This defines what version of JK2 your server will run on. The options are 1.02, 1.03 and 1.04.
 
///////////////////////////////////////////
 
seta sv_floodprotect "1"
//Prevents people from spamming commands / talking. Not recommended to setting this to 0.
 
seta sv_allowdownload "0"
//Allows people to download custom files from the server to their game. The in-game downloader is very slow and can be considered "unsafe"
 
seta sv_maxrate "25000"
//The server's maximum rate for people's connections. 25000 is typically the max.

seta sv_minping "0"
//The minimum ping allowed for a player to be on the server.

seta sv_maxping "0"
//The maximum ping allowed for a player to be on the server. 0 = infinite
 
seta sv_pure "0"
//Runs the server ignoring whatever custom mods you have.

seta rconpassword ""
//This is your remote server access via in-game. To use, you type in the console /rconpassword <password> and you can adjust server settings or other servercmds. Setting this to blank will result in no rconpassword. Be sure to keep this //safe and private!
 
seta sv_fps "20"
//The server's FPS. 20 is the default; some people use 30. 1.02 players use 100 on CTF servers / Saber servers.
 
seta sv_maxclients "32"
//How many server slots. 32 is the maximum.

seta g_maxgameclients "0"
//This sets how many players are allowed to join the game at once. Lets say the max clients is 16 and there's 16 people on the server, but the maxgameclients is set to 4. That means you will have only 4 players allowed in the game and 12 people in spectator who cannot join. Effectively used in team-mode games, not letting people interrupting. Change is effective on map restart.
 
seta g_password ""
//Password to join the server.
 
seta g_allowvote "0"
//Allows players to vote in game. Keep in mind you can vote for map change, map restart, gametype change, and even vote to kick other players. Most servers don't allow voting unless it's a TFFA server which is used for people to vote for restart, and usually is not abused by random people.
 
//HEALTH & SHIELDS//
 
seta disable_item_shield_lrg_instant "0"
seta disable_item_shield_sm_instant "0"
seta disable_item_medpak_instant "0"
seta disable_item_medpac "0"
seta disable_item_medpak "0"
//These are settings for disabling picking up health and shields. If set to 1, there will be no health / shields.
 
//////////////////////
 
//LOGGING//
seta logfile "1"
//Enables the use of logging the server. Setting to 0 will result in no logging.
 
seta g_log "games.log"
//The log output file.
 
////////////////////
 
seta fraglimit "0"
//The kill limit for the server. 0 = no kill limit.
 
seta timelimit "0"
//The time limit. 0 = no time limit
 
seta g_gametype "0"
//The game mode.
//0 = Free For All
//1 = Holocron
//2 = Jedi Master
//3 = Duel Mode
//5 = Team Free For All
//7 = Capture the Flag
//8 = Capture the Ysalimari
 
seta duel_fraglimit "10"
//How many kills required to win duel mode. 0 = endless
 
seta g_saberlocking "0"
//If set to 1, you can saberlock with people in duels. Most people set to 0.
 
seta g_saberlockfactor "0"
//How often you want saber locks to occur.
 
seta g_weapondisable "65531"
//Which weapons you want to use on the server. 65531 = Saber Only. 0 = All weapons.
 
seta g_duelweapondisable "65531"
//Same thing, but only for Duel Gametype.
 
seta g_forcepowerdisable "163837"
//Which force powers you want people to use. 163837 = Force Jump, Saber Offense, & Saber Defense only. 0 = All force powers enabled. 262143 = all force powers disabled.

seta g_dismember "100"
//Cvar that allows people to be chopped up into bits :D Although people must set it to 100 in their game for it to work, the server must have it set to 100 as well. 0 = disabled
 
seta g_maxforcerank "7"
//How many force points you can assign. 7 is not the actual value of force points. 7 is the maximum, however setting to 200 will give you "unlimited" force points.
 
seta g_forceregentime "0"
//How fast/slow your force will regain. 200 is the default; most people use 0 as it's faster.
 
seta g_forcerespawn "60"
//How fast it takes to respawn without clicking to respawn. This is measured in seconds. Default is 60 seconds.
 
seta g_spawninvulnerability "3000"
//How long you will have a bubble for when spawning. This is also measured in seconds, but a little differently. 3000 is default. 3000 = 3 seconds. 1000 = 1 second.

seta g_speed "250"
//Running speed on the server. 250 is default.

seta g_gravity "800"
//Player's gravity. 800 is default.

/////////////////////////

seta mv_httpdownloads "1"
//The auto-downloader for JK2MV. Set this to 1 if you want people to download clientsides / maps via in-game through JK2MV.

set m1 "map ffa_bespin;set nextmap vstr m2"
set m2 "map ffa_deathstar;set nextmap vstr m3"
set m3 "map ffa_ns_streets;set nextmap vstr m4"
set m4 "map ffa_yavin;set nextmap vstr m1"
vstr m1
//This is a map cycle. You can add more to the cycle as well as remove some. If you want to use only 1 map, simply remove them and have just "map ffa_bespin" or whichever map you are going to use.

//map ffa_bespin 

addbot kyle s s s "^1Sample Bot"
//How to add bots through server startup. "s s s" means they will be in spectator. If you want them in game, put "5 5 0".

seta vm_game "2"
//Tells the game which library to load. If set to 2, it will load the .qvm file (this is what you want). In any case if you were running a custom mod that ran a .dll or .so, you would set this to 0.

//end
By the way if you are not sure how to make a server config file, Just copy the sample server config and paste it in a blank Notepad file. File -> Save, and name it server.cfg

Let's review the files. This is what your folder should look like:

(inside Gamedata folder)
base <- folder
jk2sp.exe
jk2mp.exe
jk2mvded.exe

(inside base folder)
assets0.pk3
assets1.pk3
assets2.pk3
assets5.pk3
server.cfg

(If this is a 1.02 server, then you will be missing assets2 and assets5)

Your system depends on which jk2mvded you should take. Windows = win32 - x64, or win32 - x86. Linux = i386 (32bit) or amd64 (64bit). When you pick the one, I suggest renaming it to just "jk2mvded.exe" instead of "jk2mvded-v1.1.1-win32-x64.exe" or whichever one you are using.

Port Forwarding
Now comes the worst part. This is usually where people give up (mostly if they are home hosting). Your server runs on a port. In this case, the port 28070 is the default, and you are going to have to add a port forward exception on your router's firewall (once again, if home hosting). Now, since every router / provider is different, this part is unfortunately going to be very bland and lacklustre in terms of detail.

Basically, you will want to log onto your router by entering your Router's IP into your web browser. (this can be found by doing /ipconfig all in cmd). For example, 192.168.1.1 is a very common one.

Once logged in, you will want to find your way to your Firewall settings in the router's panel, and/or find something that pertains to Port Forwarding. Select the device you want the port forward to take in affect (for example, maybe your server's IP is 192.168.1.7) and add 28070. When asked if it's TCP or UDP, it's UDP, however I usually just select both if I have the option. If your router has a port range, then enter 28070 - 28071. Apply the settings.

///

Now that the port forwarding is complete, you are now ready to run your server.

On Windows, there's 2 main methods of running your server. I will show you the smarter way.

Open a blank Notepad file, and enter the following:

Code: Select all

jk2mvded +set fs_game base +set net_port 28070 +exec server.cfg
So, fs_game is the gamepath we are leading. If we were hosting a DS-Online server, we'd change this to +set fs_game DS-Online.
+set net_port 28070 just reassures that we will be using the port 28070.
And +exec server.cfg is to read all your settings for the server.

Now, File -> Save , and name this whatever you want with a batch file extension at the end. I suggest maybe something like "server.bat".

You're ready to run the server. Double-click your server.bat and it should open a cmd-type window. You can check if it's running by typing in "status" in the window once everything is done loading. If you get a crash error, it's likely it's because of something in your server.cfg file, however there's many errors and it cannot be for sure, so post your errors if you get one.

Check in-game to see if you can find your server. If it's not there right away, give it a couple minutes. If you don't see anything after that, it's most likely a port forwarding issue. If you are stuck on port forwarding with your provider, try looking up "port forwarding <provider name>" or maybe even <router type> to see if you can find an in-depth tutorial on how to port forward with your device. It does not matter if it's JK2 or not; the idea is basically the same as long as if it's a UDP port.

///


Linux:

This mostly goes under the lines of using a VPS (Virtual Private Server), usually leased by a company. Using a Game Panel will be like half the effort but twice the amount of money. There's a few steps that are pretty similar to the Windows setup, however overall both methods are pretty different.

1. Download the Dedicated Server Package on the JK2MV Downloads.
2. Download an FTP program if you don't already have one (Recommended: WinSCP or FileZilla)
3. Create a portable Gamedata folder and call it either jk2 or .jkii (This is now mandatory and not optional since this is not being home-hosted)
4. Extract the corresponding server executable (ie i386 or amd64) into your Gamedata. I would avoid putting mods / maps in for now until you have everything running.
5. Now, you'll need a server configuration file, an executable which reads all of the server's settings. Here you can adjust to your liking (Server name, bots, force / no force, weapons / no weapons, server slots, password, connecting message, etc). There's many options. If you're unfamiliar with looking at server configs for JK2, things may confuse you at first. However, I'm attaching a sample server.cfg which explains the most vital points of a server configuration file.

SAMPLE SERVER CONFIG:

Code: Select all

//SAMPLE SERVER CONFIG//
 
seta sv_hostname "My Server"
//This is the name of your server. Color codes work on this.
 
seta g_motd "Enjoy your stay and have fun!"
//This is the message you will see while your game is loading onto the server.
 
//Master Server Settings//
seta sv_master1 "masterjk2.ravensoft.com"
//This is the JK2 master server. Do not change this as it can result in your server not showing up on the list.
 
seta sv_master2 "master.ouned.de"
//This is Ouned's master server; the master that is used for when the Ravensoft master is down.

seta mv_serverversion "1.04"
//This defines what version of JK2 your server will run on. The options are 1.02, 1.03 and 1.04.
 
///////////////////////////////////////////
 
seta sv_floodprotect "1"
//Prevents people from spamming commands / talking. Not recommended to setting this to 0.
 
seta sv_allowdownload "0"
//Allows people to download custom files from the server to their game. The in-game downloader is very slow and can be considered "unsafe"
 
seta sv_maxrate "25000"
//The server's maximum rate for people's connections. 25000 is typically the max.

seta sv_minping "0"
//The minimum ping allowed for a player to be on the server.

seta sv_maxping "0"
//The maximum ping allowed for a player to be on the server. 0 = infinite
 
seta sv_pure "0"
//Runs the server ignoring whatever custom mods you have.

seta rconpassword ""
//This is your remote server access via in-game. To use, you type in the console /rconpassword <password> and you can adjust server settings or other servercmds. Setting this to blank will result in no rconpassword. Be sure to keep this //safe and private!
 
seta sv_fps "20"
//The server's FPS. 20 is the default; some people use 30. 1.02 players use 100 on CTF servers / Saber servers.
 
seta sv_maxclients "32"
//How many server slots. 32 is the maximum.

seta g_maxgameclients "0"
//This sets how many players are allowed to join the game at once. Lets say the max clients is 16 and there's 16 people on the server, but the maxgameclients is set to 4. That means you will have only 4 players allowed in the game and 12 people in spectator who cannot join. Effectively used in team-mode games, not letting people interrupting. Change is effective on map restart.
 
seta g_password ""
//Password to join the server.
 
seta g_allowvote "0"
//Allows players to vote in game. Keep in mind you can vote for map change, map restart, gametype change, and even vote to kick other players. Most servers don't allow voting unless it's a TFFA server which is used for people to vote for restart, and usually is not abused by random people.
 
//HEALTH & SHIELDS//
 
seta disable_item_shield_lrg_instant "0"
seta disable_item_shield_sm_instant "0"
seta disable_item_medpak_instant "0"
seta disable_item_medpac "0"
seta disable_item_medpak "0"
//These are settings for disabling picking up health and shields. If set to 1, there will be no health / shields.
 
//////////////////////
 
//LOGGING//
seta logfile "1"
//Enables the use of logging the server. Setting to 0 will result in no logging.
 
seta g_log "games.log"
//The log output file.
 
////////////////////
 
seta fraglimit "0"
//The kill limit for the server. 0 = no kill limit.
 
seta timelimit "0"
//The time limit. 0 = no time limit
 
seta g_gametype "0"
//The game mode.
//0 = Free For All
//1 = Holocron
//2 = Jedi Master
//3 = Duel Mode
//5 = Team Free For All
//7 = Capture the Flag
//8 = Capture the Ysalimari
 
seta duel_fraglimit "10"
//How many kills required to win duel mode. 0 = endless
 
seta g_saberlocking "0"
//If set to 1, you can saberlock with people in duels. Most people set to 0.
 
seta g_saberlockfactor "0"
//How often you want saber locks to occur.
 
seta g_weapondisable "65531"
//Which weapons you want to use on the server. 65531 = Saber Only. 0 = All weapons.
 
seta g_duelweapondisable "65531"
//Same thing, but only for Duel Gametype.
 
seta g_forcepowerdisable "163837"
//Which force powers you want people to use. 163837 = Force Jump, Saber Offense, & Saber Defense only. 0 = All force powers enabled. 262143 = all force powers disabled.

seta g_dismember "100"
//Cvar that allows people to be chopped up into bits :D Although people must set it to 100 in their game for it to work, the server must have it set to 100 as well. 0 = disabled
 
seta g_maxforcerank "7"
//How many force points you can assign. 7 is not the actual value of force points. 7 is the maximum, however setting to 200 will give you "unlimited" force points.
 
seta g_forceregentime "0"
//How fast/slow your force will regain. 200 is the default; most people use 0 as it's faster.
 
seta g_forcerespawn "60"
//How fast it takes to respawn without clicking to respawn. This is measured in seconds. Default is 60 seconds.
 
seta g_spawninvulnerability "3000"
//How long you will have a bubble for when spawning. This is also measured in seconds, but a little differently. 3000 is default. 3000 = 3 seconds. 1000 = 1 second.

seta g_speed "250"
//Running speed on the server. 250 is default.

seta g_gravity "800"
//Player's gravity. 800 is default.

/////////////////////////

seta mv_httpdownloads "1"
//The auto-downloader for JK2MV. Set this to 1 if you want people to download clientsides / maps via in-game through JK2MV.

set m1 "map ffa_bespin;set nextmap vstr m2"
set m2 "map ffa_deathstar;set nextmap vstr m3"
set m3 "map ffa_ns_streets;set nextmap vstr m4"
set m4 "map ffa_yavin;set nextmap vstr m1"
vstr m1
//This is a map cycle. You can add more to the cycle as well as remove some. If you want to use only 1 map, simply remove them and have just "map ffa_bespin" or whichever map you are going to use.

//map ffa_bespin

addbot kyle s s s "^1Sample Bot"
//How to add bots through server startup. "s s s" means they will be in spectator. If you want them in game, put "5 5 0".

seta vm_game "2"
//Tells the game which library to load. If set to 2, it will load the .qvm file (this is what you want). In any case if you were running a custom mod that ran a .dll or .so, you would set this to 0.

//end
Let's review the files. This is what your folder should look like:

(inside home/jk2)
..
base <- folder
jk2sp.exe
jk2mp.exe
jk2mvded

(inside base)
..
assets0.pk3
assets1.pk3
assets2.pk3
assets5.pk3
server.cfg

I suggest renaming your jk2mvded-v1.1.1-linux-i386 (or amd64) to just jk2mvded to save some typing.


Before we run the server, you must set permission settings to the jk2mvded. In your FTP window, right click on jk2mvded -> Properties. You should see a grid of check fields. The very right row should be all unchecked. Check them all from top to bottom (Read, Write, etc).

We are now ready. Log onto your VPS through Terminal, Putty, or whatever it is you use.

The

Code: Select all

screen
command allows you to:
* Use multiple shell windows on a single session
* Run a process for a long time in the background and able to disconnect while it still runs

This is how your JK2 server will keep its uptime.

If you don't have screen, then enter the following command:

Code: Select all

sudo apt-get install screen
Once complete, we're ready. Type in the following:

Code: Select all

screen
Press enter. Will prompt you to press enter 1 or 2 more times.

Now, navigate to your jk2 folder.

Code: Select all

cd home/jk2
And now run the server.

Code: Select all

./jk2mvded +set fs_game base +set net_port 28070 +exec server.cfg
Press enter.

If you get this error:

Code: Select all

jk2mvded : Permission denied
this means that your permission settings are still not set correctly.

Otherwise, your server should be running. Type status to see.
If you get any errors, please paste them below.

You can minimize the server in the cmd window by pressing Ctrl + A, then D.
To quit the server, press Ctrl + A, then type :quit

To get back to your server session, type in:

Code: Select all

screen -r
If you have multiple screen sessions, you'd type in

Code: Select all

screen -ls
This shows your list of screen sessions occurring.

Let's say one of your sessions is named 2842. To access, enter:

Code: Select all

screen -x 2842
Now, you can also name your session to save some time if you'd like.

Enter:

Code: Select all

screen -AmdS jk2server
(you don't have to use jk2server...just a basic example)

and then from there, you enter:

Code: Select all

cd jk2

Code: Select all

./jk2mvded +set fs_game base +set net_port 28070 +exec server.cfg
You could also make a startscript instead of typing the previous command every time. I personally just got into the habit of typing it in each time.



///

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 28 Apr 2016, 18:17
by ouned
nice tutorial and thanks for your effort writing something like this.

the part where you extract the jk2mpgame.qvm on linux should not be necessary though.

here is some detailed documentation regarding the serverside features of JK2MV:
https://github.com/mvdevs/jk2mv/wiki/Server-hosting

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 28 Apr 2016, 18:56
by jozuf
Miso wrote:Well, there's a right way and a few wrong ways!
Thx for explaining the wrong ways.

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 28 Apr 2016, 19:20
by Daggolin
It's nice to see someone making a tutorial about how to host a server, but I have a few corrections to make (sorry):
  • 1.02 CTF is played at sv_fps 100
  • vm_game 0 does NOT tell the game to load the qvm. It actually tells the game to load the native library (dll/so/dylib) instead of the qvm. Under normal circumstances this should always be set to 2. QVM mods are limited in what they can do to prevent the mod from causing any harm on your system. A native library mod is not bound by those limits. It can freely do things on your system like any exe you start can.
  • When enabling httpdownloads in the config it is best practice to also set the httpserverport, as you need to forward that port [TCP], too and you don't want the port to get chosen automatically.
  • Regarding the port forwarding: enabling port forwarding for 28070 TCP has no effect on jk2mv itself. The UDP and TCP ports are independent of each other. Any other application can use the TCP port then. However it does make sense if you set the mv_httpserverport to 28070, too.
  • All those dll and dat files do not belong into the server's folder. All the server needs is
    • jk2mvded / jk2mvded.exe
    • base/assets0.pk3
    • base/assets1.pk3
    • base/assets2.pk3
    • base/assets5.pk3
    The rest is not required.
  • When hosting a jk2mv server for 1.02 there is no need to remove the assets2.pk3 and assets5.pk3. By setting mv_serverversion 1.02 the server will ignore the qvms inside the assets2 and asstes5. All other 1.03/1.04 content - like the new maps - will still work.
  • I have not heard of a single case where people had to extract the base qvms from the assets to run a server on Linux. Especially with the pk3 files being in the same folder it doesn't make sense to me. Are you sure you didn't have something else causing your issues? I suggest everyone tries to skip this step. If they really run into issues they can still do this later.
  • apt is a Debian tool and used by Debian, Ubuntu, Mint, ..., but by far not all distributions. OpenSUSE uses zypper (or at least it did last time I checked), Arch uses pacman, ... Everyone needs to figure out how to do it on their distribution. And if they haven't figured that out already, they should probably not host a server for jk2, yet.
  • sudo basically instructs the system to run the application as super user (root [linux admin]). I think I haven't come across a single distribution that didn't separate normal users and root (not counting may embedded or single user systems), so you should always need sudo. If you do not need to use sudo you are already running with root privileges and you should under no circumstances run a gameserver (or similar) as root. Doing so would be a really big security risk.
Might be a little much for beginners, but I suggest to run all jk2 servers inside of a chroot to lock the game into a specific folder without access to anything beyond that folder.

And regarding mods one installs one should always be careful and try to get a popular mod that is also open source (preferably compiled oneself if possible), as even a qvm can do its share of damage if the modder intends to.

By the way, you can create named session with screen. Something like "screen -AmdS jk2server ./startscript.sh" would run the startscript in a new screen session in the background. Using "screen -ls" you can list all currently running screen sessions and with "screen -x jk2server" you would reattach the screen session created earlier with the name jk2server. That way you can easily maintain multiple screen sessions for different jk2 servers running from the same account.

Other than that thank you very much for the efforts. ;)

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 29 Apr 2016, 12:42
by Miso
jozuf wrote:
Miso wrote:Well, there's a right way and a few wrong ways!
Thx for explaining the wrong ways.
The wrong ways can consist of hosting it through in game (like most newer / inexperienced players would assume to do) or using outdated jk2ded which can be crashed pretty easily.

and @Daggolin I'll slowly update the post on the things I missed / the points that you made, as I don't have enough time to do it all at once ^^

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 19 May 2016, 12:21
by Kazuka
Nice tut ;)

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 14 Jun 2016, 12:43
by NubSmoo
you forgot about +set mv_version

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 17 Jun 2016, 19:02
by Miso
NubSmoo wrote:you forgot about +set mv_version
it's in the sample server config.

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 02 Jul 2016, 11:51
by dziablo
how to start a screen session running server every time linux reboots:
run command:

Code: Select all

crontab -e
on top of file add

Code: Select all

@reboot screen -dmS name_of_screen_session path_to_script
for example

Code: Select all

@reboot screen -dmS ffa /home/ttomczyk/jk2/ffa_init.sh
my script ffa_init.sh:

Code: Select all

cd /home/ttomczyk/jk2/
/home/ttomczyk/jk2/jk2mvded-v1.1.1-linux-amd64 +set fs_game SaberMod +exec ffa.cfg
you can include it in your tutorial if you like it Miso.

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 02 Jul 2016, 13:57
by ouned
thats pretty cool
i didnt know about @reboot in crontab

im doing it by adding my startup script to /etc/rc.local

which way is the better one?

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 02 Jul 2016, 14:11
by fau
Both are ok I think. Probably a proper init script with network dependency etc. would be the best but it's not worth the effort.

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 02 Jul 2016, 15:29
by Daggolin
Maybe a tutorial on how to chroot a jk2 server would be a nice addition, too?

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 28 Aug 2018, 09:24
by Penny
*Edit*: I was able to fix my install.

After reading through the code, I found that FS_Startup **ALWAYS** checks for assets5.pk3:
https://github.com/mvdevs/jk2mv/blob/ma ... C%93#L3305

So all I did was `cp assets0.pk3 assets5.pk3` and it worked.

I guess because I downloaded a 1.02 server first which didn't have that file?

You may want to update the instructions, or change fs_startup to not make that assumption?

Anyways, thanks for all your work on this!! :bow:

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 06 Sep 2018, 21:18
by church
Apparently I'm not smart enough to figure this one out... I've followed all the steps and changed everything to match, but still, nothing.

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 06 Sep 2018, 21:31
by church
Here's what I'm getting:

Code: Select all

C:\Users\alexj\Desktop\GameData>jk2mvded +set fs_game DS-Online +set net_port 28070 +exec server.cfg
JK2MV: v1.4.1 win-x86 Feb 15 2018
Initialising zone memory .....
----- FS_Startup -----
Current search path:
C:\Users\alexj\Desktop\GameData/DS-Online
C:\Users\alexj\Desktop\GameData\base\assets5.pk3 (4 files) [ 1.04 ]
C:\Users\alexj\Desktop\GameData\base\assets2.pk3 (289 files) [ 1.03 1.04 ]
C:\Users\alexj\Desktop\GameData\base\assets1.pk3 (8011 files) [ 1.02 1.03 1.04 ]
C:\Users\alexj\Desktop\GameData\base\assets0.pk3 (6674 files) [ 1.02 1.03 1.04 ]
C:\Users\alexj\Desktop\GameData/base

----------------------
14978 files in pk3 files
execing mpdefault.cfg
couldn't exec jk2mvserver.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok
2018-09-06 17:28:59 --- Common Initialization Complete ---
2018-09-06 17:28:59 Winsock Initialized
2018-09-06 17:28:59 Hostname: DESKTOP-CEBOSTM
2018-09-06 17:28:59 IP: 192.168.0.8
2018-09-06 17:28:59 Opening IP socket: localhost:28070
2018-09-06 17:28:59 couldn't exec server.cfg
Any ideas where I'm messing up?

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 07 Sep 2018, 00:28
by Boothand
I haven't looked into this tutorial, but in that log the search path for DS-Online and base (bottom one) are mixing forward and back-slashes (/ and \). Have you set those yourself, somehow?

It's not finding the server files, so it's not looking in the right place at least(?).

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 07 Sep 2018, 09:08
by ouned
looks like you simply dont load a map (and your server.cfg isnt found)

add "+map ffa_bespin" to your command line to see if it helps

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 08 Sep 2018, 08:49
by fau
church wrote: 06 Sep 2018, 21:31 Here's what I'm getting:

Code: Select all

C:\Users\alexj\Desktop\GameData>jk2mvded +set fs_game DS-Online +set net_port 28070 +exec server.cfg
JK2MV: v1.4.1 win-x86 Feb 15 2018
Initialising zone memory .....
----- FS_Startup -----
Current search path:
C:\Users\alexj\Desktop\GameData/DS-Online
C:\Users\alexj\Desktop\GameData\base\assets5.pk3 (4 files) [ 1.04 ]
C:\Users\alexj\Desktop\GameData\base\assets2.pk3 (289 files) [ 1.03 1.04 ]
C:\Users\alexj\Desktop\GameData\base\assets1.pk3 (8011 files) [ 1.02 1.03 1.04 ]
C:\Users\alexj\Desktop\GameData\base\assets0.pk3 (6674 files) [ 1.02 1.03 1.04 ]
C:\Users\alexj\Desktop\GameData/base

----------------------
14978 files in pk3 files
execing mpdefault.cfg
couldn't exec jk2mvserver.cfg
couldn't exec autoexec.cfg
Hunk_Clear: reset the hunk ok
2018-09-06 17:28:59 --- Common Initialization Complete ---
2018-09-06 17:28:59 Winsock Initialized
2018-09-06 17:28:59 Hostname: DESKTOP-CEBOSTM
2018-09-06 17:28:59 IP: 192.168.0.8
2018-09-06 17:28:59 Opening IP socket: localhost:28070
2018-09-06 17:28:59 couldn't exec server.cfg
Any ideas where I'm messing up?
Download portable jk2mvded if you want to do it this way.
Or add

Code: Select all

+set fs_homepath C:\Users\alexj\Desktop\GameData
to the commandline

Re: Hosting a JK2 Server with JK2MV (Windows / Linux)

Posted: 02 Dec 2018, 16:46
by Knucklehead
Creating a windows batch server script file helps with launching the server easily and making modifications.

Run windows notepad, add your startup script (examples below) then save the file making sure you change the file type to 'All Files' then name it something like "jk2serverstartup-JA.bat" and include the " "at the ends to ensure you save it as a batch file not a text file.

Example startup scripts:

JA Mod

Code: Select all

jk2mvded +set net_port 28070 +set fs_game academy +set com_hunkmegs 128 +exec server.cfg
bye
DS Mod

Code: Select all

jk2mvded +set net_port 28070 +set fs_game ds-online +set com_hunkmegs 128 +exec server.cfg
bye
Note: the batch file should be saved in the same folder has the jk2mvded file and all your mods. Your server.cfg file should be inside your mod folder. So in one folder I have:

academy folder which has the server.cfg file inside
ds-online folder which has the server.cfg file inside
base folder
jk2serverstartup-JA.bat
jk2serverstartup-DS.bat
jk2mvded.exe

com_hunkmegs is to allocate more memory to maps and textures

Create a desktop shortcut to your serverstartup script B-)