No known key found for this signature in database
GPG Key ID: FD81DE6D75E20917
2 changed files with
11 additions and
9 deletions
-
server/src/games/run/types.rs
-
server/src/server.rs
|
|
|
@ -51,14 +51,15 @@ impl Player { |
|
|
|
self.num |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set(&mut self, n: i64) -> RhaiResult<()> { |
|
|
|
if n < 0 { |
|
|
|
rhai_error(format!( |
|
|
|
"Can't assign to something smaller than 0 ({} < 0)", |
|
|
|
n |
|
|
|
)) |
|
|
|
} else if n < self.max as i64 { |
|
|
|
self.num = n as u32; |
|
|
|
pub fn set(&mut self, n: u32) -> RhaiResult<()> { |
|
|
|
// if n < 0 {
|
|
|
|
// rhai_error(format!(
|
|
|
|
// "Can't assign to something smaller than 0 ({} < 0)",
|
|
|
|
// n
|
|
|
|
// ))
|
|
|
|
// } else
|
|
|
|
if n < self.max { |
|
|
|
self.num = n; |
|
|
|
Ok(()) |
|
|
|
} else { |
|
|
|
rhai_error(format!( |
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
// use tonic::transport::Server;
|
|
|
|
|
|
|
|
use anyhow::Result; |
|
|
|
use log::warn; |
|
|
|
use log::{debug, warn}; |
|
|
|
use tokio::{ |
|
|
|
io::{AsyncReadExt, BufReader}, |
|
|
|
net::TcpListener, |
|
|
|
@ -255,6 +255,7 @@ pub async fn serve( |
|
|
|
.expect("Error handling card image query") |
|
|
|
} |
|
|
|
Data::CallOnClick(card_id) => { |
|
|
|
debug!("{:?}", card_id); |
|
|
|
on_click(&mut service_data, &socket_manager, card_id) |
|
|
|
.await |
|
|
|
.expect("Error handling on_click call") |
|
|
|
|