chore: initial comment for bumb v0.36.0 and resolve error while running example.

This commit is contained in:
darshankabariya 2025-11-12 17:48:13 +05:30
parent 57505a1c06
commit 18af595534
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22
2 changed files with 17 additions and 14 deletions

View File

@ -51,6 +51,7 @@ impl TicTacToeApp<Initialized> {
async fn start(self) -> TicTacToeApp<Running> {
let tx_clone = self.tx.clone();
let game_content_topic = WakuContentTopic::new("waku", "2", "tictactoegame", Encoding::Proto);
let my_closure = move |response| {
if let LibwakuResponse::Success(v) = response {
@ -59,8 +60,11 @@ impl TicTacToeApp<Initialized> {
match event {
WakuEvent::WakuMessage(evt) => {
// println!("WakuMessage event received: {:?}", evt.waku_message);
let message = evt.waku_message;
// Filter: only process messages for our game content topic
if message.content_topic != game_content_topic {
return; // Skip messages from other apps
}
let payload = message.payload.to_vec();
match from_utf8(&payload) {
Ok(msg) => {
@ -254,9 +258,8 @@ impl eframe::App for TicTacToeApp<Running> {
if ui.button("Play as O").clicked() {
self.player_role = Some(Player::O);
if let Ok(mut game_state) = self.game_state.try_lock() {
game_state.current_turn = Player::X; // player X should start
}
// Player O waits for Player X to make the first move
// No need to change current_turn as it's already X
}
return; // Exit early until a role is selected

View File

@ -31,25 +31,25 @@ pub struct PagingOptions {
pub struct StoreQueryRequest {
/// if true, the store-response will include the full message content. If false,
/// the store-response will only include a list of message hashes.
#[serde(rename = "requestId")]
#[serde(rename = "request_id")]
request_id: String,
#[serde(rename = "includeData")]
#[serde(rename = "include_data")]
include_data: bool,
#[serde(rename = "pubsubTopic", skip_serializing_if = "Option::is_none")]
#[serde(rename = "pubsub_topic", skip_serializing_if = "Option::is_none")]
pubsub_topic: Option<PubsubTopic>,
#[serde(rename = "contentTopics")]
#[serde(rename = "content_topics")]
content_topics: Vec<WakuContentTopic>,
#[serde(rename = "timeStart", skip_serializing_if = "Option::is_none")]
#[serde(rename = "time_start", skip_serializing_if = "Option::is_none")]
time_start: Option<u64>,
#[serde(rename = "timeEnd", skip_serializing_if = "Option::is_none")]
#[serde(rename = "time_end", skip_serializing_if = "Option::is_none")]
time_end: Option<u64>,
#[serde(rename = "messageHashes", skip_serializing_if = "Option::is_none")]
#[serde(rename = "message_hashes", skip_serializing_if = "Option::is_none")]
message_hashes: Option<Vec<MessageHash>>,
#[serde(rename = "paginationCursor", skip_serializing_if = "Option::is_none")]
#[serde(rename = "pagination_cursor", skip_serializing_if = "Option::is_none")]
pagination_cursor: Option<MessageHash>, // Message hash (key) from where to start query (exclusive)
#[serde(rename = "paginationForward")]
#[serde(rename = "pagination_forward")]
pagination_forward: bool,
#[serde(rename = "paginationLimit", skip_serializing_if = "Option::is_none")]
#[serde(rename = "pagination_limit", skip_serializing_if = "Option::is_none")]
pagination_limit: Option<u64>,
}