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/net/download.cpp | 7 +++++++ src/net/download.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/net') diff --git a/src/net/download.cpp b/src/net/download.cpp index fad0bf6f2..a8f0e1c0c 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -125,6 +125,13 @@ unsigned long Download::fadler32(FILE *const file) return adler; } +unsigned long Download::adlerBuffer(char *buffer, int size) +{ + unsigned long adler = adler32(0L, Z_NULL, 0); + return adler32(static_cast(adler), + reinterpret_cast(buffer), size); +} + void Download::addHeader(const std::string &header) { mHeaders = curl_slist_append(mHeaders, header.c_str()); diff --git a/src/net/download.h b/src/net/download.h index d351a8355..d0025c2b3 100644 --- a/src/net/download.h +++ b/src/net/download.h @@ -100,6 +100,8 @@ class Download final static void secureCurl(CURL *const curl); + static unsigned long adlerBuffer(char *buffer, int size); + private: static int downloadThread(void *ptr); static int downloadProgress(void *clientp, double dltotal, -- cgit v1.2.3-70-g09d2