Add support for Mindustry (#178)

* buffer: Add UTF8LengthPrefixed string decoder

* games: Use expression for default port

This allows us to refer to constants for the default ports if we want to
(literals will still work).

* games: Add support for mindustry
This commit is contained in:
Tom 2024-01-17 13:53:40 +00:00 committed by GitHub
parent ba92466ae1
commit 07de5168f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 251 additions and 3 deletions

View file

@ -3,7 +3,7 @@
use std::net::{IpAddr, SocketAddr};
use crate::games::types::Game;
use crate::games::{ffow, jc2m, minecraft, savage2, theship};
use crate::games::{ffow, jc2m, mindustry, minecraft, savage2, theship};
use crate::protocols;
use crate::protocols::gamespy::GameSpyVersion;
use crate::protocols::quake::QuakeVersion;
@ -84,6 +84,7 @@ pub fn query_with_timeout_and_extra_settings(
}
ProprietaryProtocol::FFOW => ffow::query_with_timeout(address, port, timeout_settings).map(Box::new)?,
ProprietaryProtocol::JC2M => jc2m::query_with_timeout(address, port, timeout_settings).map(Box::new)?,
ProprietaryProtocol::Mindustry => mindustry::query(address, port, &timeout_settings).map(Box::new)?,
ProprietaryProtocol::Minecraft(version) => {
match version {
Some(minecraft::Server::Java) => {