summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tileweb.h
diff options
context:
space:
mode:
authorFlorian Diebold <flodiebold@gmail.com>2011-12-05 02:34:11 +0100
committerFlorian Diebold <flodiebold@gmail.com>2011-12-08 22:52:59 +0100
commitc12c29db0306c9dc45405604b2ee3a3be578d20c (patch)
tree7f5e549314aa474f46a0764984c90455e7fb254d /crawl-ref/source/tileweb.h
parentf00d455287fed45dafe5d818d693475448d3fef2 (diff)
downloadcrawl-ref-c12c29db0306c9dc45405604b2ee3a3be578d20c.tar.gz
crawl-ref-c12c29db0306c9dc45405604b2ee3a3be578d20c.zip
Don't waste CPU time sending messages in Webtiles-enabled executables if no server is connected to the crawl process.
Crawl will still be doing more stuff behind the scenes than without USE_TILE_WEB; but that's necessary so that if the server connects to the process at a later point, crawl can send the necessary data.
Diffstat (limited to 'crawl-ref/source/tileweb.h')
-rw-r--r--crawl-ref/source/tileweb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/tileweb.h b/crawl-ref/source/tileweb.h
index 6d61f54f4b..5bd69075d6 100644
--- a/crawl-ref/source/tileweb.h
+++ b/crawl-ref/source/tileweb.h
@@ -77,6 +77,8 @@ public:
void finish_message();
void send_message(const char *format = "", ...);
+ bool has_receivers() { return !m_dest_addrs.empty(); }
+
/* Webtiles can receive input both via stdin, and on the
socket. Also, while waiting for input, it should be
able to handle other control messages (for example,