add logs (#62)

This commit is contained in:
Gregor Zeitlinger 2024-10-03 07:57:07 +02:00 • committed by GitHub
commit 359694f74c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -5,7 +5,9 @@ updates:
schedule:
interval: weekly
- package-ecosystem: cargo
directory: "/"
directories:
- client
- server
schedule:
interval: daily

View file

@ -40,6 +40,7 @@ export class Control extends EventEmitter {
}
send_ready() {
console.log("Sending ready");
this.emit("ready");
}

View file

@ -60,6 +60,7 @@ async fn main() {
#[wasm_bindgen]
impl RemoteClient {
pub async fn start() {
log("starting client");
panic::set_hook(Box::new(console_error_panic_hook::hook));
let control = get_control();
let features = Features {
@ -79,9 +80,11 @@ impl RemoteClient {
}
pub async fn run(&mut self) {
log("running client");
loop {
let p = self.control.receive_player_index().as_f64();
if let Some(p) = p {
log(&format!("received player index: {}", p));
self.state.control_player = Some(p as usize);
self.state.show_player = p as usize;
}