snoww / loa-logs

LOA Logs - Modern DPS Meter for Lost Ark
GNU General Public License v3.0
137 stars 32 forks source link

Looking to add a feature #117

Open msedek opened 2 weeks ago

msedek commented 2 weeks ago

Description of the new feature / enhancement

Im looking to deliver boss hp data via socket request

Scenario when this would be used?

I forked the project but when i compile with npm run tauri dev i get

➜ Local: http://localhost:5173/ ➜ Network: use --host to expose Warn Waiting for your frontend dev server to start on http://localhost:5173/... Info Watching C:\Development\loa-logs\src-tauri for changes... Updating crates.io index error: failed to get meter-core as a dependency of package app v0.1.0 (C:\Development\loa-logs\src-tauri)

so the project is missing the meter-core, I wonder if you could share it or how we do so i can add the feature,

it would be a simple localhost socket request like in example

[tokio::main]

async fn main() -> Result<(), Box> { let listener = TcpListener::bind("127.0.0.1:8080").await?; println!("Server listening on port 8080");

loop {
    let (stream, _) = listener.accept().await?;
    tokio::spawn(handle_client(stream));
}

}

async fn handle_client(mut stream: TcpStream) -> Result<(), Box> { let json_data = json!({ "message": "Hello, client!", "data": [1, 2, 3] });

let serialized = serde_json::to_string(&json_data)?;
stream.write_all(serialized.as_bytes()).await?;
stream.shutdown().await?;

Ok(())

}

so i can create an exteral app with the boss data, (all boss data required in real time something like { "bosses": [ { "name": "Boss 1", "totalHp": 10000, "currentHp": 8000, "shield": 2000, "maxShield": 2000, "hpBars": 5, "currentBars": 4, "percentage": 80 }, { "name": "Boss 2", "totalHp": 15000, "currentHp": 12000, "shield": 3000, "maxShield": 3000, "hpBars": 6, "currentBars": 5, "percentage": 80 }, { "name": "Boss 3", "totalHp": 20000, "currentHp": 18000, "shield": 4000, "maxShield": 4000, "hpBars": 7, "currentBars": 6, "percentage": 90 } ] })

Supporting information

that helps with progs or up until people gets confortable with the fight, we are the point where we need all the QoL possible, the app will show to start with every major mech incoming at XXX Hp bar this will change automaticaly based off of boss current HP and will add on top of that when the first phase is ready, text to speech so hte app will call mechs to mech

msedek commented 1 week ago

you could add the data service yourself iff you dont want me to have the core or contribute with the project directly and just provide the api documentation so i can extract the data by request could be socket or rest, like i said, just need all the boss data in real time

it wont affect the performance as i would run 1 request per second to check boss hp value and show the incoming mechs based off of that and you can also control that checkcurrent time and keeping the last request time