diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/common/play.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/public/common/play.js b/public/common/play.js index e58ca04..0fa432a 100644 --- a/public/common/play.js +++ b/public/common/play.js @@ -376,12 +376,18 @@ function connect_play() { case 'state': view = arg; on_update_header(); - on_update(); + if (typeof on_update === 'function') + on_update(); on_update_log(); if (view.game_over) on_game_over(); break; + case 'reply': + if (typeof on_reply === 'function') + on_reply(arg[0], arg[1]); + break; + case 'save': window.localStorage[params.title_id + "/save"] = arg; break; @@ -547,6 +553,13 @@ function send_action(verb, noun) { return false; } +function send_query(q, param) { + if (param !== undefined) + send_message("query", [q, param]); + else + send_message("query", q); +} + function confirm_resign() { if (window.confirm("Are you sure that you want to resign?")) send_message("resign"); |