Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropped board.size #442

Merged
merged 1 commit into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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