Skip to content

Commit

Permalink
Fix dropped board.size (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Terkwood authored Oct 30, 2020
1 parent fb7b7ba commit 381ce26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion botlink/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions botlink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["terkwood <[email protected]>"]
edition = "2018"
name = "botlink"
version = "1.0.0-f"
version = "1.0.0-g"

[dependencies]
base64 = "0.13.0"
Expand All @@ -19,9 +19,9 @@ log = "0.4.11"
move-model = {git = "https://github.com/Terkwood/BUGOUT", rev = "20e6620"}
redis = {version = "0.17.0"}
redis_streams = {git = "https://github.com/Terkwood/BUGOUT", rev = "2ea71cd"}
serde = "1.0.117"
serde_derive = "1.0.117"
tokio = {version = "0.2.20", default-features = false, features = ["io-std", "io-util", "macros", "stream", "time"]}
tokio-tungstenite = "0.10.1"
tungstenite = "0.10.1"
uuid = {version = "0.8.1", features = ["v4", "serde"]}
serde_derive = "1.0.117"
serde = "1.0.117"
8 changes: 4 additions & 4 deletions botlink/src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ fn process_attach_bot(ab: &AttachBot, opts: &mut StreamOpts) {
player_up: move_model::Player::BLACK,
};

if let Some(bs) = ab.board_size {
game_state.board.size = bs.into()
}

if let Err(e) = opts.attachment_repo.put(&Attachment {
game_id: ab.game_id.clone(),
player: ab.player,
Expand All @@ -72,10 +76,6 @@ fn process_attach_bot(ab: &AttachBot, opts: &mut StreamOpts) {
} else {
info!("Stream: Set up game state for attach bot {:?}", ab);

if let Some(bs) = ab.board_size {
game_state.board.size = bs.into()
}

if let Err(e) = opts.xadd.xadd_game_state(&game_state) {
error!(
"Error writing redis stream for game state changelog : {:?}",
Expand Down

0 comments on commit 381ce26

Please sign in to comment.