Skip to main content

Crate plaza_lobby

Crate plaza_lobby 

Source
Expand description

Plaza Lobby: components for building single-server lobby and room management on top of Plaza Core.

Implement RoomFactory for your game, hand it to an InMemoryLobbyManager, and the manager handles room creation, listing, join authorization, and reaping finished rooms.

Four smaller pieces sit around the manager. None holds timers or spawns anything except CachedTicketRegistry, whose cache runs its own janitor thread, so an application drives them from its own StateLogic:

  • MatchQueue for games where a player is paired rather than choosing, including filling the seats nobody came for.
  • SeatReservations for the window between a lobby admitting a player and that player’s socket arriving.
  • TicketStore so a room learns who connected from the lobby rather than from the client, as either MapTicketRegistry or, behind the cache feature, CachedTicketRegistry.
  • routing for placing a connection in the room whose schedule fits it.

Re-exports§

pub use error::LobbyError;
pub use factory::RoomFactory;
pub use manager::InMemoryLobbyManager;
pub use manager::PasswordVerifier;
pub use queue::Formed;
pub use queue::MatchQueue;
pub use reservations::SeatReservations;
pub use room::InProcessRoomHandle;
pub use room::RoomHandle;
pub use tickets::CachedTicketRegistry;
pub use tickets::MapTicketRegistry;
pub use tickets::Ticket;
pub use tickets::TicketStore;
pub use types::GameMode;
pub use types::RoomId;
pub use op_payloads::*;

Modules§

error
factory
manager
op_payloads
queue
Pairs waiting players into matches and fills the empty seats when they have waited too long.
reservations
Seats promised to players who have not arrived yet.
room
routing
Which rooms a connection can actually play in, and in what order to offer them.
tickets
One-use tickets, so a room learns who connected without asking them.
types