Your own server

Host games for your friends, or for everybody.

Two ways to host

  • From the game. Start a game from the VisionJK menu and others can join it while you play. This works on Windows and Linux, and it's the quick way to play a round with friends.
  • A dedicated server. A program without a picture that runs day and night. It's in the Linux download and is named visionjkded.x86_64.

Players with VisionJK and players with the original game can both join. Those with the original game play as they always did, just without the voice chat.

Start a dedicated server

  1. Install VisionJK on the machine as described in First steps. The game data has to be there too.
  2. Open the file server.cfg in the folder japlus with a text editor. It's a ready-made example. Give your server a name (sv_hostname).
  3. Start it from the GameData folder:
    ./visionjkded.x86_64 +set dedicated 2 +exec server.cfg

With dedicated 2, the server shows up in the public server list. With dedicated 1 it stays private, and people join by typing your address.

Open the doors

A dedicated server needs one UDP port that can be reached from outside. In a home network, that means forwarding it in your router.

PortFor
29070The game, and since version 0.1.6 the voice chat of your server too. This is the usual port, and you can choose another with net_port.
29071Only if you host from the game: the voice chat. It is the game port plus one, unless you set another with vs_voicePort.
29071 (TCP)Only if you want to offer the TV of your server directly (see below). It can be any TCP port, you choose it with vs_clientWebPort. It is not the voice chat, which uses the game port.

Up to version 0.1.5, a dedicated server used 29071 for the voice chat as well. After updating, you can close it.

Admins

JA+ has three admin ranks: council, knight and instructor. What each rank may do is set in the config. Admins can kick and ban, put a player to sleep, protect or silence them, teleport, rename, change the map and start polls. aminfo lists the commands.

Since version 0.1.2, an admin logs in with a key instead of a password. A password is the same for everyone of a rank and crosses the network every time it's typed. A key belongs to one person and never leaves their computer.

  1. The admin types v_amkey new into their console, once. Then v_amkey show prints a line that begins with ssh-ed25519. That line isn't a secret, and they send it to you.
  2. You put it into the file admin_keys.txt in the folder japlus of the server, with their rank in front, one line per admin:
    council ssh-ed25519 AAAA... name
  3. They join your server and type v_amkey login. From then on, the game logs them in by itself whenever they join.

The rank is council, knight or instructor, or rcon for someone who may do everything. The file is read again at every map change, and when you type amkeys on the console of the server.

An admin who plays with the original game has no key. For them, type amcode knight on the console of the server, or use the Account tab of the server page. You get a code that works once, within a minute. They type amlogin and the code.

Coming from an older version? The passwords of the three ranks are now switched off. With seta vs_adminPasswords 1 they count again as before. Remote control with rcon is gone for good, because its password crossed the network in the clear with every command. Use the server page or the console of the server instead.

The server page

VisionJK servers come with a page for the owner. You open it in a browser and see the level with everyone on it, live.

  1. Type this on the console of the server:
    webuser add yourname owner
    It prints a password, once.
  2. Put one line into your server.cfg:
    seta vs_webPort 8080
  3. Open http://your-server:8080/ in a browser and log in. Choose your own password on the Account tab.

The page has two modes. In Administration, you see the players, change their health, team or size, move them with a right click on the map, kick or ban them, read the chat and edit the config. In Editor, you move, turn, copy and remove the things in a level, and place new ones.

Everyone who helps you gets their own account: webuser add name moderator, admin or owner. A moderator looks after the players. An admin also uses the editor and changes the map. An owner may do everything, including the config and the accounts. On the Account tab, everyone can switch on a second login step, a code from an authenticator app.

The page itself isn't encrypted. Inside your own network that's fine. Before you open it to the internet, put it behind a reverse proxy that speaks HTTPS and tell the server the address of that proxy with seta vs_webProxy "address". If more than one proxy talks to it, name them all, separated by spaces. Then nobody else is let in. With seta vs_webBind "127.0.0.1", the page only answers on the server machine itself. As long as there's no account, the page is off. A server that still has a vs_webPassword from an older version gets the account owner with that password, once.

The TV of your server

The TV is a spectator that takes no slot on your server. It follows the players and switches to the next one every 20 seconds, or at once when its player stops playing. You can change the time with sv_tvSwitch. Nobody on the server sees it.

The game itself has no command to watch it any more. Viewers open a page in the browser, the browser client with ?tv added to its address. Ours is jka.vision/watch. The page doesn't load the whole game (1.2 GB) but only the files a viewer needs: a common pack of about 100 MB and one pack of 1 to 13 MB for the map that runs. It keeps them in the browser, and asks the server every 5 seconds which map runs. The TV has no sound.

The page needs https, or the machine of the server itself, for the decryption of the packs.

  1. Put these lines into your server.cfg:
    seta vs_clientWebPort 29071
    seta vs_clientWebRoot "folder"
    seta vs_clientWebTVOnly 1
    The folder holds the browser build and the packs (tv-index.json, tv-common.vpk and one pack per map).
  2. Forward that TCP port in your router, as in the table above.
  3. Viewers open http://your-server:29071/?tv.

With vs_clientWebTVOnly 1, that port answers /tv and /tvinfo (the map that runs) and nothing else, so nobody can download game files or join through it. Without it, the same page loads all the pk3 files of the server, as before. The packs are made by tools/tvpack/tvpack.py of the game source, from a Linux build. It plays every map with bots, records it and keeps the files it saw. A player whose model isn't in the packs is drawn with the default model.

The packs are encrypted, and the key is in the page. That only keeps the game files from being taken off the site as they are. Whoever reads the page finds the key.

If your server has a website behind https, you can skip the open port. Put the TV on the server machine itself with seta vs_clientWebBind 127.0.0.1, let your web server hand out /tv and /tvinfo to it (jka.vision does the same), serve the page and the packs from a folder of that web server, and set seta vs_clientWebProxy "address" to the address of that web server.

To save a demo file, type tvrecord name on the console of the server, and tvstop to end it. The file lands in the folder demos, and any game plays it with demo name.

The server keeps watch

A VisionJK server notices packets that no game sends. It writes them into the file ids.log in the folder japlus and blocks the address they came from for a while. There's nothing to set up, and the server page shows the list. The game does the same on its side with servers that misbehave.

SettingWhat it does
vs_ids 0Switches the watch off.
vs_antiWallhack 1A player nobody can see isn't sent to the others, which takes the ground from wallhacks. It's off by default, because voices behind walls aren't heard then either.

Voice chat on your server

Voice chat is on by default, and on a dedicated server it uses the game's port, so you don't have to do anything. Three settings you may want:

SettingWhat it does
vs_voiceRangeHow far a voice carries. The default is 1024. With 0, everybody hears everybody.
vs_voiceTeamOnly 1In team games, only a player's own team hears them.
vs_voice 0No voice chat on this server.