From 334e8bfed83b8729506f8c997310bee4f9e82aca Mon Sep 17 00:00:00 2001 From: Valmo Trindade Date: Fri, 31 Jan 2025 16:47:03 -0300 Subject: [PATCH] added initial callback handling --- src/lib.rs | 1 + src/util.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d4f29ad..ba792f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,6 +38,7 @@ pub fn init() -> Extension { ) .command("local_ip", util::get_local_address) .command("uuid", util::get_uuid) + .command("callback", util::test_callback) .command("log", util::log_info) .group( "cot_router", diff --git a/src/util.rs b/src/util.rs index 2f0e843..07b19d4 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,3 +1,4 @@ +use arma_rs::Context; use log::{error, info, warn}; use std::net::{IpAddr, UdpSocket}; use crate::structs::LogPayload; @@ -43,3 +44,9 @@ pub fn get_local_address() -> String { }, } } + +pub fn test_callback(ctx: Context) -> &'static str { + let _ = ctx.callback_data("armatak_test_callback", "123", "321"); + + "Testing Callback" +}