[WIP] added second thread with OpenTAKServer API handling

This commit is contained in:
Valmo Trindade
2024-12-04 22:23:35 -03:00
parent 990f1035a0
commit e81104f9eb
6 changed files with 463 additions and 152 deletions

View File

@@ -1,7 +1,10 @@
use arma_rs::{arma, Extension};
use arma_rs::{arma, Extension, Group};
mod commands;
mod structs;
mod tests;
mod websocket;
mod api;
mod util;
#[arma]
pub fn init() -> Extension {
@@ -27,10 +30,22 @@ pub fn init() -> Extension {
log4rs::init_config(config).unwrap();
Extension::build()
.command("start", commands::start)
.command("stop", commands::stop)
.command("local_ip", commands::local_address)
.command("message", commands::message)
.command("location", commands::location)
.group("api", Group::new()
.command("start", websocket::start)
.command("stop", websocket::stop)
.command("message", websocket::message)
.command("location", websocket::location)
)
.command("local_ip", util::get_local_address)
.command("uuid", util::get_uuid)
.command("get_auth_token", api::get_auth_token)
.group(
"markers",
Group::new()
.command("get", api::markers::get)
.command("post", api::markers::post)
.command("post_debug", api::markers::post_debug)
.command("delete", api::markers::delete),
)
.finish()
}