MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "The_CDF",
        "continue": "gapcontinue||"
    },
    "query": {
        "pages": {
            "20": {
                "pageid": 20,
                "ns": 0,
                "title": "Running a Dedicated Server",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "This article explains how to deploy a Voxel Turf Dedicated Server on a Linux VPS.\n\n== Deploying a VPS ==\nYou can grap a cheap VPS. A 1 core VPS will get you started but it is recommended that you have a 2 core VPS.\n\nThis article assumes that you have one. HOST can be substituted with the IP address of the server (eg 1.2.3.4).\n\n===SSH into the server===\n(enter this on your local linux termanal)\n<source>\nLOCAL MACHINE:\nssh root@HOST\n</source>\n\n\n===Set up a user===\n<source>\nuseradd -m turf\npasswd turf\nadduser turf sudo\nsu - turf\n</source>\n\n===Security (Optional)===\n\nSet up passwordless access via ssh (using keys and not passwords) \n<source>\nLOCAL MACHINE:\nssh-keygen\nssh-copy-id -i ~/.ssh/id_rsa turf@HOST\n</source>\n\nSet the ssh port to something other than the default (21). This will help stop people trying to brute force into your server. Also disable root login & password login. To do this, change:\n<source>\nsudo nano /etc/ssh/sshd_config \n</source>\nTo:\n<source>\nPort <NEW PORT NUMBER>\nPermitRootLogin no\nChallengeResponseAuthentication no\nPasswordAuthentication no\nUsePAM no \n</source>\n\nTo login to your server you'll have to use:\n<source>\nssh -p <NEW PORT NUMBER> turf@HOST\n</source>\n\n===Tips===\nYou can set the default shell to bash on the server. This enables tab completion and arrow keys.\n<source>sudo chsh -s /bin/bash USERNAME</source>\n\n==Installing Voxel Turf==\n===Installing Dependencies===\n<source>\nsudo apt-get update \nsudo apt-get upgrade\nsudo apt-get install libsdl2-2.0-0 \nsudo apt-get install libsdl2-net-2.0-0 \n</source>\n\n\n===Installing Steam and SteamCMD===\n<source>\nsudo apt-get install lib32gcc1\nmkdir Steam\ncd Steam\nwget http://media.steampowered.com/client/steamcmd_linux.tar.gz\ntar -xvzf steamcmd_linux.tar.gz\n</source>\n\nAlternatively you can just copy the files from a linux installation of Voxel Turf onto the server\n\n===Using SteamCMD to install Voxel Turf===\n<source>\n./steamcmd.sh\n</source>\n\nIn Steam>\n<source>\nlogin anonymous\nforce_install_dir /home/<USER>/turf\napp_update 526340\nquit\n</source>\n\nYou should be now able to run the server and play.\n\nTo install a beta branch use:\n<source>\napp_update 526340 -beta beta validate\n</source>\n\n==Running The Server==\nRunning <code>vtserver --help</code> will give you a list of command line switches.\n\n===Start Command===\nAn easy way to generate a start command is to run the game locally (on your machine) and extract the start command from the logs (<code>GAMEFOLDER/logs/startserver.log</code>).\n\nYou should see something like this:\n<code>--serverName \"YOUR Turf Server\" --saveGame \"Sora_Turf\" --publicGame OFF --dedicated OFF --difficulty 1 --maxPlayers 8 --hostPlayer 36563646 --newGame ON --gameMode \"Turf\" --genmap 4096 4096 --randomSeed \"46756168\" --steam</code>\n\nChange it to\n<code>--serverName \"NAME Turf Server\" --saveGame \"GAMESAVENAME\" --publicGame ON --difficulty 1 --maxPlayers 8 --gameMode \"Turf\" --genmap 2048 2048</code>\n\n===Permissions===\nGo to GAMEFOLDER/settings/globalpermissions.txt and make it look like:\n<source>\n%ADMINS\n;UID\n</source>\nreplace ;UID with the UID from steam (SteamID3) For example \"[U:1:145678]\" so I put \";145678\"\nCan be found here: http://steamid.co/ or from \"--HostPlayer\" in startserver.log on the local machine.\n\n\n\n==Advanced Stuff==\n\n===Installing Workshop Mods===\n\nYou can use the following script (or similar) to install Steam Workshop mods\n<source>\nlogin anonymous\nforce_install_dir /home/<USER>/turf/workshop/\nworkshop_download_item 404530 1139738481\nworkshop_download_item 404530 1146791667\nworkshop_download_item 404530 1147901316\nworkshop_download_item 404530 1148991672\nworkshop_download_item 404530 1150505297\nworkshop_download_item 404530 1151247017\nworkshop_download_item 404530 1151814594\nworkshop_download_item 404530 1155491803\nworkshop_download_item 404530 1157290153\nworkshop_download_item 404530 1161093711\nworkshop_download_item 404530 1161805016\nworkshop_download_item 404530 1163198197\nworkshop_download_item 404530 1173209773\nworkshop_download_item 404530 1186472758\nworkshop_download_item 404530 1188474602\nworkshop_download_item 404530 1194894626\nworkshop_download_item 404530 1214171560\nworkshop_download_item 404530 1214209573\nworkshop_download_item 404530 1228209888\nworkshop_download_item 404530 1232559786\nworkshop_download_item 404530 1286749403\nworkshop_download_item 404530 1292765889\nworkshop_download_item 404530 1293667849\nworkshop_download_item 404530 1297767382\nworkshop_download_item 404530 1313810046\nworkshop_download_item 404530 1356700312\nworkshop_download_item 404530 1357159347\nworkshop_download_item 404530 1359235841\nworkshop_download_item 404530 1374585114\nworkshop_download_item 404530 1382550977\nworkshop_download_item 404530 1388371537\nworkshop_download_item 404530 1414621518\nworkshop_download_item 404530 1362695804\nworkshop_download_item 404530 1422753063\nworkshop_download_item 404530 1439594806\nworkshop_download_item 404530 1438699284\nworkshop_download_item 404530 1448258410\nworkshop_download_item 404530 1448258410\nworkshop_download_item 404530 1567312287\nworkshop_download_item 404530 1569424047\nworkshop_download_item 404530 1502040207\nworkshop_download_item 404530 1686359089\nworkshop_download_item 404530 1669912546\nworkshop_download_item 404530 1711533908\nworkshop_download_item 404530 1408356394\nworkshop_download_item 404530 1859938129\nworkshop_download_item 404530 2158310645\nworkshop_download_item 404530 1220858879\nworkshop_download_item 404530 1321497749\nworkshop_download_item 404530 1165605817\nworkshop_download_item 404530 1254858697\nworkshop_download_item 404530 1781089616\nworkshop_download_item 404530 2447555026\nworkshop_download_item 404530 2413865435\nworkshop_download_item 404530 2383133708\nworkshop_download_item 404530 1427795268\nworkshop_download_item 404530 2667653606\nworkshop_download_item 404530 2667784591\nworkshop_download_item 404530 1796008481 \nworkshop_download_item 404530 2963501169\nworkshop_download_item 404530 3150949302\n\nquit\n</source>\n\nAnd then you make vtserver \"see\" the mods using a symbolic link\n\n<source>\ncd ~/turf/\nrm -rf mods\nln -s workshop/steamapps/workshop/content/404530/ mods\n</source>\n\n===Running the Server Continuously===\nThis allows you to auto-restart the server if it crashes. You can find this script in <code>/linux_server_admin_scripts_and_instructions/runvtserver.sh</code>.\n\n<source>\n#!/bin/bash\nBASE=/home/USER/\nDIR=$BASE/turf/\nwhile :; do\n\t# Run the server\n\t$DIR/vtserver --saveGame SAVE_FILE --publicGame ON --maxPlayers 8 --serverName \"SERVER_NAME\"\n\tsleep 1\ndone\n</source>\n\nIt is recommended that you run <code>runvtserver.sh</code> through <code>solo.pl</code> (which is provided in <code>/linux_server_admin_scripts_and_instructions/solo.pl</code>. Solo.pl will ensure that ''only one'' instance of the script is running. Solo.pl binds to a port, not a lockfile so it won't break if your system randomly hard resets.\n\nUse crontab (<code>crontab -e</code>) to enter the following:\n<source>* * * * * /home/USER/solo.pl -port=3801 -verbose ./runvtserver.sh >/dev/null 2>&1</source>\n\nPort 3801 is the lock port for solo.pl, NOT the port that vtserver uses. vtserver uses port 5728 by default. The {{file| >/dev/null 2>&1}} is to suppress crontab trying to log and email the console output of vtserver \n\n\nThis provides triple redundancy: When the server starts up crontab will run solo.pl which starts runvtserver.sh which runs vtserver. If vtserver crashes then runvtserver.sh will ''immediately'' restart it. Crontab will start runvtserver.sh if it is not running, and solo.pl prevents crontab spawning endless instances of runvtserver.sh.\n\n===Orderly Shutdown===\nvtserver accepts SIG_HUP interrupts. This will cause an orderly shutdown (save and exit). It will also instruct any connected clients to try and reconnect.\n<source>killall -s HUP vtserver</source>\n\n===Polling Server Status===\nvtserver will create a file in the logs directory: {{file|logs/server_status.txt}}. This file is updated every 30 seconds. You can use this, for example, to update a webpage indicating how many players are on the server.\n\nHere is an example output:\n<source># This file is updated every 30s while the server is running\n# timestamp ; serverid ; players ; maxplayers ; public ; serverName ; gamemode ; serverversion\n1520494242 ; 3837146104 ; 0 ; 8 ; false ; \"\" ; \"Build\" ; 1.1.0-Beta1-g76v\n</source>\n\n===serverscript.lua===\n[[File:serverscript_lua.png|thumb|Placing a serverscript.lua file in a save game's directory will cause it to be executed by vtserver on startup]]\nPlacing a plaintext file serverscript.lua in the games save directory will cause the server to execute the script whenever that save is executed. You can use this to write custom mods for the server, give the players stuff when they log in or even redirect players to other servers (you can make stargates)!\n\n===Periodic Shutdown and Restart with serverscript.lua===\nThis can be useful to clear the map of dumped vehicles and fix any bugs that may have creeped into the server's state. Here is an example script from the Lets Build A City server that shuts down the server every 6 hours. It also sets the Message Of The Day and shows some other hooks.\n\n<syntaxhighlight lang=lua>\nSERVER_RESET_PERIOD = 60*6;\n\n --Worker functions\nfunction timeTillNextServerReset ()\n\tlocal NH = turf.NetworkHandler.getInstance();\t\n\tlocal uptime = NH:getUptimeInSeconds();\n\treturn SERVER_RESET_PERIOD*60 - uptime, uptime;\nend\n\nfunction getFormatedTimeTillReset (timeTillReset)\n\tlocal minutesRemaining = math.floor(timeTillReset/60);\n\tif (minutesRemaining > 2) then return tostring(minutesRemaining) .. \" minutes\"; end\n\treturn tostring(math.max(0, timeTillReset)) .. \" seconds!\";\nend\n\n-- CustomFunc - code injection\ncustomFunc.OnHour_extra = function (GMS, Net, W, timeOfDay)\n\tlocal NH = turf.NetworkHandler.getInstance();\t\n\tlocal timeToReset = timeTillNextServerReset ();\n\n\tif (timeToReset > 10 and timeToReset < 600) then\n\t\tNH:broadcastSM (\"Server will be rebooting in \"..getFormatedTimeTillReset(timeToReset), 0);\n\tend\nend\n\n\n-- On new player login\ncustomFunc.OnNewPlayer_extra = function (GMS, P, I, PCr, W)\n\t-- Give them items, send a message, etc\nend\n\n\n\n-- Toggleable static bool for sending the \"restart in X seconds\" messages\ncustomFunc.pollServerTick_extra_static_tickCount = 0;\n\n-- This function is called every tile-entity tick (4Hz), not every server frame tick (variable, 15Hz/33Hz/67Hz depending on user configuration as defined in serverprefs_1000.txt)\ncustomFunc.pollServerTick_extra = function (NH) \n\tlocal timeToReset = timeTillNextServerReset ();\n\n\t-- Send a \"RESTARTING IN X\" seconds if we are less than 10 seconds to go and this is the first of every 4 ticks.\n\tif (timeToReset < 10 and timeToReset > 0 and customFunc.pollServerTick_extra_static_tickCount == 0) then\n\t\tNH:broadcastSM (\"Rebooting Server in \".. tostring(timeToReset) .. \" seconds!\", 0);\n\t\tNH:playSoundToAllClients (\"CLICK\");\n\tend\n\tcustomFunc.pollServerTick_extra_static_tickCount = customFunc.pollServerTick_extra_static_tickCount+1;\n\tif (customFunc.pollServerTick_extra_static_tickCount >= 4) then customFunc.pollServerTick_extra_static_tickCount = 0; end\n\n\tif (timeToReset <= 0) then\n\t\tNH:sendAllPlayersToServer (\"\", \"\"); -- Telling players to go to (empty string) server tells them to drop and reconnect to this server\n\t\tNH:flagShutdown (); -- Showdown the server. You'll have to restart it with a shell script\n\tend\nend\n\n\n-- No missions on this server!\n--turf.MissionHandler.getInstance():removalAllMissions();\n\n-- Set the MOTD\nturf.NetworkHandler.getInstance():setMessageOfTheDay (\"==============================\\nWelcome to the Let's Build A City server!\\n    ~SnapperTheTwig\\n==============================\");\n</syntaxhighlight>\n\n[[Category:Guides]]"
                    }
                ]
            },
            "33": {
                "pageid": 33,
                "ns": 0,
                "title": "Strategic Pause",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{version|1.3.3}}\n[[File:stratpause.jpg|thumb|A Strat Paused menu screen]]\nStrategic Pausing (abr. ''Strat Pause'') was a feature added in version 1.0.28 which freezes the economic and strategic parts of the game under certain circumstances.\n\n==Motivation & Effects==\nStrategic Pausing was introduced to prevent [[Factions|AI Factions]] from taking over the map while the player is AFK (in singleplayer) or when players are offline (in multiplayer). It also intended to allow youtubers/streamers/modders alt-tab out of the game to do other work (such as editing) without the map being overrun.\n\nStrategic Pausing disables:\n* Economic Simulation (income, population changes, safety increase, etc)\n* AI Faction actions (launching base attacks, purchasing or racketeering property, etc)\n* onHour effects (aggression/reputation decay)\n\nStrategic Pausing does ''not'' disable tactical AI (CDF cars, bandits, etc).\n\n==Activating Strategic Pause==\nStrategic Pause will be engaged if you press Esc to open the Game Menu (see screenshot at the top of the article). If you are in a multiplayer server and all connected players are in that menu then Strat Pause will engage. The server will also enter strat pause if there are no players connected.\n\nIf you are in the Game Menu you must wait 1 minute for Stat Pause to engage. This is to prevent an exploit where you can hit Esc when the hour changes to prevent onHour functions.\n\n==External Links==\n[http://www.indiedb.com/games/voxel-turf/news/dev-diary-15-new-bandit-base-car-shop-waypoint-system-moar IndieDb: Dev Diary 15]\n\n[https://steamcommunity.com/games/404530/announcements/detail/1652126739269707102 Steam Announcement for Patch 1.0.28]\n\n[[Category:Gameplay]]"
                    }
                ]
            }
        }
    }
}