summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-07 18:15:23 +0100
committerMattes D <github@xoft.cz>2014-12-07 18:15:23 +0100
commit8ad1afcc1b98c03bd77b0d85236643ba04795d38 (patch)
treee340889a2d505f10fd45a80f7b951f3165d6294a /Tools
parentcEvent: Changed chrono duration resolution. (diff)
parentFixed format warning. (diff)
downloadcuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar
cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.gz
cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.bz2
cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.lz
cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.xz
cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.tar.zst
cuberite-8ad1afcc1b98c03bd77b0d85236643ba04795d38.zip
Diffstat (limited to 'Tools')
-rw-r--r--Tools/AnvilStats/CMakeLists.txt2
-rw-r--r--Tools/MCADefrag/CMakeLists.txt11
-rw-r--r--Tools/ProtoProxy/CMakeLists.txt10
-rw-r--r--Tools/ProtoProxy/Connection.cpp5
-rw-r--r--Tools/ProtoProxy/Connection.h4
-rw-r--r--Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro19
6 files changed, 38 insertions, 13 deletions
diff --git a/Tools/AnvilStats/CMakeLists.txt b/Tools/AnvilStats/CMakeLists.txt
index 557a4c17a..688fbe493 100644
--- a/Tools/AnvilStats/CMakeLists.txt
+++ b/Tools/AnvilStats/CMakeLists.txt
@@ -53,7 +53,6 @@ set(SHARED_OSS_SRC
../../src/OSSupport/File.cpp
../../src/OSSupport/GZipFile.cpp
../../src/OSSupport/IsThread.cpp
- ../../src/OSSupport/Timer.cpp
)
set(SHARED_OSS_HDR
@@ -62,7 +61,6 @@ set(SHARED_OSS_HDR
../../src/OSSupport/File.h
../../src/OSSupport/GZipFile.h
../../src/OSSupport/IsThread.h
- ../../src/OSSupport/Timer.h
)
flatten_files(SHARED_SRC)
diff --git a/Tools/MCADefrag/CMakeLists.txt b/Tools/MCADefrag/CMakeLists.txt
index 42b42018b..82e048671 100644
--- a/Tools/MCADefrag/CMakeLists.txt
+++ b/Tools/MCADefrag/CMakeLists.txt
@@ -46,6 +46,7 @@ set(SHARED_HDR
../../src/ByteBuffer.h
../../src/StringUtils.h
)
+
flatten_files(SHARED_SRC)
flatten_files(SHARED_HDR)
source_group("Shared" FILES ${SHARED_SRC} ${SHARED_HDR})
@@ -54,15 +55,21 @@ set(SHARED_OSS_SRC
../../src/OSSupport/CriticalSection.cpp
../../src/OSSupport/File.cpp
../../src/OSSupport/IsThread.cpp
- ../../src/OSSupport/Timer.cpp
+ ../../src/OSSupport/StackTrace.cpp
)
+
set(SHARED_OSS_HDR
../../src/OSSupport/CriticalSection.h
../../src/OSSupport/File.h
../../src/OSSupport/IsThread.h
- ../../src/OSSupport/Timer.h
+ ../../src/OSSupport/StackTrace.h
)
+if(WIN32)
+ list (APPEND SHARED_OSS_SRC ../../src/StackWalker.cpp)
+ list (APPEND SHARED_OSS_HDR ../../src/StackWalker.h)
+endif()
+
flatten_files(SHARED_OSS_SRC)
flatten_files(SHARED_OSS_HDR)
diff --git a/Tools/ProtoProxy/CMakeLists.txt b/Tools/ProtoProxy/CMakeLists.txt
index bc3923d90..cca0c1b8b 100644
--- a/Tools/ProtoProxy/CMakeLists.txt
+++ b/Tools/ProtoProxy/CMakeLists.txt
@@ -57,14 +57,20 @@ set(SHARED_OSS_SRC
../../src/OSSupport/CriticalSection.cpp
../../src/OSSupport/File.cpp
../../src/OSSupport/IsThread.cpp
- ../../src/OSSupport/Timer.cpp
+ ../../src/OSSupport/StackTrace.cpp
)
set(SHARED_OSS_HDR
../../src/OSSupport/CriticalSection.h
../../src/OSSupport/File.h
../../src/OSSupport/IsThread.h
- ../../src/OSSupport/Timer.h
+ ../../src/OSSupport/StackTrace.h
)
+
+if(WIN32)
+ list (APPEND SHARED_OSS_SRC ../../src/StackWalker.cpp)
+ list (APPEND SHARED_OSS_HDR ../../src/StackWalker.h)
+endif()
+
flatten_files(SHARED_SRC)
flatten_files(SHARED_HDR)
flatten_files(SHARED_OSS_SRC)
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp
index eaf4fab02..fb2d40e5b 100644
--- a/Tools/ProtoProxy/Connection.cpp
+++ b/Tools/ProtoProxy/Connection.cpp
@@ -189,7 +189,7 @@ cConnection::cConnection(SOCKET a_ClientSocket, cServer & a_Server) :
m_Server(a_Server),
m_ClientSocket(a_ClientSocket),
m_ServerSocket(-1),
- m_BeginTick(m_Timer.GetNowTime()),
+ m_BeginTick(std::chrono::steady_clock::now()),
m_ClientState(csUnencrypted),
m_ServerState(csUnencrypted),
m_Nonce(0),
@@ -436,7 +436,8 @@ bool cConnection::RelayFromClient(void)
double cConnection::GetRelativeTime(void)
{
- return (double)(m_Timer.GetNowTime() - m_BeginTick) / 1000;
+ Int64 msec = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - m_BeginTick).count();
+ return static_cast<double>(msec) / 1000;
}
diff --git a/Tools/ProtoProxy/Connection.h b/Tools/ProtoProxy/Connection.h
index 1fc9536de..c79273f8a 100644
--- a/Tools/ProtoProxy/Connection.h
+++ b/Tools/ProtoProxy/Connection.h
@@ -10,7 +10,6 @@
#pragma once
#include "ByteBuffer.h"
-#include "OSSupport/Timer.h"
#include "PolarSSL++/AesCfb128Decryptor.h"
#include "PolarSSL++/AesCfb128Encryptor.h"
@@ -37,8 +36,7 @@ class cConnection
SOCKET m_ClientSocket;
SOCKET m_ServerSocket;
- cTimer m_Timer;
- long long m_BeginTick; // Tick when the relative time was first retrieved (used for GetRelativeTime())
+ std::chrono::steady_clock::time_point m_BeginTick; // Tick when the relative time was first retrieved (used for GetRelativeTime())
enum eConnectionState
{
diff --git a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro
index 9522491a8..cccee1305 100644
--- a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro
+++ b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro
@@ -17,7 +17,7 @@ SOURCES += \
BiomeView.cpp \
../../src/Generating/BioGen.cpp \
../../src/VoronoiMap.cpp \
- ../../src/Noise.cpp \
+ ../../src/Noise/Noise.cpp \
../../src/StringUtils.cpp \
../../src/LoggerListeners.cpp \
../../src/Logger.cpp \
@@ -25,7 +25,9 @@ SOURCES += \
../../src/OSSupport/File.cpp \
../../src/OSSupport/CriticalSection.cpp \
../../src/OSSupport/IsThread.cpp \
+ ../../src/OSSupport/StackTrace.cpp \
../../src/BiomeDef.cpp \
+ ../../src/StackWalker.cpp \
../../src/StringCompression.cpp \
../../src/WorldStorage/FastNBT.cpp \
../../lib/zlib/adler32.c \
@@ -62,7 +64,7 @@ HEADERS += \
../../src/Generating/IntGen.h \
../../src/Generating/ProtIntGen.h \
../../src/VoronoiMap.h \
- ../../src/Noise.h \
+ ../../src/Noise/Noise.h \
../../src/StringUtils.h \
../../src/LoggerListeners.h \
../../src/Logger.h \
@@ -70,7 +72,9 @@ HEADERS += \
../../src/OSSupport/File.h \
../../src/OSSupport/CriticalSection.h \
../../src/OSSupport/IsThread.h \
+ ../../src/OSSupport/StackTrace.h \
../../src/BiomeDef.h \
+ ../../src/StackWalker.h \
../../src/StringCompression.h \
../../src/WorldStorage/FastNBT.h \
../../lib/zlib/crc32.h \
@@ -107,4 +111,15 @@ CONFIG += C++11
OTHER_FILES +=
+win* {
+ # Add the advapi32 library for windows compiles; needed for the StackWalker:
+ LIBS += advapi32.lib
+
+ # StackWalker doesn't like how Qt inconsistently defines only UNICODE, but not _UNICODE:
+ DEFINES -= UNICODE
+}
+
+
+
+