From e5b90fd512efe983065a5765cf0ad9e38e7591ca Mon Sep 17 00:00:00 2001 From: 3decibels <3db@3decibels.net> Date: Sun, 4 Jun 2017 23:43:28 +0000 Subject: [PATCH 1/4] Added expiration of uuidcache entries Entries in the uuidcache will now be considered expired if they were retrieved before the mtime of the player dat file. This follows the recommendation made in issue #1279. --- overviewer_core/aux_files/genPOI.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 0fc5b8b..9fd8704 100755 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -258,13 +258,15 @@ class PlayerDict(dict): sname = self._name.replace('-','') try: profile = PlayerDict.uuid_cache[sname] - return profile['name'] + if profile['retrievedAt'] > time.mktime(self['time']): + return profile['name'] except (KeyError,): pass try: profile = json.loads(urllib2.urlopen(UUID_LOOKUP_URL + sname).read()) if 'name' in profile: + profile['retrievedAt'] = time.mktime(time.localtime()) PlayerDict.uuid_cache[sname] = profile return profile['name'] except (ValueError, urllib2.URLError): From d36414b1bfc41d571f8c750426afb0a6a9bd549b Mon Sep 17 00:00:00 2001 From: lyknode Date: Sun, 16 Jul 2017 11:48:52 +0200 Subject: [PATCH 2/4] Fix slime algo by using integer for chunk coordinates. --- overviewer_core/src/primitives/overlay-slime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/overviewer_core/src/primitives/overlay-slime.c b/overviewer_core/src/primitives/overlay-slime.c index ca1a55e..feca6d5 100644 --- a/overviewer_core/src/primitives/overlay-slime.c +++ b/overviewer_core/src/primitives/overlay-slime.c @@ -59,10 +59,14 @@ static int random_next_int(long long *seed, int n) { return val; } -static int is_slime(long long map_seed, long chunkx, long chunkz) { +static int is_slime(long long map_seed, int chunkx, int chunkz) { /* lots of magic numbers, but they're all correct! I swear! */ long long seed; - random_set_seed(&seed, map_seed + (chunkx * chunkx * 0x4c1906LL) + (chunkx * 0x5ac0dbLL) + (chunkz * chunkz * 0x4307a7LL) + (chunkz * 0x5f24fLL) ^ 0x3ad8025fLL); + random_set_seed(&seed, (map_seed + + (long long)(chunkx * chunkx * 0x4c1906) + + (long long)(chunkx * 0x5ac0db) + + (long long)(chunkz * chunkz * 0x4307a7LL) + + (long long)(chunkz * 0x5f24f)) ^ 0x3ad8025f); return (random_next_int(&seed, 10) == 0); } From 2c2d1034ed791c7843fc3fecc386b05d092fa9f3 Mon Sep 17 00:00:00 2001 From: BobFrankly Date: Wed, 23 Aug 2017 18:44:17 -0700 Subject: [PATCH 3/4] Modernize Windows build instructions Updates to the Windows build instructions, terminology pulled from the current "Visual Studio Community 2017" version, which is the free version of VS at this time. I wrote these as a first timer building Overviewer. I also moved all of the pre-requisites to a bulleted list under a single header. --- docs/building.rst | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/building.rst b/docs/building.rst index f6a5aa5..172d74f 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -36,26 +36,29 @@ Windows Build Instructions -------------------------- First, you'll need a compiler. You can either use Visual Studio, or -cygwin/mingw. The free `Visual Studio Express -`_ is okay. You will want the C++ -version (Microsoft® Visual C++® 2010 Express). Note that the Express version of -Visual Studio will only build 32-bit executables. We currently don't have a -recommended way of building Overviewer on 64-bit Windows using free tools. If you -have bought a copy of Visual Studio, you can use it for 64-bit builds. +cygwin/mingw. The free `Visual Studio Community +`_ is okay. You will need to select the "Desktop Development with C++" WORKLOAD. Microsoft has been changing up the names on this with the "Community" edition of Visual Studio. If nothing else works, just install every Individual Visual C++ component you can find :) Prerequisites ~~~~~~~~~~~~~ -You will need a copy of the `Pillow sources `_. +You will need the following: + +- `Python 2.7 `_ +- A copy of the `Pillow sources `_. +- The Pillow Extension for Python. +- The Numpy Extension for Python. +- The extensions can be installed via:: + + c:\python27\python.exe -m pip -U numpy pillow + Building with Visual Studio ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -For this, you will need an installation of `Python 2.7 `_ along with Pillow and numpy installed in your Python environment. - 1. Get the latest Overviewer source code as per above. -2. From the Start menu, navigate to the 'Microsoft Visual Studio 2010 Express' and open the 'Visual Studio Command Prompt (2010)' shortcut. +2. From the Start menu, navigate to 'Visual Studio 2017' and open the **'Developer Command Prompt for VS 2017'** (*or whatever year*) shortcut. A regular command or powershell prompt will *NOT* work for this. 3. cd to the folder containing the Overviewer source code. 4. Copy Imaging.h and ImPlatform.h from your Pillow sources into the current working directory. 5. First try a build:: @@ -183,4 +186,4 @@ You may need or want to add the line:: PYTHON_VERSION=2.7 -to the file /etc/make.conf, but read the ports documentation to be sure of what this might do to other Python applications on your system. +to the file /etc/make.conf, but read the ports documentation to be sure of what this might do to other Python applications on your system. \ No newline at end of file From 9cf068973de4d096e5f83174f5250ca47497fc57 Mon Sep 17 00:00:00 2001 From: Sylvain Rumeu Date: Wed, 11 Jan 2017 16:50:24 +0100 Subject: [PATCH 4/4] Removing deprecated option in index.html : ?sensor=false --- overviewer_core/data/web_assets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overviewer_core/data/web_assets/index.html b/overviewer_core/data/web_assets/index.html index 3fd2812..16b53d9 100644 --- a/overviewer_core/data/web_assets/index.html +++ b/overviewer_core/data/web_assets/index.html @@ -11,7 +11,7 @@ - +