Emailing reports
I have a little script that I use to email reports that people leave on my servers. A report is left on a server by hitting a chat key, typing /report, and then after that the message the user wants to leave. Generally, it is necessary for the admins or owner to join the server and run /viewreports to see what reports have been left. However, with this, reports can be emailed to any email address. You could set up a mailing list for your top admins so that they receive these reports. Here is the script:
#!/bin/bash read read report #we want the second line, which is the actual report (echo $report | mail -s 'Report from '$1 $2) &
Chmod this to be executable (chmod u+x emailreport.sh) and make note of where you save this file. To use the script, you will add a reportpipe to your configuration file pointing to this script.
-reportpipe "/path/to/emailreport.sh SingleWordIdentifier EmailAddress@Whatever.com"
(Note that it should be a single line… the width of the blog makes it wrap to two lines) The first argument to the script is a short single word identifier. This could be the port number, a short name for the map, or whatever you want. It will appear in the subject line of the email as “Report from SingleWordIdentifier”. The actual report (including who it was from) will appear as the body of the email.
Watching a log in real time
There are times when I get bored, so I check out what’s happening on my server by reading the chat and server messages. I run the logDetail plugin, so I get messages formatted a certain way. I can keep tabs on the current chat messages (and server messages, commands, and reports) by using this command:
tail -f -n 500 log | grep MSG
The tail command is used to read a number of lines from the end of a file or piped output. In the case above, it reads the last 500 lines of the file named ‘log’, and then continues to “follow” the file via the -f option. When it follows the file, it means that it keeps reading any new lines added to the end of the file. All of the output from tail is piped to a grep that looks for the word MSG in all caps, which is what the logDetail plugin will output for chat messages and other types of messages. By doing this, we can read chat and related messages in real time from the *nix shell.
I’ll try to cover some of my hosting layout in a future post.
]]>/highlight
The highlight command can be quite useful. I personally use this to track wall-walkers (people that exploit a certain bug to enable them to move through walls). I send this command:
/highlight pause
And then whenever a message in the chat box contains that word, it will be highlighted based on my client settings. You can also pass multiple things to look for, as it uses regular expressions. So let’s say you wanted to watch for people grabbing certain flags. You could do this:
/highlight (genocide|guided missile|laser)
The pipe (|) separates what to look for. I’m not going to provide a tutorial on regular expressions, so if you want to go more advanced, do a Google search.
/idlestats
The idlestats command will show how long a player has been idle. “Idle” is defined as being dead or paused. It will specifically show if someone is paused, and how long they have been paused.
[SERVER->] blast : 0s [SERVER->] Argooon : 16s [SERVER->] Bob : 13s paused 13s
/lagstats
The lagstats command is similar to idlestats. It shows a line for each player, followed by two or three sets of numbers.
[SERVER->] [ 0] Argooon : 131ms [SERVER->] [ 1] blast : 78 +- 6ms [SERVER->] [ 2] Bob : 61 +- 22ms 5% lost/ooo
The values are lag (also known as latency), jitter, and packet loss. Packet loss will only show up if the user has any. Lag is the network delay between the client and the server.
Jitter is a variation in this lag time. If someone has jitter, their movement will appear less smooth. Jitter is commonly caused by running other software in the background (such as browsers, downloads, etc) that suck up CPU time. It can also be caused by their Internet connection itself, and WiFi is more prone to have jitter.
Packet loss may exhibit similar issues to jitter (tank movement will not be as smooth) but it usually has fewer but larger “jumps” in the movement. This is almost always caused by a poor Internet connection, and can again be more common with WiFi.
I’ve had some people play using a cellular/3G broadband modem or over satellite Internet. These kinds of connections are not suitable for playing real-time games as they will have a large amount of lag. A typical lag time for a satellite will be one to four seconds.
/sendhelp
The sendhelp command will allow you to send a help topic to a specific user. It will show up in their chat box. I use this to remind users of the rules, or to give them information about how to fix lag/jitter/packet loss. This command requires that the server owner has set up help files. You can see what help pages are available by running the /help command. For example, if you ran this:
/sendhelp someplayer rules
You would see:
[Admin] SERVER: Help topic rules was sent to someplayer by blast.
And someplayer would see:
[SERVER->] Help: Rules [SERVER->] --- [SERVER->] Please be nice to everyone. Do not swear, cheat, or kill teammates. [SERVER->] The admins have the right to mute, kick and ban anyone for any reason.
Or whatever was contained in that help topic.
/showperms
This command allows you to see what permissions are available to you. You may also be able to use this on other users to see what their permissions are.
[SERVER->] Permissions for: blast [SERVER->] actionMessage [SERVER->] adminMessageReceive [SERVER->] adminMessageSend [SERVER->] antiban [SERVER->] antideregister [SERVER->] antikick [SERVER->] antikill [SERVER->] antipoll [SERVER->] antipollban ... (you get the idea...)]]>
Please review Part 1 for information on the /playerlist command. This command comes in very handy for issuing bans as it shows the IP address and hostname of every user on the server.
Ban duration
Every type of ban needs to have a ban duration set. The supported units of time are years (y), weeks (w), days (d), and minutes (m). Contrary to somewhat popular belief, the ‘m’ unit is not months. You can string these together like 1w2d30m to get 1 week, 2 days, 30 minutes. Or you can just specify one type, such as 2w. If you donâ€t provide any units and just give a number, it defaults to minutes. You can also specify “short” or “default” to use the poll ban length, which defaults to 5 hours. Providing 0, “max” or “forever” will set it to a permanent ban.
NOTE: If you only have the “shortban” permission instead of the “ban” permission, the longest duration you can ban for is the “short” poll ban length. It will automatically limit the setting. Cops commonly are limited to this duration, while admins can typically ban for any duration.
/ban
The ban command is typically used after a user has been verbally warned and then kicked. It will prevent them from rejoining. You can specify a callsign (with quotes if they have spaces in their name), or an IP address. Banning by callsign will only work if they are still on the server.
NOTE: If a user is globally identified (they have a plus sign by their name), banning by callsign will ban their IP address AND their BZID. If you unban them later, removing the IP ban will not remove their ID ban. You will have to use /idunban to remove their ID ban. The ID ban commands will be discussed later in the article.
In addition to the name, you will also have to pass the ban duration. Examples:
/ban Argooon 1w Teamkilling is not allowed. You have been warned repeatedly.
/ban 206.222.24.18 30m Please try to be respectful to other players next time you are here.
There are also times when a player will rejoin with a different, but similar IP address. This is an issue with dynamic IP addresses. An Internet Service Provider (ISP) will rarely give each user their own dedicated (aka “static”) IP address. When their modem connects, they get an address from a pool of available addresses. This can cover a huge range of addresses in some cases, which may require you to ban a range if things get bad enough.
You can use an asterisk (*) as a wildcard to ban a range of addresses. Example:
/ban 206.222.24.* 2w Cheater (god mode)
/ban 206.222.*.* 1d Teamkilling is not allowed.
The asterisk would match any value in that spot. Range bans have a higher possibility of banning innocent players, as you are banning a portion of an ISP. You also have less control than with a hostban, so you might ban several ISPs instead of just one. A host ban (discussed later) can be used to more accurately target a specific ISP or a specific part of an ISP.
/banlist
The banlist command will list all active IP bans. This will include most (if not all) of the bans from the masterban list. Bans from the masterban list will display “(m)” after the banned address. For each ban, it will list the IP that is banned, duration remaining, reason, and the one who created the ban.
Here is an example of what a masterban would look like. Notice the (m) after the IP address:
[SERVER->] 127.0.0.1 (m) banned by: bzflag developers [SERVER->] reason: web service abuse
And here is an example of a regular ban that was created by an admin or cop on the server. Notice that it shows a duration in this example. If the ban was permement (duration set to 0, “forever”, or “max”) it would not show the number of minutes left:
[SERVER->] 206.222.24.18 (256.1 minutes) banned by: blast [SERVER->] reason: Please try to be respectful to other players next time you are here.
A ban list can get quite long. It is possible to pass a filter to the /banlist command that will search for a specific word or phrase. For example, let’s say you wanted to only show bans that were for cheating. You could run this:
/banlist cheat
You can also specify the name of who created the ban to find all the bans from that admin/cop.
/unban
The unban command can only remove IP bans. You can use the /banlist command to get the exact address or range that was banned, and then use that to unban. Example:
/unban 206.222.24.18
Or to unban a range:
/unban 206.222.24.*
It must match what was banned exactly.
/checkip
You can use this command to check if an IP address is banned. This only checks IP bans, so even if it says that an IP is not banned, there still might be a host ban or an ID ban preventing a player from joining. Examples:
/checkip 127.0.0.1
[SERVER->] 127.0.0.1 is not banned.
/checkip 206.222.24.18
[SERVER->] 206.222.24.18 is banned: [SERVER->] 206.222.24.1 (256.1 minutes) banned by: blast [SERVER->] reason: Please try to be respectful to other players next time you are here.
/hostban
The hostban command is used to ban someone’s hostname. An example of a hostname would be dsl-127.0.0.1.ca.comcast.net (but of course, this one is not real). Most players will have a hostname. You can use this to more accurately ban a specific ISP or part of an ISP. Here are some examples:
/hostban *.yomomma.com 2w Yo momma so stupid, she got banned from my server.
/hostban *.porteighty.org 1d Repeated teamkilling and rejoining. Contact blast if you are caught in this ban.
NOTE: At least in BZFlag 2.0.x, there is a bug where a player might not get the rejected message if they are host banned. Instead, when they try to connect, it will just hang during the join process and never show them the ban reason. Because of this, it is recommended that you don’t use hostbans unless you have to (at least until BZFlag 3.0.0).
/hostbanlist
This is the same as /banlist, but it will show host bans. As well, you can pass filters to this command the same way. Example:
/hostbanlist teamkilling
[SERVER->] *.porteighty.org (800.5 minutes) banned by: blast [SERVER->] reason: Repeated teamkilling and rejoining. Contact blast if you are caught in this ban.
/hostunban
This works the same as /unban, for only works for host bans. Example:
/hostunban *.porteighty.org
/idlist
The idlist command will show the global ID for every user online. You can use this for banning a specific globally registered user. Example of the output:
[SERVER->] Argooon : 99999
/idban
This command is not used as often. When you do an IP ban by callsign, it automatically adds an ID ban as well. Also, an ID ban only blocks a single account, so a user can either switch to a different account, or just use an unregistered name. ID bans are more useful on servers that require a registered account to spawn or talk.
Anyway, you will typically use this command when the user is still online:
/idban Argooon 2w Repeated teamkilling after several warnings.
You can also ban a BZID after they have already left. You could have obtained this from /idlist or the server log files. Let’s say someone’s BZID is 12345678. You just have to include a plus (+) sign before the number to indicate you are banning a BZID instead of a callsign.
/idban +12345678 1d Spamming
/idbanlist
This will list any current ID bans that are active. You can, like /banlist and /hostbanlist, filter out the list however you want by passing words after the command. Example output:
[SERVER->] 99999 (7041.0 minutes) banned by: blast [SERVER->] reason: (Argooon) Repeated teamkilling after several warnings. [SERVER->] 12345678 (1439.0 minutes) banned by: blast [SERVER->] reason: Spamming
Notice that for the second ban, it doesn’t show a callsign in the ban reason. This is because we banned by a raw BZID instead of a callsign. We could have manually placed the name in our ban reason if this is needed.
/idunban
To remove an ID ban, you use the idunban command. Just provide the BZID of the user you want to unban. Examples:
/idunban 99999
/idunban 12345678
I hope all of this information was helpful. I will have a “Part 3” of this topic at a later time that covers some other commonly used commands.
]]>This BZTips session will cover how to use some of the server side commands for typical server administration. I will not be covering all of the server commands, just the ones that are typically used by an admin or a cop. A typically server owner will have additional commands that an admin or cop will not have access to.
Commands are entered as chat, so you would first bring up the chat option by pressing ‘n’ on your keyboard.
/clientquery
This command will output the build string from every user’s client. This includes the version, build date, and operating system. I’m just covering this command briefly because some admins/cops think that by checking the version and/or build date of the client, you can determine if someone is using a cheat client. This assumption is horribly incorrect, especially for people on Linux. Even on Windows, there are people who build their own client simply to run the latest development code in order to find any bugs or to run code where bugs have been fixed. A real cheater could just fake the clientquery response anyway, so this is NOT a way to find if someone is cheating. Please do not rely on it.
/viewreports
Some players will leave reports on the server. Some of these reports may require the server owner’s help in tracking down a problem, but there are times when an admin/cop can handle an issue. By using the /viewreports command, you can view all the reports that have been left on the server.
NOTE: The server owner will have to be the one to manually clear out old reports. There is no integrated mechanism to clear them out, so it needs direct file-system access.
/flag
By itself, this command won’t do anything. The flag command has several sub-commands you can call. I think that “reset” and “take” are the main ones that are useful for a typical situation, so I will cover those two sub-commands.
/flag reset
The “reset” sub-command itself won’t do anything either. The flag reset command requires that you specific what flags you want to be reset. When a flag is reset, it will respawn in a new area. This is typically done to balance out the flags after a long period of play, or to bring back a team flag after a flag runner has carried it partially to the other team.
/flag reset all
This would reset every single flag on the map, even if a player is holding it. It also resets team flags.
/flag reset unused
This would reset all flags that are not being held by players. From what I recall, this includes team flags.
/flag reset team
This would reset only team flags.
/flag reset G*
This would reset only the Green Flag. You can use B* for Blue, R* for Red, and P* for Purple. This can also be used to reset more than just team flags, such as if you wanted to reset all Genocide flags. You can view the list of flag abbreviations at the flag list wiki page.
/flag take
The flag take command will allow you to make a player drop their flag. This can be used if a player has taken their own team flag outside of their base, but not gone very far. It will drop the flag where they currently are. If it’s a non-team flag, there is a chance that it will respawn somewhere else. The other use of this would be to take away a SW or a SR from a tank that is shooting or driving near teammates. It’s definately nicer than /kill’ing them, though it does require a bit more typing. Here’s an example. If you run this:
/flag take blast
You would see:
[SERVER->] Argooon took flag L/70 from blast
The player you took the flag from doesn’t see a message about who made them drop it.
/playerlist
The playerlist command will provide the slot number, callsign, IP address, and hostname of every user on the server. You can use this information for bans. Here is an example of the output:
[SERVER->] [1]Argooon : 206.222.24.18 (porteighty.org)
In this instance, 1 is the slot number, “Argooon” is the player’s name, 206.222.24.18 is the IP address, and porteighty.org is the hostname.
NOTE: Although you can use the slot number to issue kicks and bans, I recommend NOT using this because it’s too easy to kick/ban the wrong person.
/mute and /unmute
The mute and unmute commands can be used as a step before a kick or ban is necessary. If someone is using profanity, you can mute them instead of kicking them. When a player is muted, they can only send chat messages to the admin channel. This is a good way to prevent someone from talking for a short period of time so you can speak to them and ask them to stop. You can unmute someone with the unmute command. To use the mute or unmute command, provide the username or player slot of who you want to mute after the command. For example, using the following command:
/mute Argooon
would show this to the admin:
[SERVER->] player id #1 "Argooon" is now muted.
and this to Argooon:
[SERVER->] You have been muted by blast.
It would also show similar messages when you unmute someone.
/kick
The kick command will remove a specific player from the server. You typically use this after a verbal warning, as this will definitely get their attention. You can provide a player callsign, followed by a kick reason. If their name has any spaces, you need to put their name in double quotes. Here is two examples of how to kick someone, the first without spaces in the name, and the second example with spaces:
/kick Argooon Please stop killing your teammates.
/kick “You got owned” Profanity is not allowed on this server.
Well, that’s all for this section of the BZTip. I will be posting how to use the various ban commands in part 2 next week! (Yes, there is enough of them that I can make an entire blog post just for them – 11 commands)
]]>Here’s an example of what you could run:
/localset someVariableName 1
Okay, now that you know how to set client-side variables, I’m going to cover a handful of them that aren’t exposed in the GUI.
showCoordinates
The showCoordinates variable can be set to 1, which will then show your tank’s current coordinates in the top right corner of the screen. This can be useful for map development to determine the position of the tank when resting on an object or platform.
trackShots
This is another boolean value (0 for off, 1 for on) that you can set. When this variable is turned on, and you are in the observer mode following or driving with a tank, it will switch the camera view to a view of their bullet when they fire. This might be removed in future versions of BZFlag, but it exists in at least 2.0.10. Kinda makes you sick if you use it for too long, but it is fun to fly along with a guided missile.
noGUI
This one is especially useful for getting good screenshots. It turns off the manority of the user interface. The radar and chat panel still remain, but you can turn those off with ‘q’ and ‘w’. With all of that combined, you can get a screenshot that doesn’t have any text or user interface.
tkwarnratio
This one is mainly useful for admins. You can set this to a ratio (such as 0.3) and if a user has that ratio of team kills (30%, based on the previous example), then it will highlight their number of TKs in cyan. Neat!
latitude
longitude
These two options can be altered, and will affect stuff like the star patterns. I’m not sure what all effects this has (might affect the moon/sun position, time of sunrise/sunset, etc), but feel free to play around with it. The sky system in BZFlag is quite advanced.
EDIT: trepan also mentioned that some (or all?) of theses could be replaced with Lua scripts. However, to replicate trackShots, you’d need to use LuaWorld or LuaBzOrg, since LuaUser cannot access shot data.
]]>Many servers have a chat filter set up to block profanity. But there are still quite a few that do not have such a filter. If you want to censor out profanity on those servers, there is a way built into the client to do this.
The method to accomplish this varies depending on the operating system, but it all involves passing -badwords to the BZFlag executable along with a path to the badwords file. Full directions provided in this article.
First of all, you need to get a list of swear words. I’d recommend getting the simpleSwearList.txt (Right click and save the file unless you want to learn new words…) from our SVN. For Windows users, I recommend you save this straight into the install directory for BZFlag (ex: C:\Program Files\BZFlag2.0.10\), and for OSX and Linux users, save it into your user or home directory, respectively. I typically delete everything except the English language words, since I don’t care about seeing profanity in languages I don’t know.
Now that you have the file saved, the general idea is to pass the following to the BZFlag executable:
-badwords /path/to/simpleSwearList.txt
Now for Windows, this is quite easy. Because you saved the file into the install directory, you don’t have to provide the path, since the ‘working directory’ is the installation path. So, right click on the shortcut you use to launch BZFlag, and then click on Properties. Go to the end of the Target line and add this:
-badwords simpleSwearList.txt
Make sure to include a space before the hyphen. Here is what it will look like:
For OSX, I’m not sure of an easy method, nor can I verify if this works. But you should be able to start the Terminal application, then drag your BZFlag icon into the terminal. This should automatically type out the path to your BZFlag .app file. After that, you can then try typing the same text that was used for Windows just above here:
-badwords simpleSwearList.txt
If that doesn’t work, then try typing the following, where “YourUsernameHere” is your username:
-badwords /Users/YourUsernameHere/simpleSwearList.txt
Advanced users could do something like an AppleScript or a shell script to do this automatically, but that goes beyond the scope of this article.
And for Linux, you can also do it via the Terminal, or you can edit the launcher for BZFlag. I will use Ubuntu 8.10 with Gnome as an example.
This assumes BZFlag was installed using the package manager. Go to System > Preferences > Main Menu.
From there, click on “Games” on the left, click on BZFlag, and then hit the Properties button. Edit the Command to look like it does in the screenshot (click for full sized image):
After that, click Close, and then Close again.
With all of that done, your client should filter out profanity, including text from private and team chat. The most common reason for this not working would be specifying the wrong path to your bad words file. Make sure you have it in the correct location, and worse case, use a full path to the file.
]]>