aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/authserver')
-rw-r--r--src/server/authserver/Authentication/AuthCodes.h2
-rw-r--r--src/server/authserver/CMakeLists.txt118
-rw-r--r--src/server/authserver/Main.cpp21
-rw-r--r--src/server/authserver/Server/AuthSocket.cpp4
-rw-r--r--src/server/authserver/Server/AuthSocket.h2
-rw-r--r--src/server/authserver/Server/RealmSocket.h1
-rw-r--r--src/server/authserver/authserver.conf.dist (renamed from src/server/authserver/trinityrealm.conf.dist)4
-rw-r--r--src/server/authserver/authserver.ico (renamed from src/server/authserver/TrinityRealm.ico)bin136606 -> 136606 bytes
-rw-r--r--src/server/authserver/authserver.rc (renamed from src/server/authserver/TrinityRealm.rc)12
9 files changed, 98 insertions, 66 deletions
diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h
index eb6e4abfb08..802b7b78f1b 100644
--- a/src/server/authserver/Authentication/AuthCodes.h
+++ b/src/server/authserver/Authentication/AuthCodes.h
@@ -80,7 +80,7 @@ enum LoginResult
//3.3.2 build 11403
//3.3.3a build 11723
-#define POST_BC_ACCEPTED_CLIENT_BUILD {11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0}
+#define POST_BC_ACCEPTED_CLIENT_BUILD {12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0}
#define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0}
#define POST_BC_EXP_FLAG 0x2
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index 5a993be5377..82b36c8ab3e 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -1,60 +1,88 @@
-########### next target ###############
-
-SET(trinity-realm_SRCS
-AuthCodes.cpp
-AuthCodes.h
-AuthSocket.cpp
-AuthSocket.h
-Main.cpp
-RealmList.cpp
-RealmList.h
-RealmSocket.h
-RealmSocket.cpp
-RealmAcceptor.h
+# Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+########### authserver ###############
+
+set(authserver_SRCS
+ Authentication/AuthCodes.cpp
+ Realms/RealmList.cpp
+ Server/AuthSocket.cpp
+ Server/RealmSocket.cpp
+ Main.cpp
)
include_directories(
${ACE_INCLUDE_DIR}
+ ${MYSQL_INCLUDE_DIR}
+ ${OPENSSL_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/src/server/shared
${CMAKE_SOURCE_DIR}/src/server/shared/Database
- ${CMAKE_SOURCE_DIR}/src/server/framework
- ${MYSQL_INCLUDE_DIR}
+ ${CMAKE_SOURCE_DIR}/src/server/shared/Packets
+ ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography
+ ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication
+ ${CMAKE_SOURCE_DIR}/src/server/shared/Logging
+ ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
+ ${CMAKE_SOURCE_DIR}/src/server/authserver
+ ${CMAKE_SOURCE_DIR}/src/server/authserver/Authentication
+ ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms
+ ${CMAKE_SOURCE_DIR}/src/server/authserver/Server
)
-SET(trinity-realm_LINK_FLAGS "")
+set(authserver_LINK_FLAGS "")
-add_executable(trinity-realm ${trinity-realm_SRCS})
-add_definitions(
--D_TRINITY_REALM_CONFIG='"${CONF_DIR}/trinityrealm.conf"'
-)
-IF (DO_MYSQL)
- SET(trinity-realm_LINK_FLAGS "-pthread ${trinity-realm_LINK_FLAGS}")
-ENDIF(DO_MYSQL)
-
-IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- SET(trinity-realm_LINK_FLAGS "-framework Carbon ${trinity-realm_LINK_FLAGS}")
-ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-
-SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "${trinity-realm_LINK_FLAGS}")
-
-target_link_libraries(
-trinity-realm
-shared
-trinityframework
-trinitysockets
-trinitydatabase
-trinityauth
-trinityconfig
-zlib
-${SSLLIB}
-${MYSQL_LIBRARIES}
-${OSX_LIBS}
+add_executable(authserver
+ ${authserver_SRCS}
)
-install(TARGETS trinity-realm DESTINATION bin)
+add_dependencies(authserver revision.h)
+
+if( NOT WIN32 )
+ add_definitions(-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/authserver.conf"')
+endif()
+
+if( UNIX )
+ set(authserver_LINK_FLAGS "-pthread ${authserver_LINK_FLAGS}")
+endif()
+
+if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
+ set(authserver_LINK_FLAGS "-framework Carbon ${authserver_LINK_FLAGS}")
+endif()
+set_target_properties(authserver PROPERTIES LINK_FLAGS "${authserver_LINK_FLAGS}")
-########### install files ###############
+if( WIN32 )
+ target_link_libraries(
+ authserver
+ shared
+ trinitydatabase
+ trinityauth
+ trinityconfig
+ ${MYSQL_LIBRARY}
+ ${OPENSSL_LIBRARIES}
+ ${OPENSSL_EXTRA_LIBRARIES}
+ )
+else()
+ target_link_libraries(
+ authserver
+ shared
+ trinitydatabase
+ trinityauth
+ trinityconfig
+ ${MYSQL_LIBRARY}
+ ${OPENSSL_LIBRARIES}
+ ${OSX_LIBS}
+ )
+endif()
-install(FILES trinityrealm.conf.dist DESTINATION etc)
+if( UNIX )
+ install(TARGETS authserver DESTINATION bin)
+ install(FILES authserver.conf.dist DESTINATION etc)
+endif()
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 09bae4908e0..28757e914e3 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -24,8 +24,9 @@
#include "Common.h"
#include "Database/DatabaseEnv.h"
+#include "Database/PreparedStatements.h"
-#include "Config/ConfigEnv.h"
+#include "Configuration/ConfigEnv.h"
#include "Log.h"
#include "SystemConfig.h"
#include "Util.h"
@@ -42,10 +43,10 @@
#include <openssl/crypto.h>
#ifndef _TRINITY_REALM_CONFIG
-# define _TRINITY_REALM_CONFIG "TrinityRealm.conf"
+# define _TRINITY_REALM_CONFIG "authserver.conf"
#endif //_TRINITY_REALM_CONFIG
-#ifdef WIN32
+#ifdef _WIN32
#include "ServiceWin32.h"
char serviceName[] = "TrinityRealm";
char serviceLongName[] = "Trinity realm service";
@@ -92,7 +93,7 @@ void usage(const char *prog)
{
sLog.outString("Usage: \n %s [<options>]\n"
" -c config_file use config_file as configuration file\n\r"
- #ifdef WIN32
+ #ifdef _WIN32
" Running as service functions:\n\r"
" --service run as service\n\r"
" -s install install service\n\r"
@@ -122,7 +123,7 @@ extern int main(int argc, char **argv)
cfg_file = argv[c];
}
- #ifdef WIN32
+ #ifdef _WIN32
////////////
//Services//
////////////
@@ -243,7 +244,7 @@ extern int main(int argc, char **argv)
#endif /* _WIN32 */();
///- Handle affinity for multiple processors and process priority on Windows
- #ifdef WIN32
+ #ifdef _WIN32
{
HANDLE hProcess = GetCurrentProcess();
@@ -313,9 +314,9 @@ extern int main(int argc, char **argv)
{
loopCounter = 0;
sLog.outDetail("Ping MySQL to keep connection alive");
- LoginDatabase.Query("SELECT 1 FROM realmlist LIMIT 1");
+ sPreparedStatement.Query(&LoginDatabase, "auth_ping");
}
-#ifdef WIN32
+#ifdef _WIN32
if (m_ServiceStatus == 0) stopEvent = true;
while (m_ServiceStatus == 2) Sleep(1000);
#endif
@@ -345,6 +346,10 @@ bool StartDB()
return false;
}
LoginDatabase.ThreadStart();
+
+ uint32 count = 0;
+ sPreparedStatement.LoadAuthserver(&LoginDatabase, count);
+ sLog.outString("Loaded %u prepared MySQL statements for auth DB.", count);
return true;
}
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index cc293097977..c33f84a9669 100644
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -25,13 +25,13 @@
#include "Common.h"
#include "Database/DatabaseEnv.h"
#include "ByteBuffer.h"
-#include "Config/ConfigEnv.h"
+#include "Configuration/ConfigEnv.h"
#include "Log.h"
#include "RealmList.h"
#include "AuthSocket.h"
#include "AuthCodes.h"
#include <openssl/md5.h>
-#include "Auth/Sha1.h"
+#include "SHA1.h"
//#include "Util.h" -- for commented utf8ToUpperOnlyLatin
extern DatabaseType LoginDatabase;
diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h
index bfd0fa4fdca..0ad40b6930b 100644
--- a/src/server/authserver/Server/AuthSocket.h
+++ b/src/server/authserver/Server/AuthSocket.h
@@ -26,7 +26,7 @@
#define _AUTHSOCKET_H
#include "Common.h"
-#include "Auth/BigNumber.h"
+#include "BigNumber.h"
#include "RealmSocket.h"
diff --git a/src/server/authserver/Server/RealmSocket.h b/src/server/authserver/Server/RealmSocket.h
index 13be8327533..8749fba9def 100644
--- a/src/server/authserver/Server/RealmSocket.h
+++ b/src/server/authserver/Server/RealmSocket.h
@@ -25,7 +25,6 @@
#ifndef __REALMSOCKET_H__
#define __REALMSOCKET_H__
-#include <ace/Basic_Types.h>
#include <ace/Synch_Traits.h>
#include <ace/Svc_Handler.h>
#include <ace/SOCK_Stream.h>
diff --git a/src/server/authserver/trinityrealm.conf.dist b/src/server/authserver/authserver.conf.dist
index e98b9386878..33e2db43df3 100644
--- a/src/server/authserver/trinityrealm.conf.dist
+++ b/src/server/authserver/authserver.conf.dist
@@ -125,14 +125,14 @@
#
###############################################################################
-LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;realmd"
+LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
LogsDir = ""
MaxPingTime = 30
RealmServerPort = 3724
BindIP = "0.0.0.0"
PidFile = ""
LogLevel = 0
-LogFile = "realmd.log"
+LogFile = "auth.log"
LogTimestamp = 0
LogFileLevel = 0
LogColors = ""
diff --git a/src/server/authserver/TrinityRealm.ico b/src/server/authserver/authserver.ico
index da318f48a8c..da318f48a8c 100644
--- a/src/server/authserver/TrinityRealm.ico
+++ b/src/server/authserver/authserver.ico
Binary files differ
diff --git a/src/server/authserver/TrinityRealm.rc b/src/server/authserver/authserver.rc
index dfc548305fd..74ce7f43858 100644
--- a/src/server/authserver/TrinityRealm.rc
+++ b/src/server/authserver/authserver.rc
@@ -36,7 +36,7 @@
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-IDI_APPICON ICON "TrinityRealm.ico"
+IDI_APPICON ICON "authserver.ico"
/////////////////////////////////////////////////////////////////////////////
// Neutre (Par défaut système) resources
@@ -69,12 +69,12 @@ BEGIN
BEGIN
BLOCK "080004b0"
BEGIN
- VALUE "FileDescription", "TrinityRealm"
+ VALUE "FileDescription", "authserver"
VALUE "FileVersion", STRFILEVER
- VALUE "InternalName", "TrinityRealm"
- VALUE "LegalCopyright", "Copyright (C) 2008-2009"
- VALUE "OriginalFilename", "TrinityRealm.exe"
- VALUE "ProductName", "TrinityRealm"
+ VALUE "InternalName", "authserver"
+ VALUE "LegalCopyright", "Copyright (C) 2008-2010"
+ VALUE "OriginalFilename", "authserver.exe"
+ VALUE "ProductName", "authserver"
VALUE "ProductVersion", STRPRODUCTVER
END
END