diff options
author | Florian Diebold <flodiebold@gmail.com> | 2012-08-26 20:38:01 +0200 |
---|---|---|
committer | Florian Diebold <flodiebold@gmail.com> | 2012-08-26 20:38:01 +0200 |
commit | 14b6cc245688ea76f8842dd928c8d0c121a6c57d (patch) | |
tree | 3502d6e3db1719a2de0374588d64239a043d7224 /crawl-ref/source/webserver/process_handler.py | |
parent | c1fbd6fca26203ea64b592e144151d560628983f (diff) | |
download | crawl-ref-14b6cc245688ea76f8842dd928c8d0c121a6c57d.tar.gz crawl-ref-14b6cc245688ea76f8842dd928c8d0c121a6c57d.zip |
Webtiles: Make static file URL also dependent on the exact Crawl version.
This should fix (most of the) problems on CSZO with stable versions,
which don't put the static files in a new directory when updating.
Diffstat (limited to 'crawl-ref/source/webserver/process_handler.py')
-rw-r--r-- | crawl-ref/source/webserver/process_handler.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/webserver/process_handler.py b/crawl-ref/source/webserver/process_handler.py index 3ddd500df7..274aa714ac 100644 --- a/crawl-ref/source/webserver/process_handler.py +++ b/crawl-ref/source/webserver/process_handler.py @@ -85,6 +85,7 @@ class CrawlProcessHandlerBase(object): self.process = None self.client_path = self.config_path("client_path") + self.crawl_version = None self.where = {} self.wheretime = 0 self.last_milestone = None @@ -194,7 +195,10 @@ class CrawlProcessHandlerBase(object): self._send_client(receiver) def _send_client(self, watcher): - v = hashlib.sha1(os.path.abspath(self.client_path)).hexdigest() + h = hashlib.sha1(os.path.abspath(self.client_path)) + if self.crawl_version: + h.update(self.crawl_version) + v = h.hexdigest() GameDataHandler.add_version(v, os.path.join(self.client_path, "static")) @@ -587,6 +591,9 @@ class CrawlProcessHandler(CrawlProcessHandlerBase): if msgobj["msg"] == "client_path": if self.client_path == None: self.client_path = self.format_path(msgobj["path"]) + if "version" in msgobj: + self.crawl_version = msgobj["version"] + self.logger.info("Crawl version: %s.", self.crawl_version) self.send_client_to_all() else: self.logger.warning("Unknown message from the crawl process: %s", |