Plaza

Server-authoritative shared state for multiplayer games and realtime apps: one controller, operations as values and a snapshot built for each client.

Plaza is a set of building blocks for applications where many people change one piece of state at once: multiplayer games, collaborative editors, shared whiteboards, auctions. One controller owns the state and is the only thing that changes it. It applies one operation at a time, so your rules need no locks and there is only ever one version of the state.

Every change is an operation: a value that describes the change instead of a direct write. That means the server can validate, reject, broadcast, log and replay it. The client can predict it before the server confirms it. Each client's snapshot is built for that client, so a card game that shows every player their own hand and only the count of everyone else's is the normal case.

Your rules are one method. The controller hands it the state and one input at a time and it returns the ops to send and who gets them. This is the counter from the first tutorial:

struct CounterRules;

#[async_trait]
impl StateLogic<CounterOp, UserId, Counter> for CounterRules {
    async fn process_input(
        &self,
        state: &mut Counter,
        input: LogicInput<CounterOp, UserId>,
    ) -> Result<LogicOutput<CounterOp, UserId>, StateLogicError> {
        let LogicInput::AgentOps { source, ops } = input else {
            return Ok(LogicOutput::none());
        };
        let Some(by) = source.id_cloned() else {
            return Ok(LogicOutput::none());
        };

        let mut out = Vec::new();
        for op in ops {
            if let CounterOp::Increment(n) = op {
                state.value += n;
                out.push(TargetedOp::new_system_all(vec![CounterOp::Changed {
                    by,
                    value: state.value,
                }]));
            }
        }
        Ok(out.into())
    }
}

Plaza is split into seven crates and you use the ones you need:

CrateWhat it holds
plazaThe controller loop, the traits you implement, the in-process session and optional schedulers, turn and phase modules.
plaza_sessionReal transports: actix-web WebSockets and length-delimited TCP, admission by credential, per-connection rate limits and the listen-server HTTP layer.
plaza_lobbyRooms on one server: create, list, join, reap, quick match and travel between rooms.
plaza_wireThe codec trait and message envelope a server and its clients share, plus a protocol version generated from your types.
plaza_client_utilsPrediction, reconciliation, interpolation, correction smoothing, fixed timesteps and rollback. No async runtime, so it suits wasm and engine plugins.
plaza_server_utilsLag compensation, relevance streaming, delta baselines, aggregation and seat allocation. Also runtime-free.
plaza_wsThe client-side socket: one interface over desktop, browser and in-process.

The plaza guide on GitHub explains how the pieces fit together and why they are shaped the way they are, in fifteen short chapters and an appendix that lists every block. The examples run from a two-client shared counter up to a listen-server with thousands of entities.

Plaza is experimental. The API changes often while the design settles and it has no production users yet.

Tutorials

Foundations

The world and its players

Show each player only their own handYou will build a small card table that runs in one process. Three players are dealt hidden hands. Each client sees its own cards and only a count for everyone else. A fourth player joins in the middle of the hand and catches up from a single snapshot. Then a leak check walks every message each client received and proves that no hidden card reached anyone else. Last, a uniform snapshot sends one public view to the whole table for the cost of building it once.Send only what each player can seeYou will build a yard of 2,000 crates with three players walking through it. First a spatial grid cuts each player's frame down to the crates within view. Then the view is streamed as deltas against what each client has acknowledged, with a mirror on the client that checks it still agrees with the server. Then packets are dropped to show why the acknowledged baseline matters. Last, an aggregate tree gives each player a coarse picture of the rest of the world. Every step prints the bytes it costs.Keep a seat for a player who dropsYou will build a three-seat table that is never empty. Bots sit in every seat until people arrive. A person takes a bot's seat on the next tick. When a player's link drops, the seat is held for a grace period with everything in it. If they come back in time they resume where they were. If they don't, the hold runs out and a bot takes the seat. Last, the host kicks a player. The table frees that seat at once, because it knows the close was ordered and was not a drop.