Unreal Tournament Game Master: a command-line interface for the Unreal Tournament web control panel
Find a file
Antoine Mazeas 05276e1c27 typos
Signed-off-by: Antoine Mazeas <antoine@karthanis.net>
2022-02-21 23:31:25 +01:00
api New commands: addallmaps, delallmaps 2022-02-21 23:30:33 +01:00
command New commands: addallmaps, delallmaps 2022-02-21 23:30:33 +01:00
config Bootstrap i18n + some refactoring around http (ongoing) 2022-02-13 11:03:21 +01:00
environment add basic latin1 decoder + refactor api models 2022-02-13 11:03:21 +01:00
http simplify getting response body as string 2022-02-20 19:25:37 +01:00
lang Add commands: setmaplist, addmap, delmap 2022-02-21 17:57:16 +01:00
text Add support for 'current players' + kick/ban 2022-02-13 11:03:21 +01:00
.gitignore save progress 2022-02-13 11:03:21 +01:00
go.mod cleanup commands + api 2022-02-13 11:03:21 +01:00
go.sum cleanup commands + api 2022-02-13 11:03:21 +01:00
LICENSE Initial commit 2022-01-28 23:27:28 +00:00
README.md typos 2022-02-21 23:31:25 +01:00
utgm.go refactor command subsystem 2022-02-13 11:03:21 +01:00

utgm

Unreal Tournament Game Master: a command-line interface for the Unreal Tournament web control panel.

UTGM works by sending GET and POST requests to the internal web server serving the web control panel, parsing the HTML and encoding user input into form data.

Server setup

UTGM requires the web control panel be activated in the server's .ini file:

[UWeb.WebServer]
bEnabled=True

Additionally, it may be worth checking the access credentials:

[UTServerAdmin.UTServerAdmin]
AdminUsername=admin
AdminPassword=admin

Usage

$ utgm [--host HOSTNAME[:PORT]] [--user USERNAME] [--pw PASSWORD] [--config FILEPATH] [--lang LANG] COMMAND [ARGUMENTS...]

Main program options

OPTION DESCRIPTION DEFAULT EXAMPLE
--host Hostname and optional port of the machine running the ut99 server with the web console enabled N/A localhost:5580
--user Username for accessing the web console (as set in the server's .ini file) N/A admin
--pw Password for accessing the web console (as set in the server's .ini file) N/A admin
--config Path to the configuration file, if applicable. See Configuration File for details $HOME/.utgm/utgm.conf (Unix); %APPDATA%\.utgm\utgm.conf (Windows) somepath/somefile.conf
--lang Language used in the UTGM program fr en, de... if available

Configuration File

UTGM supports a configuration file for storing recurrent or sensitive information that is either cumbersome to add to every command or that would not be desired in the command prompt's history.

It is a simple, flat JSON-formatted file which currently supports providing values for the --host, --user and --pw options, which can be omitted if set in the file.

Example file:

{
    "host": "localhost:5580",
    "user": "admin",
    "pw": "admin"
}

If the --config option is not provided, the program will automatically attempt to load a configuration file from a default, platform-dependent location, at launch:

  • Unix: $HOME/.utgm/utgm.conf
  • Windows: %APPDATA%\.utgm\utgm.conf

If the configuration file does not exist at the default location, it is only a warning if the other options are provided, namely --host, --user and --pw are provided on the command line.

Commands

The COMMAND parameter determines which action the UTGM program will communicate to the server software. They are listed below with their arguments.

showmatch

Shows the currently running map and game type.

Arguments

N/A

Example

utgm showmatch

switchlevel

Instructs the server software to immediately change the currently running map and game type to those provided by the command.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.
--level Chosen map Must be an active map in the rotation for the chosen game type. To add more maps to the rotation, see command setmaprotation

Example

utgm switchlevel --level CTF-Face.unr --game Botpack.CTFGame

showplayers

Shows all currently active players on the running server instance, including bots if present.

Arguments

N/A

Example

utgm showplayers

setminplayers

Sets the minimum number of players in the current match. Automatically adjusts the bot population.

Arguments

Argument Description Note
--min Minimum number of players Will be constrained between 0 and 16

Example

utgm setminplayers --min 12

kick

Kicks a player from the running server instance (does not ban them).

Arguments

Argument Description Note
--playerid The numerical player's ID The players' IDs are shown via the showplayers command. Only human players can be kicked as the bot population is dynamically adjusted to meet the minimum players quota

Example

utgm kick --playerid 0

ban

Bans a player from the running server instance (stores their IP address in the banned list).

Arguments

Argument Description Note
--playerid The numerical player's ID The players' IDs are shown via the showplayers command. Only human players can be kicked as the bot population is dynamically adjusted to meet the minimum players quota

Example

utgm ban --playerid 0

showmutators

Lists active and inactive mutators on the running server instance.

Arguments

N/A

Example

utgm showmutators

addmutator

Sets a mutator to "active" state on the running server instance.

Arguments

Argument Description Note
--class The mutator's class The mutator classes are shown via the showmutators command.

Example

utgm addmutator --class Botpack.InstaGibDM

delmutator

Sets a mutator to "inactive" state on the running server instance.

Arguments

Argument Description Note
--class The mutator's class The mutator classes are shown via the showmutators command.

Example

utgm delmutator --class Botpack.InstaGibDM

addallmutators

Sets all registered mutators to "active" state on the running server instance.

Arguments

N/A

Example

utgm addallmutators

delallmutators

Sets all registered mutators to "inactive" state on the running server instance.

Arguments

N/A

Example

utgm delallmutators

showlog

Displays the event and chat log for the current match. Caveat: the web view of the console log is unfortunately quite sparse.

Arguments

N/A

Example

utgm showlog

say

Broadcasts a text message as "Admin" to all players currently in the game.

Arguments

Argument Description Note
--msg The message to send The message must be sent within double quotes if it has any space in it.

Example

utgm say --msg "Here's my message"

restart

Restarts the current match.

Arguments

N/A

Example

utgm restart

showmaprotation

Displays the current map rotation for the given game type.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.

Example

utgm showmaprotation --game Botpack.CTFGame

setmaplist

Sets the map rotation for a given game type to a predefined map list.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.
--list Map list name One of the built-in map lists for the given game type.

Example

utgm setmaplist --game Botpack.CTFGame --list MultiMesh.CTFBonusPackMapList

addmap

Adds an inactive map to the bottom of the active rotation, for the given game type.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.
--map Map name Must be the name of an inactive map that is valid for the given game type.

Example

utgm addmap --game Botpack.CTFGame --map CTF-Face.unr

addallmaps

Adds all available maps to the active rotation, for the given game type.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.

Example

utgm addallmaps --game Botpack.CTFGame

delmap

Removes the specified map from the active rotation, for the given game type.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.
--map Map name Must be the name of an active map that is valid for the given game type.

Example

utgm delmap --game Botpack.CTFGame --map CTF-Face.unr

delallmaps

Removes all available maps from the active rotation, for the given game type.

Arguments

Argument Description Note
--game Chosen game type Must be an active game type on the running server instance.

Example

utgm delallmaps --game Botpack.CTFGame