ts-bookkeeping: parse TeamSpeak 6 times in milliseconds
TeamSpeak 6 (6.0.0-beta13.1) sends the `datetime` of notifyfilelist in milliseconds. The parser read it as seconds, failed on the out-of-range date and dropped the whole message, so every file list came back empty. Times from 10^11 on (year 5138 in seconds) are now taken as milliseconds. The TS6 dev server gets its own file transfer port (30034): clients connect to the port the server announces, and 30033 on the host is the TS3 server's, so transfers with TS6 went to the wrong server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
1 parent
64775cd868
commit
e10c5ba7f4
3 files changed
+16
-4
No files matched your search
@@ -74,3 +74,7 @@ against or offered back to upstream.
|
|||||||
`FiletransferHandle`; it now fails the transfer (`FiletransferFailed`). A
|
`FiletransferHandle`; it now fails the transfer (`FiletransferFailed`). A
|
||||||
transfer address of `0.0.0.0`/`::` means the server's own address. The return
|
transfer address of `0.0.0.0`/`::` means the server's own address. The return
|
||||||
code and transfer id counters wrap instead of overflowing.
|
code and transfer id counters wrap instead of overflowing.
|
||||||
|
9. **TeamSpeak 6 times in milliseconds** (`ts-bookkeeping/build/message_parser.rs`,
|
||||||
|
"Voelin patch"). TeamSpeak 6 sends some times, e.g. `datetime` of `notifyfilelist`,
|
||||||
|
in milliseconds, which failed to parse and dropped the whole message (empty file
|
||||||
|
lists). Values from 10^11 on (year 5138 in seconds) are taken as milliseconds.
|
||||||
@@ -181,13 +181,18 @@ pub fn single_value_deserializer(field: &Field, rust_type: &str) -> String {
|
|||||||
panic!("Unknown original time type {} found.", field.type_s);
|
panic!("Unknown original time type {} found.", field.type_s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Voelin patch: TeamSpeak 6 sends some times (e.g. `datetime` of
|
||||||
|
// `notifyfilelist`) in milliseconds; seconds past 10^11 (year 5138)
|
||||||
|
// are taken as milliseconds.
|
||||||
"OffsetDateTime" => format!(
|
"OffsetDateTime" => format!(
|
||||||
"OffsetDateTime::from_unix_timestamp(
|
"OffsetDateTime::from_unix_timestamp({{
|
||||||
val.parse().map_err(|e| ParseError::ParseInt {{
|
let t: i64 = val.parse().map_err(|e| ParseError::ParseInt {{
|
||||||
arg: \"{}\",
|
arg: \"{}\",
|
||||||
value: val.to_string(),
|
value: val.to_string(),
|
||||||
source: e,
|
source: e,
|
||||||
}})?).map_err(|e| ParseError::ParseDate {{
|
}})?;
|
||||||
|
if t.unsigned_abs() >= 100_000_000_000 {{ t / 1000 }} else {{ t }}
|
||||||
|
}}).map_err(|e| ParseError::ParseDate {{
|
||||||
arg: \"{}\",
|
arg: \"{}\",
|
||||||
value: val.to_string(),
|
value: val.to_string(),
|
||||||
source: e,
|
source: e,
|
||||||
|
|||||||
@@ -46,11 +46,14 @@ services:
|
|||||||
TSSERVER_QUERY_SSH_ENABLED: 1
|
TSSERVER_QUERY_SSH_ENABLED: 1
|
||||||
TSSERVER_QUERY_HTTP_ENABLED: 1
|
TSSERVER_QUERY_HTTP_ENABLED: 1
|
||||||
TSSERVER_QUERY_ALLOW_LIST: /etc/tsserver/query_ip_allowlist.txt
|
TSSERVER_QUERY_ALLOW_LIST: /etc/tsserver/query_ip_allowlist.txt
|
||||||
|
# Clients connect to the port the server announces, so it must be the
|
||||||
|
# published one (30033 is the TS3 server's).
|
||||||
|
TSSERVER_FILE_TRANSFER_PORT: 30034
|
||||||
ports:
|
ports:
|
||||||
- "9988:9987/udp" # voice (mapped to 9988 so both servers can run)
|
- "9988:9987/udp" # voice (mapped to 9988 so both servers can run)
|
||||||
- "10022:10022" # SSH ServerQuery
|
- "10022:10022" # SSH ServerQuery
|
||||||
- "10080:10080" # HTTP WebQuery
|
- "10080:10080" # HTTP WebQuery
|
||||||
- "30034:30033" # file transfer
|
- "30034:30034" # file transfer: the server announces its own port
|
||||||
volumes:
|
volumes:
|
||||||
- ts6-data:/var/tsserver
|
- ts6-data:/var/tsserver
|
||||||
- ./query_ip_allowlist.txt:/etc/tsserver/query_ip_allowlist.txt:ro
|
- ./query_ip_allowlist.txt:/etc/tsserver/query_ip_allowlist.txt:ro
|
||||||
|
|||||||
Reference in new issue
Block a user