aboutsummaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/Makefile.am16
-rw-r--r--src/shared/SystemConfig.h22
-rw-r--r--src/shared/SystemConfig.h.in22
-rw-r--r--src/shared/WheatyExceptionReport.cpp33
-rw-r--r--src/shared/revision.h.in4
5 files changed, 77 insertions, 20 deletions
diff --git a/src/shared/Makefile.am b/src/shared/Makefile.am
index 54aef015e46..3a86f148521 100644
--- a/src/shared/Makefile.am
+++ b/src/shared/Makefile.am
@@ -104,7 +104,21 @@ $(srcdir)/Database/SqlDelayThread.h \
$(srcdir)/Database/SqlOperations.cpp \
$(srcdir)/Database/SqlOperations.h \
$(srcdir)/Database/dbcfile.cpp \
-$(srcdir)/Database/dbcfile.h
+$(srcdir)/Database/dbcfile.h \
+$(srcdir)/revision.h
+
+
+# Get HG revision
+REVISION_FILE = revision.h
+
+BUILT_SOURCES = $(REVISION_FILE)
+CLEANFILES = $(REVISION_FILE)
+
+FORCE:
+
+$(REVISION_FILE) : $(top_builddir)/src/tools/genrevision/genrevision FORCE
+ $(top_builddir)/src/tools/genrevision/genrevision $(top_srcdir)
+ cp $(top_builddir)/src/shared/revision.h $(top_srcdir)/src/shared
## Additional files to include when running 'make dist'
# Disabled packet logger
diff --git a/src/shared/SystemConfig.h b/src/shared/SystemConfig.h
index 262aa9e6355..aeb38891c11 100644
--- a/src/shared/SystemConfig.h
+++ b/src/shared/SystemConfig.h
@@ -25,9 +25,27 @@
#define TRINITY_SYSTEMCONFIG_H
#include "Platform/Define.h"
+#include "revision.h" //-----here u are ------ _REVISION is the magic key
-// THIS IS TEMP :)
-#define _FULLVERSION "Trinity"
+
+#define _PACKAGENAME "TrinityCore "
+#define _CODENAME "YUME"
+
+#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
+# define _ENDIAN_STRING "big-endian"
+#else
+# define _ENDIAN_STRING "little-endian"
+#endif
+
+#if PLATFORM == PLATFORM_WINDOWS
+# ifdef _WIN64
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Win64," _ENDIAN_STRING ")"
+# else
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Win32," _ENDIAN_STRING ")"
+# endif
+#else
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Unix," _ENDIAN_STRING ")"
+#endif
#define DEFAULT_PLAYER_LIMIT 100
#define DEFAULT_WORLDSERVER_PORT 8085 //8129
diff --git a/src/shared/SystemConfig.h.in b/src/shared/SystemConfig.h.in
index 262aa9e6355..aeb38891c11 100644
--- a/src/shared/SystemConfig.h.in
+++ b/src/shared/SystemConfig.h.in
@@ -25,9 +25,27 @@
#define TRINITY_SYSTEMCONFIG_H
#include "Platform/Define.h"
+#include "revision.h" //-----here u are ------ _REVISION is the magic key
-// THIS IS TEMP :)
-#define _FULLVERSION "Trinity"
+
+#define _PACKAGENAME "TrinityCore "
+#define _CODENAME "YUME"
+
+#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
+# define _ENDIAN_STRING "big-endian"
+#else
+# define _ENDIAN_STRING "little-endian"
+#endif
+
+#if PLATFORM == PLATFORM_WINDOWS
+# ifdef _WIN64
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Win64," _ENDIAN_STRING ")"
+# else
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Win32," _ENDIAN_STRING ")"
+# endif
+#else
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Unix," _ENDIAN_STRING ")"
+#endif
#define DEFAULT_PLAYER_LIMIT 100
#define DEFAULT_WORLDSERVER_PORT 8085 //8129
diff --git a/src/shared/WheatyExceptionReport.cpp b/src/shared/WheatyExceptionReport.cpp
index 6a4276cca0f..5aa4a19d583 100644
--- a/src/shared/WheatyExceptionReport.cpp
+++ b/src/shared/WheatyExceptionReport.cpp
@@ -14,6 +14,8 @@
#define _NO_CVCONST_H
#include <dbghelp.h>
#include "WheatyExceptionReport.h"
+#include "SystemConfig.h"
+#include "revision.h"
#define CrashFolder _T("Crashes")
//#pragma comment(linker, "/defaultlib:dbghelp.lib")
@@ -329,22 +331,22 @@ void WheatyExceptionReport::PrintSystemInfo()
//===========================================================================
void WheatyExceptionReport::printTracesForAllThreads()
{
- HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
- THREADENTRY32 te32;
-
+ HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
+ THREADENTRY32 te32;
+
DWORD dwOwnerPID = GetCurrentProcessId();
m_hProcess = GetCurrentProcess();
- // Take a snapshot of all running threads
- hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
- if( hThreadSnap == INVALID_HANDLE_VALUE )
- return;
-
- // Fill in the size of the structure before using it.
- te32.dwSize = sizeof(THREADENTRY32 );
-
+ // Take a snapshot of all running threads
+ hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
+ if( hThreadSnap == INVALID_HANDLE_VALUE )
+ return;
+
+ // Fill in the size of the structure before using it.
+ te32.dwSize = sizeof(THREADENTRY32 );
+
// Retrieve information about the first thread,
// and exit if unsuccessful
- if( !Thread32First( hThreadSnap, &te32 ) )
+ if( !Thread32First( hThreadSnap, &te32 ) )
{
CloseHandle( hThreadSnap ); // Must clean up the
// snapshot object!
@@ -354,8 +356,8 @@ void WheatyExceptionReport::printTracesForAllThreads()
// Now walk the thread list of the system,
// and display information about each thread
// associated with the specified process
- do
- {
+ do
+ {
if( te32.th32OwnerProcessID == dwOwnerPID )
{
CONTEXT context;
@@ -367,7 +369,7 @@ void WheatyExceptionReport::printTracesForAllThreads()
}
CloseHandle(threadHandle);
}
- } while( Thread32Next(hThreadSnap, &te32 ) );
+ } while( Thread32Next(hThreadSnap, &te32 ) );
// Don't forget to clean up the snapshot object.
CloseHandle( hThreadSnap );
@@ -385,6 +387,7 @@ PEXCEPTION_POINTERS pExceptionInfo )
GetLocalTime(&systime);
// Start out with a banner
+ _tprintf(_T("Revision: %s\r\n"), _FULLVERSION);
_tprintf(_T("Date %u:%u:%u. Time %u:%u \r\n"), systime.wDay, systime.wMonth, systime.wYear, systime.wHour, systime.wMinute);
PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;
diff --git a/src/shared/revision.h.in b/src/shared/revision.h.in
new file mode 100644
index 00000000000..a84170529eb
--- /dev/null
+++ b/src/shared/revision.h.in
@@ -0,0 +1,4 @@
+#ifndef __SVN_REVISION_H__
+#define __SVN_REVISION_H__
+ #define _REVISION "794" //change this to your current revision
+#endif // __SVN_REVISION_H__