tic-tac-toe minor fixes

This commit is contained in:
Ivan Folgueira Bande 2024-12-23 00:41:35 +01:00
parent f2a6c8e86c
commit 5b0204f6b1
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7

View File

@ -2,7 +2,7 @@ use eframe::egui;
use serde::{Deserialize, Serialize};
use std::str::from_utf8;
use std::sync::{Arc, Mutex};
use std::time::{SystemTime, Duration};
use std::time::Duration;
use tokio::task;
use tokio::sync::mpsc;
@ -90,16 +90,16 @@ impl TicTacToeApp<Initialized> {
// Subscribe to desired topic using the relay protocol
waku.relay_subscribe(&self.game_topic).await.expect("waku should subscribe");
/// Example filter subscription. This is needed in edge nodes (resource-restricted devices)
/// Nodes usually use either relay or lightpush/filter protocols
// Example filter subscription. This is needed in edge nodes (resource-restricted devices)
// Nodes usually use either relay or lightpush/filter protocols
// let ctopic = WakuContentTopic::new("waku", "2", "tictactoegame", Encoding::Proto);
// let content_topics = vec![ctopic];
// waku.filter_subscribe(&self.game_topic, content_topics).await.expect("waku should subscribe");
/// End filter example ----------------------------------------
// End filter example ----------------------------------------
/// Example to establish direct connection to a well-known node
// Example to establish direct connection to a well-known node
// Connect to hard-coded node
// let target_node_multi_addr =
@ -111,7 +111,7 @@ impl TicTacToeApp<Initialized> {
// self.waku.connect(&target_node_multi_addr, None)
// .expect("waku should connect to other node");
/// End example direct connection
// End example direct connection
TicTacToeApp {
game_state: self.game_state,
@ -140,11 +140,11 @@ impl TicTacToeApp<Running> {
dbg!(format!("message hash published: {}", msg_hash));
}
/// Example lightpush publish message. This is needed in edge nodes (resource-restricted devices)
/// Nodes usually use either relay or lightpush/filter protocols
///
// Example lightpush publish message. This is needed in edge nodes (resource-restricted devices)
// Nodes usually use either relay or lightpush/filter protocols
//
// self.waku.lightpush_publish_message(&message, &self.game_topic);
/// End example lightpush publish message -------------------------------
// End example lightpush publish message
}
fn make_move(&mut self, row: usize, col: usize) {