Sometimes you will have people connect to your Don't Starve Together server, and disrupt everyone's fun by being unpleasant, rude, or actively destroying everyone's hard work (Seriously, what's up with griefers? Don't they have something better to do?).
If players do cause trouble on your server, you can ban them from connecting to your Don't Starve Together in the future. You can do this through admin commands, or by creating (or editing) a file called
blocklist.txt, and entering ID numbers into the file.
Admin commands only work if the troublemakers are still on the server, and commands have to be done manually by an admin.
blocklist.txtfile will work automatically, 24-7, day in and day out.
How to ban someone currently connected to server
If the miscreants are actually still on your server, there are admin commands that can be used to smack them with the ban hammer. The commands only work if they're still connected to the server though. If they already left, skip down to the next section, about how to go dig up the ID numbers out of the logs.
This of course, also requires that someone who is an admin be on the server, to ban them manually. For information on how to add admins to your server, please see the related article linked below, or available here.
The admin commands that will be useful for banning players are as follows:
Get list of players, with their KU ID's
This will print out a list of all currently connected players, including their KU ID number.
Admin command to ban them
TheNet:Kick ("KU ID")
Replace KU ID, with that players actual ID number. Leave the parenthesis and quotes though, they are important.
so for example:
Finding ID numbers to ban someone not currently connected
Most griefers won't be so nice as to give you their own ID numbers, so you'll have to find these. The game thankfully makes logs which will contain the ID numbers. These files are made and replaced each time the server is started, so if a player caused a problem on your server you will need to get the numbers out of the logs first or they'll be erased next time the server is restarted.
You can use either the KU ID, or the player's Steam64ID. Both will work. It's worth mentioning that the game Don't Starve Together is not exclusively offered on Steam (it can be purchased directly from Klei, without using Steam at all). The KU ID will work for any player, but the if they're not using Steam, there won't be a Steam64ID number.
Using the server logs
/.klei/DoNotStarveTogether/MyDediServer directory, you can open either the
Caves directories. Each directory contains a completely separate collection of files. If the trouble happened in the regular surface world, you will need to look in the logs in the
Master directory, if it happened in the caves, you need to look in the logs in the
Inside each directory you will see a file called
Select this file, and click on the "Edit" button. This will open a text editor, showing the contents of the server log. This file is going to be pretty long, I mean really long. All the information from the server loading files and starting up is there.
Searching the logs quickly
There's a quick way to search the entire log though. You can hold down
Ctrl and hit the
F key to open a search bar at the top of the text editor window.
You want to look for a message about "Client Authentication", so type
authenticated in the search window. It will jump to the first occurrence of the word "authenticated", and highlight all of them with a yellow background, like the screenshot below:
On line #282, the KU ID of the player is in parenthesis (blocked out with a red rectangle), right before their name. On lines #283 and 284, the red blocks are covering up a 17 digit long number at the end that is a Steam64ID number. It will be the same number in both places.
You can get ID's from chat logs
You can also get a player's "KU" ID from the chat logs on the server, if they said something in chat. These logs will be located in both the "Master" and "caves" directories (
/.klei/DoNotStarveTogether/MyDediServer/Caves). The logs are called
server_chat_log.txt. These logs are also replaced each time the server starts though.
Select the file, and click "Edit" on the Nodecraft control panel, to show the contents of the log.
You can use the same search feature mentioned above, by holding
Ctrl and hitting
F to open a search bar. Type the name of the player, if you remember it, and it will jump directly to their lines in the file.
A player's "KU" ID should be listed in front of every message they have sent.
Once you have the ID numbers, create or edit
/.klei/DoNotStarveTogether/MyDediServer directory, you will need to create a file called
blocklist.txt. If you already have one, you can just open and edit the existing file, by clicking on the "Edit" button.
You can create the file directly in the file manager window on the Nodecraft control panel, by clicking on the button
create file. This opens a text editor window.
At the top of the window, click on the dark grey text that says
my-file-name.txt and replace it with
blocklist.txt. Then on the flashing cursor bar, enter the ID numbers. You can use either a KU ID, or a Steam64ID numbers. Enter each ID number on it's own line.
Once you're done, save the changes, and exit the editor window.
Restart the Server
The newly created (or edited) blocklist won't be loaded by the game unless the server is restarted, so please do that now.
Once that's done, the griefers will be given the boot next time they try to join your server and they will see the image below when they try to join!