better name

This commit is contained in:
Adam 2024-10-11 23:13:35 -04:00
parent f7a1f66667
commit a95deceef9

View file

@ -47,7 +47,7 @@ impl GameHandler {
DeleteGame(request) => self.delete_game(request).await,
SendGameStateUpdate(game_ids) => self.send_game_state_update_all(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)
.is_some()
{
self.broadcast_games_update();
self.broadcast_game_browser_update();
} else {
tracing::error!("User tried to delete a nonexistent game!");
}
@ -202,7 +202,8 @@ impl GameHandler {
// Send updates for all players
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
if let Err(e) = self
@ -383,7 +384,8 @@ impl GameHandler {
self.send_game_state_update_all(vec![game_id.clone()]);
self.send_game_meta_update(vec![game_id]);
self.broadcast_games_update();
// Update games list
self.broadcast_game_browser_update();
// Broadcast server meta update
let msg = meta_server_summary_update(&self.state);
@ -399,7 +401,7 @@ impl GameHandler {
}
/// 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
let games = self