From fc59ef77cda14d97d854dfcaa848307cfa512b69 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 23:13:24 +0100 Subject: v1.0.0: replace slots with 5x3 reels and five paylines --- src/client/games/response.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/client/games/response.rs') diff --git a/src/client/games/response.rs b/src/client/games/response.rs index 6948805..de22a75 100644 --- a/src/client/games/response.rs +++ b/src/client/games/response.rs @@ -6,6 +6,7 @@ pub struct SpinResult { pub balance: i64, pub reels: String, pub win_type: String, + pub win_lines: Vec, } /// Parse one server reply to `PLAY_START`. @@ -45,10 +46,19 @@ pub fn parse_spin_response(response: &str) -> Result { .parse::() .map_err(|_| format!("Invalid balance from server: {}", parts[4]))?; - if parts[5].chars().count() != 3 { + if parts[5].chars().count() != 3 && parts[5].chars().count() != 15 { return Err(format!("Invalid reels from server: {}", parts[5])); } + let win_lines = parts + .get(7) + .map(|raw| { + raw.split(',') + .filter_map(|value| value.trim().parse::().ok()) + .collect() + }) + .unwrap_or_default(); + Ok(SpinResult { session_id: parts[1].to_string(), winnings, @@ -56,5 +66,6 @@ pub fn parse_spin_response(response: &str) -> Result { balance, reels: parts[5].to_string(), win_type: parts[6].to_string(), + win_lines, }) } -- cgit v1.2.3