aboutsummaryrefslogtreecommitdiff
path: root/assets/manual/man/man7advtrains/rwt.7advtrains.md
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-08-10 09:57:15 +0200
committerY. Wang <yw05@forksworld.de>2022-08-10 09:57:15 +0200
commit4f9bd72a847ccec3b580def8a4ca2ee12e453477 (patch)
tree03d22fb205cfd4bf128e36a84ea94f43ac6267df /assets/manual/man/man7advtrains/rwt.7advtrains.md
parent5cc7f50bad779e4f4efb747a74bbce53a7e05cd3 (diff)
downloadadvtrains-4f9bd72a847ccec3b580def8a4ca2ee12e453477.tar.gz
advtrains-4f9bd72a847ccec3b580def8a4ca2ee12e453477.tar.bz2
advtrains-4f9bd72a847ccec3b580def8a4ca2ee12e453477.zip
Reformat RWT documentation as manual pages
Diffstat (limited to 'assets/manual/man/man7advtrains/rwt.7advtrains.md')
-rw-r--r--assets/manual/man/man7advtrains/rwt.7advtrains.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/assets/manual/man/man7advtrains/rwt.7advtrains.md b/assets/manual/man/man7advtrains/rwt.7advtrains.md
new file mode 100644
index 0000000..5e04d5e
--- /dev/null
+++ b/assets/manual/man/man7advtrains/rwt.7advtrains.md
@@ -0,0 +1,24 @@
+% RWT(7ADVTRAINS) | Advtrains Developer's Manual
+
+# NAME
+`rwt` - Advtrains railway time
+
+# DESCRIPTION
+Advtrains depends on Minetest's "dtime" for most operations, and may slow itself down when necessary to prevent unexpected behavior, such as in a situation with a significant amount of lag. As a result, the internal time used by Advtrains is not synchronized to real-life time due to lag and server restarts. Railway time was therefore introduced as a method of accurately measuring internal time and, with this information, implementing a scheduling system. It can, however, also be set up to keep in sync with real-life time.
+
+Railway time is counted in cycles, minutes, and seconds, roughly corresponding to their real-life counterparts, with cycles roughly corresponding to hours. For a valid railway time object, it is expected that
+
+* The "cycles" element is an integer,
+* The "minutes" element is an integer between 0 and 59 (inclusive), and
+* The "seconds" element is an integer between 0 and 59 (inclusive).
+
+Railway time may be represented in three formats:
+
+* As a table with the `c`, `m`, `s` fields holding the cycles, minutes, and seconds, respectively,
+* As a string with the cycles, minutes and seconds delimited with a semicolon,
+* For zero cycles, as a string with the minutes and seconds delimited with a semicolon, or
+* As a number representing the number of seconds since 0;0;0.
+
+If railway time is represented as a string, each element may have a variable length and do not require padding zeroes, and an element of the string may be empty if it is at the beginning or the end of the string.
+
+The railway time API is available in the `advtrains.interlocking.rwt` table or, for LuaATC, in the `rwt` table.