Update readme and remove some old comments

This commit is contained in:
Justin Hawkins 2020-11-21 20:43:51 +10:30
parent 935e445510
commit 5cdf8777dc
2 changed files with 15 additions and 10 deletions

View File

@ -1,6 +1,6 @@
# openttd-admin # openttd-admin
This is a Golang interface to an OpenTTD server, and a standalone 'openttd_multitool' binary This is a Golang interface to an OpenTTD server, and a standalone 'openttd_multitool' binary
for simple, periodic server operations. for simple, periodic server operations.
The latter might include periodically: The latter might include periodically:
@ -9,9 +9,15 @@ The latter might include periodically:
* saving the game to a custom, datestamped save * saving the game to a custom, datestamped save
* generating datestamped screenshots * generating datestamped screenshots
## admin.go library
At the moment the library has limited support for anything except managing
responses to date changes. Please tell me your use case and I will be happy
to look at extending it further. Or, pull requests accepted :-)
## openttd_multitool ## openttd_multitool
The openttd_multitool connects to the OpenTTD Admin port (default 3977) The openttd_multitool connects to the OpenTTD Admin port (default 3977)
and stays connected. It monitors the game date, and performs your custom commands and stays connected. It monitors the game date, and performs your custom commands
at periodic intervals. at periodic intervals.
@ -23,6 +29,11 @@ Possible intervals are:
These intervals are obviously in game time! These intervals are obviously in game time!
## running
The tool is a command line driven executable. It does not require installation.
Just copy it somewhere and run it.
You can configure the tool to send any command that you would type at the OpenTTD You can configure the tool to send any command that you would type at the OpenTTD
console. Here are a few examples: console. Here are a few examples:
@ -40,10 +51,9 @@ This saves the game once per month, with a filename like "mygame-2020-11.sav".
This generates a screenshot once per year of the entire map, with a name like "screenshot-20201121.png". This generates a screenshot once per year of the entire map, with a name like "screenshot-20201121.png".
NOTE that your OpenTTD server needs to support generating screenshots (some dedicated servers compiled without NOTE that your OpenTTD server needs to support generating screenshots (some dedicated servers compiled without
graphics will not work) and the appropriate graphics packs need to also be installed. graphics will not work) and the appropriate graphics packs need to also be installed.
Additionally, when using the "screenshot giant" command, the entire server will freeze for that time, almost Additionally, when using the "screenshot giant" command, the entire server will freeze for that time, almost
certainly kicking off all clients, unless your map is very small or your server is very very fast! certainly kicking off all clients, unless your map is very small or your server is very very fast!
No harm is done in that case, they can just reconnect after the screenshot is finished. No harm is done in that case, they can just reconnect after the screenshot is finished.

View File

@ -7,17 +7,12 @@ import (
"os" "os"
) )
// ./openttd_multitool --monthly "say \"hi it is a new month\"" --daily "say \"wow a new day %D"
const currentVersion = "0.02" const currentVersion = "0.02"
type dailyFlags []string type dailyFlags []string
type monthlyFlags []string type monthlyFlags []string
type yearlyFlags []string type yearlyFlags []string
func (i *dailyFlags) String() string { func (i *dailyFlags) String() string {
// change this, this is just can example to satisfy the interface // change this, this is just can example to satisfy the interface
return "my string representation" return "my string representation"