func Accept
crossing ActionAccept answers open challenge id as clan, with deck and the round-1 plan in plain text. When the challenge names an opponent, only that address may accept.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package arena holds Gnomepit's online matches. A challenger posts a sealed deck and round-1 plan; an acceptor answers...
Package arena holds Gnomepit's online matches. A challenger posts a sealed deck and round-1 plan; an acceptor answers face up; the challenger reveals each round with the seal of the next, and the shared duel engine checks and resolves every move. A session key is bound to the match of the first call it signs: it then acts in no other match and posts or accepts nothing more. Calls the wallet signs are never bound.
Accept answers open challenge id as clan, with deck and the round-1 plan in plain text. When the challenge names an opponent, only that address may accept.
Challenge posts a challenge for clan with the seals of the challenger's deck and round-1 plan, the box holding both, and an opponent who alone may accept, or none. It returns the new match's id. It first deletes up to 8 expired challenges, whoever posted them.
ClaimForfeit ends a running match whose deadline has passed: the player who had to move loses. Any wallet may claim it; a session may claim only a match its wallet plays.
Play records the acceptor's plan for the round being played.
RatedPlayers counts the players on the ladder.
Render serves the board of open challenges at "", one player's matches at "player/<address>", and one match at "match/<id>".
Resign withdraws the caller's open challenge, expired or not, deleting it, or concedes a running match.
Reveal opens the challenger's sealed plan for the round being played, and on the first reveal the sealed deck, then resolves the round. A match that goes on needs nextSeal and nextBox for the challenger's next plan; one that ends takes neither.
ClanStandings lists every clan of the ruleset, highest rating first; equal ratings keep ruleset order and share a rank.
Matches lists player's matches, newest first: limit of them after skipping offset.
Match returns the view of match id.
Open lists open, unexpired challenges, newest first: limit of them after skipping offset. limit is 1 to 50.
Locks lists player's session locks. It can include locks whose session has expired.
Leaderboard lists rated players, highest rating first: limit of them after skipping offset.
StandingOf returns player's standing, rated or not.
ClanStanding is one clan's record across rated cross-clan matches.
MatchSummary is one match as a player's list shows it. Round is the round being played, or the last one resolved once the match is over. ToMove is the address that must move next, empty when none. Deadline is the end of the current move's 24 hours, or the expiry of an open challenge, in Unix seconds. Opponent is the address an open challenge is reserved for, "" when anyone can accept it and once accepted.
MatchView is everything one match screen needs. Plans holds [challenger, acceptor] for each resolved round, and for the round being played while the match runs, "" while a plan is sealed or not yet made; HP holds both sides' HP after each resolved round; Box is the challenger's encrypted pending plan, in base64.
OpenChallenge is an open challenge as the board lists it.
SessionLock binds the session key at address Session to the match whose id is Match. Expires is the session's expiry in Unix seconds, 0 for none.
Standing is one player's place on the ladder. Rank is 1 for the highest rating and equal ratings share it; Rank is 0 and Rating 1000 for a player with no rated match. Name is the player's gno.land name, "" without one. MainClan is "" until their first rated match.