Changed how the data is tokenised

This commit is contained in:
2026-05-17 12:47:22 +01:00
parent 0c28bc113d
commit 13049309b2
10 changed files with 303 additions and 164 deletions
+3 -1
View File
@@ -20,6 +20,7 @@ use crate::
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct DataToSend {
pub id: u32,
pub action_type: String,
pub content: String,
pub character: String,
@@ -53,7 +54,7 @@ pub async fn api_process
// Perform this code on a GET request
.map(|state: Arc<Mutex<DataToSend>>, tx_handle: Sender<(bool,usize,String)>|
{
debug!("GET: {state:?}");
//debug!("GET: {state:?}");
let reply = state.as_ref();
let _ = tx_handle.send((true,0,String::new()));
warp::reply::json(&reply) // Send the reply data (data_to_send formatted as JSON)
@@ -126,6 +127,7 @@ pub fn modify_data
)
{
let mut data = data_to_send.lock().unwrap_or_exit("Data to send Mutex was poisoned",2); // TODO eh?
data.id += 1;
data.action_type = action_type;
data.content = content;
data.character = character_name;