1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-04-20 14:47:45 +00:00

Don't extract game data each time an action is recieved

This makes sending actions waaay more reliable, and shouldn't crash the
server as often.
This commit is contained in:
Joshua Goins 2025-03-29 14:42:38 -04:00
parent 1ef4078ec1
commit 5a358dd1b6

View file

@ -86,6 +86,16 @@ async fn main() {
let mut lua_player = LuaPlayer::default(); let mut lua_player = LuaPlayer::default();
let config = get_config();
let mut game_data =
GameData::from_existing(Platform::Win32, &config.game_location).unwrap();
let exh = game_data.read_excel_sheet_header("Action").unwrap();
let exd = game_data
.read_excel_sheet("Action", &exh, Language::English, 0)
.unwrap();
tokio::spawn(async move { tokio::spawn(async move {
let mut buf = [0; 2056]; let mut buf = [0; 2056];
loop { loop {
@ -764,20 +774,6 @@ async fn main() {
ClientZoneIpcData::ActionRequest(request) => { ClientZoneIpcData::ActionRequest(request) => {
tracing::info!("Recieved action request: {:#?}!", request); tracing::info!("Recieved action request: {:#?}!", request);
let config = get_config();
let mut game_data = GameData::from_existing(
Platform::Win32,
&config.game_location,
)
.unwrap();
let exh =
game_data.read_excel_sheet_header("Action").unwrap();
let exd = game_data
.read_excel_sheet("Action", &exh, Language::English, 0)
.unwrap();
let action_row = let action_row =
&exd.read_row(&exh, request.action_id).unwrap()[0]; &exd.read_row(&exh, request.action_id).unwrap()[0];