+ }
+}
+
+/^\.allow \S+$/ {
+ _who = $2 in USERS ? USERS[$2]["auth"] : ""
+ _str = _who && _who != $2 ? $2 " (" _who ")" : $2
+ if (sp_state ~ "new|join") {
+ reply("The game has not yet started")
+ }
+ else if (!(sp_from in sp_players)) {
+ reply("You are not playing")
+ }
+ else if (!_who) {
+ reply(_str " is not logged in")
+ }
+ else if (_who in sp_players || _who in sp_auths) {
+ reply(_str " is a primary player")
+ }
+ else if (_who in sp_share) {
+ reply(_str " is already playing for " sp_share[_who])
+ }
+ else {
+ reply(_str " can now play for " sp_from)
+ sp_share[_who] = sp_from
+ }
+}
+
+/^\.deny \S+$/ {
+ _who = $2 in USERS ? USERS[$2]["auth"] : $2
+ _str = _who && _who != $2 ? $2 " (" _who ")" : $2
+ if (sp_state ~ "new|join") {
+ reply("The game has not yet started")
+ }
+ else if (!(sp_from in sp_players)) {
+ reply("You are not playing")
+ }
+ else if (_who in sp_players || _who in sp_auths) {
+ reply(_str " is a primary player")
+ }
+ else if (!(_who in sp_share) || sp_share[_who] != sp_from) {
+ reply(_str " is not playing for " sp_from)
+ }
+ else {
+ reply(_str " can no longer play for " sp_from)
+ delete sp_share[_who]
+ }
+}
+
+sp_state ~ "(bid|pass|play)" &&
+/^\.show/ {
+ delete _lines
+ for (_i in sp_share)
+ _lines[sp_share[_i]] = _lines[sp_share[_i]] " " _i
+ for (_i in _lines)
+ say(_i " allowed:" _lines[_i])