better name
This commit is contained in:
parent
f7a1f66667
commit
a95deceef9
1 changed files with 7 additions and 5 deletions
|
@ -47,7 +47,7 @@ impl GameHandler {
|
||||||
DeleteGame(request) => self.delete_game(request).await,
|
DeleteGame(request) => self.delete_game(request).await,
|
||||||
SendGameStateUpdate(game_ids) => self.send_game_state_update_all(game_ids),
|
SendGameStateUpdate(game_ids) => self.send_game_state_update_all(game_ids),
|
||||||
SendGameMetaUpdate(game_ids) => self.send_game_meta_update(game_ids),
|
SendGameMetaUpdate(game_ids) => self.send_game_meta_update(game_ids),
|
||||||
BroadcastGamesUpdate() => self.broadcast_games_update(),
|
BroadcastGamesUpdate() => self.broadcast_game_browser_update(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ impl GameHandler {
|
||||||
.remove(&request.delete_game_id)
|
.remove(&request.delete_game_id)
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
self.broadcast_games_update();
|
self.broadcast_game_browser_update();
|
||||||
} else {
|
} else {
|
||||||
tracing::error!("User tried to delete a nonexistent game!");
|
tracing::error!("User tried to delete a nonexistent game!");
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,8 @@ impl GameHandler {
|
||||||
// Send updates for all players
|
// Send updates for all players
|
||||||
self.send_game_meta_update(vec![game_id.clone()]);
|
self.send_game_meta_update(vec![game_id.clone()]);
|
||||||
|
|
||||||
self.broadcast_games_update();
|
// Update games list
|
||||||
|
self.broadcast_game_browser_update();
|
||||||
|
|
||||||
// Broadcast server meta update
|
// Broadcast server meta update
|
||||||
if let Err(e) = self
|
if let Err(e) = self
|
||||||
|
@ -383,7 +384,8 @@ impl GameHandler {
|
||||||
self.send_game_state_update_all(vec![game_id.clone()]);
|
self.send_game_state_update_all(vec![game_id.clone()]);
|
||||||
self.send_game_meta_update(vec![game_id]);
|
self.send_game_meta_update(vec![game_id]);
|
||||||
|
|
||||||
self.broadcast_games_update();
|
// Update games list
|
||||||
|
self.broadcast_game_browser_update();
|
||||||
|
|
||||||
// Broadcast server meta update
|
// Broadcast server meta update
|
||||||
let msg = meta_server_summary_update(&self.state);
|
let msg = meta_server_summary_update(&self.state);
|
||||||
|
@ -399,7 +401,7 @@ impl GameHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generate games list update
|
/// Generate games list update
|
||||||
fn broadcast_games_update(&self) {
|
fn broadcast_game_browser_update(&self) {
|
||||||
// TODO: this may get expensive if there are many games
|
// TODO: this may get expensive if there are many games
|
||||||
|
|
||||||
let games = self
|
let games = self
|
||||||
|
|
Loading…
Add table
Reference in a new issue