From 49f27fffbe07e66a3047812a838f03d7636cc4a9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 1 Jun 2013 18:45:31 +0300 Subject: Add chat command /testparticle for testing particle effects on player. Command: /testparticle particle.xml - set particle effect on player. /testparticle - remove particle effect. Each second it check for particle file update and reloading it if need. --- src/gui/updaterwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gui/updaterwindow.cpp') diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index 28efe9499..80ff0c580 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -925,6 +925,15 @@ bool UpdaterWindow::validateFile(const std::string &filePath, return adler == hash; } +unsigned long UpdaterWindow::getFileHash(const std::string &filePath) +{ + int size = 0; + char *buf = static_cast(ResourceManager::loadFile(filePath, size)); + if (!buf) + return 0; + return Net::Download::adlerBuffer(buf, size); +} + void UpdaterWindow::handleLink(const std::string &link, gcn::MouseEvent *event A_UNUSED) { -- cgit v1.2.3-70-g09d2