diff options
Diffstat (limited to 'src/trinitycore')
| -rw-r--r-- | src/trinitycore/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | src/trinitycore/CliRunnable.cpp | 70 | ||||
| -rw-r--r-- | src/trinitycore/CliRunnable.h | 7 | ||||
| -rw-r--r-- | src/trinitycore/Main.cpp | 32 | ||||
| -rw-r--r-- | src/trinitycore/Makefile.am | 67 | ||||
| -rw-r--r-- | src/trinitycore/Master.cpp | 231 | ||||
| -rw-r--r-- | src/trinitycore/Master.h | 5 | ||||
| -rw-r--r-- | src/trinitycore/RASocket.cpp | 34 | ||||
| -rw-r--r-- | src/trinitycore/RASocket.h | 8 | ||||
| -rw-r--r-- | src/trinitycore/TrinityCore.rc | 2 | ||||
| -rw-r--r-- | src/trinitycore/WorldRunnable.cpp | 41 | ||||
| -rw-r--r-- | src/trinitycore/WorldRunnable.h | 7 | ||||
| -rw-r--r-- | src/trinitycore/resource.h | 1 | ||||
| -rw-r--r-- | src/trinitycore/run-mangosd | 2 | ||||
| -rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 439 |
15 files changed, 649 insertions, 313 deletions
diff --git a/src/trinitycore/CMakeLists.txt b/src/trinitycore/CMakeLists.txt index 2c7c4544577..7cd012d9f45 100644 --- a/src/trinitycore/CMakeLists.txt +++ b/src/trinitycore/CMakeLists.txt @@ -2,14 +2,14 @@ ########### next target ############### SET(trinity-core_SRCS -CliRunnable.cpp -CliRunnable.h -Main.cpp -Master.cpp -Master.h -RASocket.cpp -RASocket.h -WorldRunnable.cpp +CliRunnable.cpp +CliRunnable.h +Main.cpp +Master.cpp +Master.h +RASocket.cpp +RASocket.h +WorldRunnable.cpp WorldRunnable.h ) diff --git a/src/trinitycore/CliRunnable.cpp b/src/trinitycore/CliRunnable.cpp index 839358e7034..1da2a30b4f7 100644 --- a/src/trinitycore/CliRunnable.cpp +++ b/src/trinitycore/CliRunnable.cpp @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,19 +23,20 @@ /// \file #include "Common.h" -#include "Language.h" -#include "Log.h" -#include "World.h" -#include "ScriptCalls.h" #include "ObjectMgr.h" +#include "World.h" #include "WorldSession.h" #include "Config/ConfigEnv.h" -#include "Util.h" + #include "AccountMgr.h" +#include "Chat.h" #include "CliRunnable.h" +#include "Language.h" +#include "Log.h" #include "MapManager.h" #include "Player.h" -#include "Chat.h" +#include "ScriptCalls.h" +#include "Util.h" void utf8print(const char* str) { @@ -66,7 +67,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args) return false; std::string account_name = account_name_str; - if(!AccountMgr::normilizeString(account_name)) + if(!AccountMgr::normalizeString(account_name)) { PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); SetSentErrorMessage(true); @@ -82,19 +83,10 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args) } /// Commands not recommended call from chat, but support anyway - if(m_session) - { - uint32 targetSecurity = accmgr.GetSecurity(account_id); - - /// can delete only for account with less security - /// This is also reject self apply in fact - if (targetSecurity >= m_session->GetSecurity()) - { - SendSysMessage (LANG_YOURS_SECURITY_IS_LOW); - SetSentErrorMessage (true); - return false; - } - } + /// can delete only for account with less security + /// This is also reject self apply in fact + if(HasLowerSecurityAccount (NULL,account_id,true)) + return false; AccountOpResult result = accmgr.DeleteAccount(account_id); switch(result) @@ -164,7 +156,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args) } /// Exit the realm -bool ChatHandler::HandleServerExitCommand(const char* args) +bool ChatHandler::HandleServerExitCommand(const char* /*args*/) { SendSysMessage(LANG_COMMAND_EXIT); World::StopNow(SHUTDOWN_EXIT_CODE); @@ -172,17 +164,20 @@ bool ChatHandler::HandleServerExitCommand(const char* args) } /// Display info on users currently in the realm -bool ChatHandler::HandleAccountOnlineListCommand(const char* args) +bool ChatHandler::HandleAccountOnlineListCommand(const char* /*args*/) { ///- Get the list of accounts ID logged to the realm QueryResult *resultDB = CharacterDatabase.Query("SELECT name,account FROM characters WHERE online > 0"); if (!resultDB) + { + SendSysMessage(LANG_ACCOUNT_LIST_EMPTY); return true; + } ///- Display the list of account/characters online - SendSysMessage("====================================================================="); + SendSysMessage(LANG_ACCOUNT_LIST_BAR); SendSysMessage(LANG_ACCOUNT_LIST_HEADER); - SendSysMessage("====================================================================="); + SendSysMessage(LANG_ACCOUNT_LIST_BAR); ///- Circle through accounts do @@ -199,7 +194,7 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* args) if(resultLogin) { Field *fieldsLogin = resultLogin->Fetch(); - PSendSysMessage("|%15s| %20s | %15s |%4d|%5d|", + PSendSysMessage(LANG_ACCOUNT_LIST_LINE, fieldsLogin[0].GetString(),name.c_str(),fieldsLogin[1].GetString(),fieldsLogin[2].GetUInt32(),fieldsLogin[3].GetUInt32()); delete resultLogin; @@ -211,7 +206,7 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* args) delete resultDB; - SendSysMessage("====================================================================="); + SendSysMessage(LANG_ACCOUNT_LIST_BAR); return true; } @@ -227,7 +222,7 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args) if(!szAcc || !szPassword) return false; - // normilized in accmgr.CreateAccount + // normalized in accmgr.CreateAccount std::string account_name = szAcc; std::string password = szPassword; @@ -259,6 +254,20 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args) } /// Set the level of logging +bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args) +{ + if(!*args) + return false; + + char *NewLevel = strtok((char*)args, " "); + if (!NewLevel) + return false; + + sLog.SetLogFileLevel(NewLevel); + return true; +} + +/// Set the level of logging bool ChatHandler::HandleServerSetLogLevelCommand(const char *args) { if(!*args) @@ -318,7 +327,7 @@ void CliRunnable::run() char commandbuf[256]; ///- Display the list of available CLI functions then beep - sLog.outString(); + sLog.outString(""); if(sConfig.GetBoolDefault("BeepAtStart", true)) printf("\a"); // \a = Alert @@ -373,4 +382,3 @@ void CliRunnable::run() ///- End the database thread WorldDatabase.ThreadEnd(); // free mySQL thread resources } - diff --git a/src/trinitycore/CliRunnable.h b/src/trinitycore/CliRunnable.h index ea60ef695bc..cf745bbb195 100644 --- a/src/trinitycore/CliRunnable.h +++ b/src/trinitycore/CliRunnable.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,11 +26,10 @@ #define __CLIRUNNABLE_H /// Command Line Interface handling thread -class CliRunnable : public ZThread::Runnable +class CliRunnable : public ACE_Based::Runnable { public: void run(); }; #endif /// @} - diff --git a/src/trinitycore/Main.cpp b/src/trinitycore/Main.cpp index 4be314d75f3..eb51c770896 100644 --- a/src/trinitycore/Main.cpp +++ b/src/trinitycore/Main.cpp @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,28 +21,31 @@ /// \addtogroup Trinityd Trinity Daemon /// @{ /// \file -#include "SystemConfig.h" -#include "revision.h" + +#include <openssl/opensslv.h> +#include <openssl/crypto.h> #include "Common.h" #include "Database/DatabaseEnv.h" #include "Config/ConfigEnv.h" + #include "Log.h" #include "Master.h" + #ifndef _TRINITY_CORE_CONFIG -# define _TRINITY_CORE_CONFIG "trinitycore.conf" +# define _TRINITY_CORE_CONFIG "TrinityCore.conf" #endif //_TRINITY_CORE_CONFIG // Format is YYYYMMDDRR where RR is the change in the conf file // for that day. #ifndef _TRINITY_CORE_CONFVER -# define _TRINITY_CORE_CONFVER 2008022901 +# define _TRINITY_CORE_CONFVER 2009032201 #endif //_TRINITY_CORE_CONFVER #ifdef WIN32 #include "ServiceWin32.h" -char serviceName[] = "Trinityd"; +char serviceName[] = "TrinityCore"; char serviceLongName[] = "Trinity core service"; char serviceDescription[] = "Massive Network Game Object Server"; /* @@ -64,7 +67,6 @@ uint32 realmID; ///< Id of the realm void usage(const char *prog) { sLog.outString("Usage: \n %s [<options>]\n" - " --version print version and exit\n\r" " -c config_file use config_file as configuration file\n\r" #ifdef WIN32 " Running as service functions:\n\r" @@ -95,12 +97,6 @@ extern int main(int argc, char **argv) cfg_file = argv[c]; } - if( strcmp(argv[c],"--version") == 0) - { - printf("%s\n", _FULLVERSION); - return 0; - } - #ifdef WIN32 //////////// //Services// @@ -161,6 +157,13 @@ extern int main(int argc, char **argv) while (pause > clock()) {} } + sLog.outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + if (SSLeay() < 0x009080bfL ) + { + sLog.outDetail("WARNING: Outdated version of OpenSSL lib. Logins to server impossible!"); + sLog.outDetail("WARNING: Minimal required version [OpenSSL 0.9.8k]"); + } + ///- and run the 'Master' /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? return sMaster.Run(); @@ -172,4 +175,3 @@ extern int main(int argc, char **argv) } /// @} - diff --git a/src/trinitycore/Makefile.am b/src/trinitycore/Makefile.am new file mode 100644 index 00000000000..f0ac432dab1 --- /dev/null +++ b/src/trinitycore/Makefile.am @@ -0,0 +1,67 @@ +# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> +# +# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +## Process this file with automake to produce Makefile.in + +## CPP flags for includes, defines, etc. +AM_CPPFLAGS = $(TRINI_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir)/../game -I$(srcdir) -DSYSCONFDIR=\"$(sysconfdir)/\" + +## Build world list daemon as standalone program +bin_PROGRAMS = trinity-worldd +trinity_worldd_SOURCES = \ + CliRunnable.cpp \ + CliRunnable.h \ + Main.cpp \ + Master.cpp \ + Master.h \ + RASocket.cpp \ + RASocket.h \ + WorldRunnable.cpp \ + WorldRunnable.h + +## Link world daemon against the shared library +<<<<<<< HEAD:src/mangosd/Makefile.am +trinity_worldd_LDADD = ../bindings/scripts/libtrinityscript.la ../game/libmangosgame.a ../shared/Database/libmangosdatabase.a ../shared/Config/libmangosconfig.a ../shared/Auth/libmangosauth.a ../shared/libmangosshared.a ../shared/vmap/libmangosvmaps.a ../framework/libmangosframework.a ../../dep/src/sockets/libmangossockets.a ../../dep/src/zthread/libZThread.la ../../dep/src/g3dlite/libg3dlite.a +trinity_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/zthread -L../../dep/src/g3dlite -L../bindings/scripts/ -L$(libdir) $(TRINI_LIBS) -export-dynamic +======= +mangos_worldd_LDADD = ../bindings/universal/libmangosscript.la ../game/libmangosgame.a ../shared/Database/libmangosdatabase.a ../shared/Config/libmangosconfig.a ../shared/Auth/libmangosauth.a ../shared/libmangosshared.a ../shared/vmap/libmangosvmaps.a ../framework/libmangosframework.a ../../dep/src/sockets/libmangossockets.a ../../dep/src/g3dlite/libg3dlite.a +mangos_worldd_LDFLAGS = -L../../dep/src/sockets -L../../dep/src/g3dlite -L../bindings/universal/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic +>>>>>>> 00c7d15a78b1dcdbf888b768c55424183b2231e4:src/mangosd/Makefile.am + +## Additional files to include when running 'make dist' +# Include world daemon configuration +EXTRA_DIST = \ + mangosd.conf.dist + +## Additional files to install +sysconf_DATA = \ + mangosd.conf.dist + +install-data-hook: + @list='$(sysconf_DATA)'; for p in $$list; do \ + dest=`echo $$p | sed -e s/.dist//`; \ + if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \ + echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \ + else \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest; \ + fi; \ + done + +clean-local: + rm -f $(sysconf_DATA) diff --git a/src/trinitycore/Master.cpp b/src/trinitycore/Master.cpp index 8fd5af08800..4d7eca8f04e 100644 --- a/src/trinitycore/Master.cpp +++ b/src/trinitycore/Master.cpp @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,21 +24,22 @@ #include <ace/OS_NS_signal.h> -#include "WorldSocketMgr.h" #include "Common.h" -#include "Master.h" -#include "WorldSocket.h" -#include "WorldRunnable.h" -#include "World.h" -#include "Log.h" -#include "Timer.h" -#include "Policies/SingletonImp.h" #include "SystemConfig.h" +#include "World.h" +#include "WorldRunnable.h" +#include "WorldSocket.h" +#include "WorldSocketMgr.h" #include "Config/ConfigEnv.h" #include "Database/DatabaseEnv.h" +#include "Policies/SingletonImp.h" + #include "CliRunnable.h" +#include "Log.h" +#include "Master.h" #include "RASocket.h" #include "ScriptCalls.h" +#include "Timer.h" #include "Util.h" #include "sockets/TcpSocket.h" @@ -60,7 +61,7 @@ INSTANTIATE_SINGLETON_1( Master ); volatile uint32 Master::m_masterLoopCounter = 0; -class FreezeDetectorRunnable : public ZThread::Runnable +class FreezeDetectorRunnable : public ACE_Based::Runnable { public: FreezeDetectorRunnable() { _delaytime = 0; } @@ -79,7 +80,7 @@ public: w_lastchange = 0; while(!World::IsStopped()) { - ZThread::Thread::sleep(1000); + ACE_Based::Thread::Sleep(1000); uint32 curtime = getMSTime(); //DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter); @@ -115,75 +116,77 @@ public: } }; -class RARunnable : public ZThread::Runnable +class RARunnable : public ACE_Based::Runnable { public: - uint32 numLoops, loopCounter; - - RARunnable () - { - uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME); - numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime)); - loopCounter = 0; - } - - void - checkping () - { - // ping if need - if ((++loopCounter) == numLoops) - { + uint32 numLoops, loopCounter; + + RARunnable () + { + uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME); + numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime)); loopCounter = 0; - sLog.outDetail ("Ping MySQL to keep connection alive"); - delete WorldDatabase.Query ("SELECT 1 FROM command LIMIT 1"); - delete LoginDatabase.Query ("SELECT 1 FROM realmlist LIMIT 1"); - delete CharacterDatabase.Query ("SELECT 1 FROM bugreport LIMIT 1"); - } - } - - void - run (void) - { - SocketHandler h; - - // Launch the RA listener socket - ListenSocket<RASocket> RAListenSocket (h); - bool usera = sConfig.GetBoolDefault ("Ra.Enable", false); - - if (usera) - { - port_t raport = sConfig.GetIntDefault ("Ra.Port", 3443); - std::string stringip = sConfig.GetStringDefault ("Ra.IP", "0.0.0.0"); - ipaddr_t raip; - if (!Utility::u2ip (stringip, raip)) - sLog.outError ("Trinity RA can not bind to ip %s", stringip.c_str ()); - else if (RAListenSocket.Bind (raip, raport)) - sLog.outError ("Trinity RA can not bind to port %d on %s", raport, stringip.c_str ()); - else - { - h.Add (&RAListenSocket); + } + + void checkping () + { + // ping if need + if ((++loopCounter) == numLoops) + { + loopCounter = 0; + sLog.outDetail ("Ping MySQL to keep connection alive"); + delete WorldDatabase.Query ("SELECT 1 FROM command LIMIT 1"); + delete LoginDatabase.Query ("SELECT 1 FROM realmlist LIMIT 1"); + delete CharacterDatabase.Query ("SELECT 1 FROM bugreport LIMIT 1"); + } + } + + void run () + { + SocketHandler h; + + // Launch the RA listener socket + ListenSocket<RASocket> RAListenSocket (h); + bool usera = sConfig.GetBoolDefault ("Ra.Enable", false); - sLog.outString ("Starting Remote access listner on port %d on %s", raport, stringip.c_str ()); - } - } + if (usera) + { + port_t raport = sConfig.GetIntDefault ("Ra.Port", 3443); + std::string stringip = sConfig.GetStringDefault ("Ra.IP", "0.0.0.0"); + ipaddr_t raip; + if (!Utility::u2ip (stringip, raip)) + sLog.outError ("MaNGOS RA can not bind to ip %s", stringip.c_str ()); + else if (RAListenSocket.Bind (raip, raport)) + sLog.outError ("MaNGOS RA can not bind to port %d on %s", raport, stringip.c_str ()); + else + { + h.Add (&RAListenSocket); + + sLog.outString ("Starting Remote access listner on port %d on %s", raport, stringip.c_str ()); + } + } - // Socket Selet time is in microseconds , not miliseconds!! - uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME); + // Socket Selet time is in microseconds , not miliseconds!! + uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME); - // if use ra spend time waiting for io, if not use ra ,just sleep - if (usera) - while (!World::IsStopped()) + // if use ra spend time waiting for io, if not use ra ,just sleep + if (usera) { - h.Select (0, socketSelecttime); - checkping (); + while (!World::IsStopped()) + { + h.Select (0, socketSelecttime); + checkping (); + } } - else - while (!World::IsStopped()) + else { - ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000)); - checkping (); + while (!World::IsStopped()) + { + ACE_Based::Thread::Sleep (static_cast<unsigned long> (socketSelecttime / 1000)); + checkping (); + } } - } + } }; Master::Master() @@ -200,15 +203,15 @@ int Master::Run() sLog.outString( "%s (core-daemon)", _FULLVERSION ); sLog.outString( "<Ctrl-C> to stop.\n" ); - sLog.outTitle( " ______ __"); - sLog.outTitle( "/\\__ _\\ __ __/\\ \\__"); - sLog.outTitle( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __"); - sLog.outTitle( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\"); - sLog.outTitle( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\"); - sLog.outTitle( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\"); - sLog.outTitle( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\"); - sLog.outTitle( " C O R E /\\___/"); - sLog.outTitle( "http://TrinityCore.org \\/__/\n"); + sLog.outString( " ______ __"); + sLog.outString( "/\\__ _\\ __ __/\\ \\__"); + sLog.outString( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __"); + sLog.outString( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\"); + sLog.outString( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\"); + sLog.outString( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\"); + sLog.outString( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\"); + sLog.outString( " C O R E /\\___/"); + sLog.outString( "http://TrinityCore.org \\/__/\n"); /// worldd PID file creation std::string pidfile = sConfig.GetStringDefault("PidFile", ""); @@ -235,8 +238,8 @@ int Master::Run() _HookSignals(); ///- Launch WorldRunnable thread - ZThread::Thread t(new WorldRunnable); - t.setPriority ((ZThread::Priority )2); + ACE_Based::Thread t(*new WorldRunnable); + t.setPriority ((ACE_Based::Priority )2); // set server online LoginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0 WHERE id = '%d'",realmID); @@ -248,10 +251,10 @@ int Master::Run() #endif { ///- Launch CliRunnable thread - ZThread::Thread td1(new CliRunnable); + ACE_Based::Thread td1(*new CliRunnable); } - ZThread::Thread td2(new RARunnable); + ACE_Based::Thread td2(*new RARunnable); ///- Handle affinity for multiple processors and process priority on Windows #ifdef WIN32 @@ -280,7 +283,7 @@ int Master::Run() sLog.outError("Can't set used processors (hex): %x",curAff); } } - sLog.outString(); + sLog.outString(""); } bool Prio = sConfig.GetBoolDefault("ProcessPriority", false); @@ -292,7 +295,7 @@ int Master::Run() sLog.outString("TrinityCore process priority class set to HIGH"); else sLog.outError("ERROR: Can't set Trinityd process priority class."); - sLog.outString(); + sLog.outString(""); } } #endif @@ -312,19 +315,19 @@ int Master::Run() { FreezeDetectorRunnable *fdr = new FreezeDetectorRunnable(); fdr->SetDelayTime(freeze_delay*1000); - ZThread::Thread t(fdr); - t.setPriority(ZThread::High); + ACE_Based::Thread t(*fdr); + t.setPriority(ACE_Based::High); } ///- Launch the world listener socket - port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD); - std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0"); + port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD); + std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0"); - if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1) + if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1) { - sLog.outError ("Failed to start network"); - World::StopNow(ERROR_EXIT_CODE); - // go down and shutdown the server + sLog.outError ("Failed to start network"); + World::StopNow(ERROR_EXIT_CODE); + // go down and shutdown the server } sWorldSocketMgr->Wait (); @@ -401,14 +404,16 @@ int Master::Run() /// Initialize connection to the databases bool Master::_StartDB() { - ///- Get world database info from configuration file + sLog.SetLogDB(false); std::string dbstring; - if(!sConfig.GetString("WorldDatabaseInfo", &dbstring)) + + ///- Get world database info from configuration file + dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", ""); + if(dbstring.empty()) { sLog.outError("Database not specified in configuration file"); return false; } - sLog.outDetail("World Database: %s", dbstring.c_str()); ///- Initialise the world database if(!WorldDatabase.Initialize(dbstring.c_str())) @@ -417,12 +422,13 @@ bool Master::_StartDB() return false; } - if(!sConfig.GetString("CharacterDatabaseInfo", &dbstring)) + ///- Get character database info from configuration file + dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", ""); + if(dbstring.empty()) { sLog.outError("Character Database not specified in configuration file"); return false; } - sLog.outDetail("Character Database: %s", dbstring.c_str()); ///- Initialise the Character database if(!CharacterDatabase.Initialize(dbstring.c_str())) @@ -432,14 +438,14 @@ bool Master::_StartDB() } ///- Get login database info from configuration file - if(!sConfig.GetString("LoginDatabaseInfo", &dbstring)) + dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", ""); + if(dbstring.empty()) { sLog.outError("Login database not specified in configuration file"); return false; } ///- Initialise the login database - sLog.outDetail("Login Database: %s", dbstring.c_str() ); if(!LoginDatabase.Initialize(dbstring.c_str())) { sLog.outError("Cannot connect to login database %s",dbstring.c_str()); @@ -455,6 +461,21 @@ bool Master::_StartDB() } sLog.outString("Realm running as realm ID %d", realmID); + ///- Initialize the DB logging system + if(sConfig.GetBoolDefault("EnableLogDB", false)) + { + // everything successful - set var to enable DB logging once startup finished. + sLog.SetLogDBLater(true); + sLog.SetLogDB(false); + sLog.SetRealmID(realmID); + } + else + { + sLog.SetLogDBLater(false); + sLog.SetLogDB(false); + sLog.SetRealmID(realmID); + } + ///- Clean the database before starting clearOnlineAccounts(); @@ -463,7 +484,8 @@ bool Master::_StartDB() sWorld.LoadDBVersion(); - sLog.outString("Using %s", sWorld.GetDBVersion()); + sLog.outString("Using World DB: %s", sWorld.GetDBVersion()); + sLog.outString("Using creature EventAI: %s", sWorld.GetCreatureEventAIVersion()); return true; } @@ -476,8 +498,10 @@ void Master::clearOnlineAccounts() "UPDATE account SET online = 0 WHERE online > 0 " "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID); - CharacterDatabase.Execute("UPDATE characters SET online = 0 WHERE online<>0"); + + // Battleground instance ids reset at server restart + CharacterDatabase.Execute("UPDATE characters SET bgid = 0 WHERE bgid<>0"); } /// Handle termination signals @@ -518,4 +542,3 @@ void Master::_UnhookSignals() signal(SIGBREAK, 0); #endif } - diff --git a/src/trinitycore/Master.h b/src/trinitycore/Master.h index 456202594f6..967f497051a 100644 --- a/src/trinitycore/Master.h +++ b/src/trinitycore/Master.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,4 +50,3 @@ class Master #define sMaster Trinity::Singleton<Master>::Instance() #endif /// @} - diff --git a/src/trinitycore/RASocket.cpp b/src/trinitycore/RASocket.cpp index 62a5dbc39c9..50a1af87256 100644 --- a/src/trinitycore/RASocket.cpp +++ b/src/trinitycore/RASocket.cpp @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,13 +23,14 @@ */ #include "Common.h" +#include "Config/ConfigEnv.h" #include "Database/DatabaseEnv.h" + +#include "AccountMgr.h" #include "Log.h" #include "RASocket.h" -#include "World.h" -#include "Config/ConfigEnv.h" #include "Util.h" -#include "AccountMgr.h" +#include "World.h" /// \todo Make this thread safe if in the future 2 admins should be able to log at the same time. SOCKET r; @@ -69,7 +70,7 @@ RASocket::~RASocket() ///- Delete buffer and decrease active admins count delete [] buff; - sLog.outRALog("Connection was closed.\n"); + sLog.outRemote("Connection was closed.\n"); if(stage==OK) iUsers--; @@ -79,7 +80,7 @@ RASocket::~RASocket() void RASocket::OnAccept() { std::string ss=GetRemoteAddress(); - sLog.outRALog("Incoming connection from %s.\n",ss.c_str()); + sLog.outRemote("Incoming connection from %s.\n",ss.c_str()); ///- If there is already an active admin, drop the connection if(iUsers) dropclient @@ -97,7 +98,7 @@ void RASocket::OnRead() unsigned int sz=ibuf.GetLength(); if(iInputLength+sz>=RA_BUFF_SIZE) { - sLog.outRALog("Input buffer overflow, possible DOS attack.\n"); + sLog.outRemote("Input buffer overflow, possible DOS attack.\n"); SetCloseAndDelete(); return; } @@ -149,7 +150,7 @@ void RASocket::OnRead() std::string login = szLogin; ///- Convert Account name to Upper Format - AccountMgr::normilizeString(login); + AccountMgr::normalizeString(login); ///- Escape the Login to allow quotes in names LoginDatabase.escape_string(login); @@ -160,7 +161,7 @@ void RASocket::OnRead() if(!result) { Sendf("-No such user.\r\n"); - sLog.outRALog("User %s does not exist.\n",szLogin.c_str()); + sLog.outRemote("User %s does not exist.\n",szLogin.c_str()); if(bSecure)SetCloseAndDelete(); } else @@ -173,7 +174,7 @@ void RASocket::OnRead() if(fields[0].GetUInt32()<iMinLevel) { Sendf("-Not enough privileges.\r\n"); - sLog.outRALog("User %s has no privilege.\n",szLogin.c_str()); + sLog.outRemote("User %s has no privilege.\n",szLogin.c_str()); if(bSecure)SetCloseAndDelete(); } else { @@ -191,8 +192,8 @@ void RASocket::OnRead() std::string login = szLogin; std::string pw = &buff[5]; - AccountMgr::normilizeString(login); - AccountMgr::normilizeString(pw); + AccountMgr::normalizeString(login); + AccountMgr::normalizeString(pw); LoginDatabase.escape_string(login); LoginDatabase.escape_string(pw); @@ -208,14 +209,14 @@ void RASocket::OnRead() ++iUsers; Sendf("+Logged in.\r\n"); - sLog.outRALog("User %s has logged in.\n",szLogin.c_str()); + sLog.outRemote("User %s has logged in.\n",szLogin.c_str()); Sendf("TC>"); } else { ///- Else deny access Sendf("-Wrong pass.\r\n"); - sLog.outRALog("User %s has failed to log in.\n",szLogin.c_str()); + sLog.outRemote("User %s has failed to log in.\n",szLogin.c_str()); if(bSecure)SetCloseAndDelete(); } } @@ -224,7 +225,7 @@ void RASocket::OnRead() case OK: if(strlen(buff)) { - sLog.outRALog("Got '%s' cmd.\n",buff); + sLog.outRemote("Got '%s' cmd.\n",buff); sWorld.QueueCliCommand(&RASocket::zprint , buff); } else @@ -257,4 +258,3 @@ void RASocket::zprint( const char * szText ) #endif } - diff --git a/src/trinitycore/RASocket.h b/src/trinitycore/RASocket.h index 145afd52c60..330c85defa4 100644 --- a/src/trinitycore/RASocket.h +++ b/src/trinitycore/RASocket.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,9 +25,10 @@ #ifndef _RASOCKET_H #define _RASOCKET_H -#include "Common.h" #include "sockets/TcpSocket.h" +#include "Common.h" + #define RA_BUFF_SIZE 1024 class ISocketHandler; @@ -65,4 +66,3 @@ class RASocket: public TcpSocket }; #endif /// @} - diff --git a/src/trinitycore/TrinityCore.rc b/src/trinitycore/TrinityCore.rc index 4e6510c0407..0acad1e4ba2 100644 --- a/src/trinitycore/TrinityCore.rc +++ b/src/trinitycore/TrinityCore.rc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/trinitycore/WorldRunnable.cpp b/src/trinitycore/WorldRunnable.cpp index 73d99e66061..ad0243a36ae 100644 --- a/src/trinitycore/WorldRunnable.cpp +++ b/src/trinitycore/WorldRunnable.cpp @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,20 +22,26 @@ \ingroup Trinityd */ -#include "WorldSocketMgr.h" #include "Common.h" -#include "World.h" -#include "WorldRunnable.h" -#include "Timer.h" #include "ObjectAccessor.h" -#include "MapManager.h" - +#include "World.h" +#include "WorldSocketMgr.h" #include "Database/DatabaseEnv.h" -#if (defined(SHORT_SLEEP) || defined(WIN32)) +#include "BattleGroundMgr.h" +#include "MapManager.h" +#include "Timer.h" +#include "WorldRunnable.h" + +#if (defined(WIN32) || defined(SHORT_SLEEP)) #define WORLD_SLEEP_CONST 50 #else -#define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms] +#define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms] +#endif + +#ifdef WIN32 +#include "ServiceWin32.h" +extern int m_ServiceStatus; #endif /// Heartbeat for the World @@ -43,6 +49,8 @@ void WorldRunnable::run() { ///- Init new SQL thread for the world database WorldDatabase.ThreadStart(); // let thread do safe mySQL requests (one connection call enough) + CharacterDatabase.ThreadStart(); + LoginDatabase.ThreadStart(); sWorld.InitResultQueue(); uint32 realCurrTime = 0; @@ -68,20 +76,29 @@ void WorldRunnable::run() if (diff <= WORLD_SLEEP_CONST+prevSleepTime) { prevSleepTime = WORLD_SLEEP_CONST+prevSleepTime-diff; - ZThread::Thread::sleep(prevSleepTime); + ACE_Based::Thread::Sleep(prevSleepTime); } else prevSleepTime = 0; + + #ifdef WIN32 + if (m_ServiceStatus == 0) World::StopNow(SHUTDOWN_EXIT_CODE); + while (m_ServiceStatus == 2) Sleep(1000); + #endif } sWorld.KickAll(); // save and kick all players sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call + // unload battleground templates before different singletons destroyed + sBattleGroundMgr.DeleteAllBattleGrounds(); + sWorldSocketMgr->StopNetwork(); MapManager::Instance().UnloadAll(); // unload all grids (including locked in memory) ///- End the database thread WorldDatabase.ThreadEnd(); // free mySQL thread resources + CharacterDatabase.ThreadStart(); + LoginDatabase.ThreadEnd(); } - diff --git a/src/trinitycore/WorldRunnable.h b/src/trinitycore/WorldRunnable.h index b84e5b6a04c..07ce246b04f 100644 --- a/src/trinitycore/WorldRunnable.h +++ b/src/trinitycore/WorldRunnable.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * - * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,11 +26,10 @@ #define __WORLDRUNNABLE_H /// Heartbeat thread for the World -class WorldRunnable : public ZThread::Runnable +class WorldRunnable : public ACE_Based::Runnable { public: void run(); }; #endif /// @} - diff --git a/src/trinitycore/resource.h b/src/trinitycore/resource.h index fbc730320b4..7dc5cb9ef7b 100644 --- a/src/trinitycore/resource.h +++ b/src/trinitycore/resource.h @@ -13,4 +13,3 @@ #define _APS_NEXT_SYMED_VALUE 101 #endif #endif - diff --git a/src/trinitycore/run-mangosd b/src/trinitycore/run-mangosd index f307bd9e1ad..4a146804e81 100644 --- a/src/trinitycore/run-mangosd +++ b/src/trinitycore/run-mangosd @@ -6,7 +6,7 @@ while : do echo "TrinityCore daemon restarted" echo `date` >> crash.log & - ./mangosd | tail -n 20 >> crash.log + ./mangosd | tail -n 20 >> crash.log echo " " >> crash.log & pid=`ps ax | awk '($5 ~ /trinitycore/) { print $1 }'` wait $pid diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index 66884c6d85b..30b1c723e0a 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1,7 +1,7 @@ ########################################## # Trinity Core worldd configuration file # ########################################## -ConfVersion=2009010301 +ConfVersion=2009032201 ################################################################################################################### # CONNECTIONS AND DIRECTORIES @@ -25,11 +25,15 @@ ConfVersion=2009010301 # WorldDatabaseInfo # CharacterDatabaseInfo # Database connection settings for the world server. -# Default: hostname;port;username;password;database -# .;somenumber;username;password;database - use named pipes at Windows -# Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini -# .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux -# Unix sockets: experimental, not tested +# Default: +# ---MYSQL--- +# hostname;port;username;password;database +# .;somenumber;username;password;database - use named pipes at Windows +# Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini +# .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux +# ---PGSQL--- +# hostname;port;username;password;database +# .;/path/to/unix_socket/DIRECTORY or . for default path;username;password;database - use Unix sockets at Unix/Linux # # MaxPingTime # Settings for maximum database-ping interval (minutes between pings) @@ -109,7 +113,7 @@ EAIErrorLevel = 2 # # SocketSelectTime # Socket select time (in milliseconds) -# Default: 10000 +# Default: 10000 (10 secs) # # GridCleanUpDelay # Grid clean up delay (in milliseconds) @@ -127,15 +131,11 @@ EAIErrorLevel = 2 # Player save interval (in milliseconds) # Default: 900000 (15 min) # -# DisconnectToleranceInterval -# Tolerance for disconnected players before putting in the queue. (in seconds) -# Default: 0 (disabled) -# # vmap.enableLOS # vmap.enableHeight # Enable/Disable VMmap support for line of sight and height calculation -# Default: 1 (true) -# 0 (false) +# Default: 0 (disable) +# 1 (enable) # # vmap.ignoreMapIds # Map id that will be ignored by VMaps @@ -168,6 +168,15 @@ EAIErrorLevel = 2 # Update realm uptime period in minutes (for save data in 'uptime' table). Must be > 0 # Default: 10 (minutes) # +# LogDB.Opt.ClearInterval +# Time for the WUPDATE_CLEANDB timer that clears the `logs` table of old entries. Must be > 0. +# Default: 10 (minutes) +# +# LogDB.Opt.ClearTime +# The maximum time in seconds of old `logs` table entries to keep. +# Default: 1209600 (14 days) +# 0 - don't clear +# # MaxCoreStuckTime # Periodically check if the process got freezed, if this is the case force crash after the specified # amount of seconds. Must be > 0. Recommended > 10 secs if you use this. @@ -193,7 +202,6 @@ GridCleanUpDelay = 300000 MapUpdateInterval = 100 ChangeWeatherInterval = 600000 PlayerSaveInterval = 900000 -DisconnectToleranceInterval = 0 vmap.enableLOS = 0 vmap.enableHeight = 0 vmap.ignoreMapIds = "369" @@ -202,6 +210,8 @@ vmap.petLOS = 0 DetectPosCollision = 1 TargetPosRecalculateRange = 1.5 UpdateUptimeInterval = 10 +LogDB.Opt.ClearInterval = 10 +LogDB.Opt.ClearTime = 1209600 MaxCoreStuckTime = 0 AddonChannel = 1 @@ -222,19 +232,19 @@ AddonChannel = 1 # # LogLevel # Server console level of logging -# 0 = Minimum; 1 = Basic&Error; 2 = Detail; 3 = Full/Debug +# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug # Default: 3 # -# LogTime -# Include time in server console output [hh:mm:ss] -# Default: 0 (no time) -# 1 (print time) -# # LogFile # Logfile name # Default: "Server.log" # "" - Empty name disable creating log file # +# ChatLogFile +# Log file for chat logs +# Default: "chat.log" +# "" - Empty name for disable +# # LogTimestamp # Logfile with timestamp of server start in name # Default: 0 - no timestamp in name @@ -242,11 +252,12 @@ AddonChannel = 1 # # LogFileLevel # Server file level of logging -# 0 = Minimum; 1 = Error; 2 = Detail; 3 = Full/Debug +# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug # Default: 0 # -# LogFilter_TransportMoves +# LogFilter_AchievementUpdates # LogFilter_CreatureMoves +# LogFilter_TransportMoves # LogFilter_VisibilityChanges # Log filters # Default: 1 - not include with any log level @@ -304,23 +315,104 @@ AddonChannel = 1 # Default: "" - do not create arena log file # # LogColors -# Color for messages (format "normal_color details_color debug_color error_color") +# Color for messages (format "normal basic detail debug") # Colors: 0 - BLACK, 1 - RED, 2 - GREEN, 3 - BROWN, 4 - BLUE, 5 - MAGENTA, 6 - CYAN, 7 - GREY, # 8 - YELLOW, 9 - LRED, 10 - LGREEN, 11 - LBLUE, 12 - LMAGENTA, 13 - LCYAN, 14 - WHITE # Default: "" - none colors -# Example: "13 7 11 9" +# Example: "13 11 9 5" +# +# EnableLogDB +# Enable/disable logging to database (LogDatabaseInfo). +# Default: 0 - disabled +# 1 - enabled +# +# DBLogLevel +# Log level of DB logging. +# 0 = Minimum; 1 = Basic; 2 = Detail; 3 = Full/Debug +# Default: 3 +# +# LogDB.Char +# Enable/disable logging character outputs to DB. +# Default: 0 - off +# 1 - on +# +# LogDB.GM +# Enable/disable logging GM commands to DB. +# Default: 0 - off +# 1 - on +# +# LogDB.RA +# Enable/disable logging remote access events to DB. +# Default: 0 - off +# 1 - on +# +# LogDB.World +# Enable/disable logging world packets to DB. +# Default: 0 - off +# 1 - on (very heavy) +# +# LogDB.Chat +# Enable/disable logging chat messages to the database. +# Default: 0 - off +# 1 - on +# +# ChatLogs.Channel +# Enable logging chatting in custom channels. +# Default: 0 - off +# 1 - on +# +# ChatLogs.Whisper +# Enable logging whispers between players. +# Default: 0 - off +# 1 - on +# +# ChatLogs.Party +# Enable logging party messages. +# Default: 0 - off +# 1 - on +# +# ChatLogs.Raid +# Enable logging raid messages. +# Default: 0 - off +# 1 - on +# +# ChatLogs.Guild +# Enable logging guild messages. +# Default: 0 - off +# 1 - on +# +# ChatLogs.Public +# Enable logging public chat events (say/yell/emote). +# Default: 0 - off +# 1 - on +# +# ChatLogs.Addon +# Enable logging addon messages. +# Default: 0 - off +# 1 - on +# +# ChatLogs.BattleGround +# Enable logging battleground chats. +# Default: 0 - off +# 1 - on +# +# ChatLogTimestamp +# Chat Logfile with timestamp of server start in name +# Default: 0 - no timestamp in name +# 1 - add timestamp in name in form Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext # ################################################################################################################### LogSQL = 1 PidFile = "" LogLevel = 1 -LogTime = 0 LogFile = "Server.log" +ChatLogFile = "chat.log" LogTimestamp = 0 LogFileLevel = 0 -LogFilter_TransportMoves = 1 +LogFilter_AchievementUpdates = 1 LogFilter_CreatureMoves = 1 +LogFilter_TransportMoves = 1 LogFilter_VisibilityChanges = 1 WorldLogFile = "" DBErrorLogFile = "db_errors.log" @@ -333,6 +425,23 @@ GmLogPerAccount = 0 RaLogFile = "ra_commands.log" ArenaLogFile = "" LogColors = "" +EnableLogDB = 0 +DBLogLevel = 1 +LogDB.Char = 0 +LogDB.GM = 0 +LogDB.RA = 0 +LogDB.World = 0 +LogDB.Chat = 0 +ChatLogs.Channel = 0 +ChatLogs.SysChan = 0 +ChatLogs.Whisper = 0 +ChatLogs.Party = 0 +ChatLogs.Raid = 0 +ChatLogs.Guild = 0 +ChatLogs.Public = 0 +ChatLogs.Addon = 0 +ChatLogs.BattleGround = 0 +ChatLogTimestamp = 0 ################################################################################################################### # SERVER SETTINGS @@ -378,9 +487,9 @@ LogColors = "" # # Expansion # Allow server use content from expansion -# 2 - check expansion 2 maps existence, and if client support expansion 2 and account have +# Default: 2 - check expansion 2 maps existence, and if client support expansion 2 and account have # expansion 2 setting then allow visit expansion 2 maps, allow create new class character) -# Default: 1 - check expansion 1 maps existence, and if client support expansion 1 and account have +# 1 - check expansion 1 maps existence, and if client support expansion 1 and account have # expansion 1 setting then allow visit expansion 1 maps, allow create new races character) # 0 - not check expansion maps existence, not allow wisit its, not allow create new race or new class # characters, ignore account expansion setting) @@ -444,6 +553,18 @@ LogColors = "" # Default: 10 (client limitation) # The number must be between 1 and 10 # +# HeroicCharactersPerRealm +# Limit numbers of heroic class characters for account at realm +# Default: 1 +# The number must be between 0 (not allowed) and 10 +# +# MinLevelForHeroicCharacterCreating +# Limit creating heroic characters only for account with another character of specific level (ignored for GM accounts) +# 0 - not require any existed chaarcter +# 1 - require at least any character existed +# Default: 55 - default requirement +# +# # SkipCinematics # Disable in-game script movie at first character's login(allows to prevent buggy intro in case of custom start location coordinates) # Default: 0 - show intro for each new characrer @@ -451,14 +572,18 @@ LogColors = "" # 2 - disable intro show in all cases # # MaxPlayerLevel -# Max level that can be reached by player for experience (in range from 1 to 255). +# Max level that can be reached by player for experience (in range from 1 to 100). # Change not recommended -# Default: 70 +# Default: 80 # # StartPlayerLevel # Staring level that have character at creating (in range 1 to MaxPlayerLevel) # Default: 1 # +# StartHeroicPlayerLevel +# Staring level that have character of heroic class at creating (in range 1 to MaxPlayerLevel) +# Default: 55 +# # StartPlayerMoney # Amount of money that new players will start with. # If you want to start with silver, use for example 100 (100 copper = 1 silver) @@ -495,34 +620,14 @@ LogColors = "" # # AlwaysMaxSkillForLevel # Players will automatically gain max level dependent (weapon/defense) skill when logging in, leveling up etc. -# Default: 0 (true) -# 1 (false) +# Default: 0 (false) +# 1 (true) # # ActivateWeather # Activate weather system # Default: 1 (true) # 0 (false) # -# Battleground.CastDeserter -# Cast or not Deserter spell at player who leave battleground in progress -# Default: 1 (true) -# 0 (false) -# -# Battleground.QueueAnnouncer.Enable -# Enable queue announcer posting to chat -# Default: 1 (true) -# 0 (false) -# -# Battleground.QueueAnnouncer.PlayerOnly -# Enable queue announcer posting to chat -# Default: 0 (false) -# 1 (true) -# -# Battleground.PrematureReward -# Reward players in case of prematurely finished BG -# Default: 1 (true) -# 0 (false) -# # CastUnstuck # Allow cast or not Unstuck spell at .start or client Help option use # Default: 1 (true) @@ -544,7 +649,7 @@ LogColors = "" # # Instance.UnloadDelay # Unload the instance map from memory after some time if no players are inside. -# Default: 1800000 (miliseconds, i.e 30 minutes) +# Default: 1800000 (miliseconds 30 minutes) # 0 (instance maps are kept in memory until they are reset) # # Quests.LowLevelHideDiff @@ -577,10 +682,20 @@ LogColors = "" # Default: 3600 sec (1 hour) # # SkillChance.Prospecting -# For prospecting skillup not possible by default, but can be allowed as custom setting +# For prospecting skillup impossible by default, but can be allowed as custom setting +# Default: 0 - no skilups +# 1 - skilups possible +# +# SkillChance.Milling +# For milling skillup impossible by default, but can be allowed as custom setting # Default: 0 - no skilups # 1 - skilups possible # +# OffhandCheckAtTalentsReset +# Talent reset can change offhand weapon restrictions for equip slots. +# Default: 0 - recheck offhand slot weapon only at zone update +# 1 - recheck offhand slot weapon at talent reset also +# # Event.Announce # Default: 0 (false) # 1 (true) @@ -602,7 +717,7 @@ LogColors = "" GameType = 1 RealmZone = 1 -Expansion = 1 +Expansion = 2 DBC.Locale = 255 DeclinedNames = 0 StrictPlayerNames = 0 @@ -612,9 +727,12 @@ MaxWhoListReturns = 49 CharactersCreatingDisabled = 0 CharactersPerAccount = 50 CharactersPerRealm = 10 +HeroicCharactersPerRealm = 1 +MinLevelForHeroicCharacterCreating = 55 SkipCinematics = 0 -MaxPlayerLevel = 70 +MaxPlayerLevel = 80 StartPlayerLevel = 1 +StartHeroicPlayerLevel = 55 StartPlayerMoney = 0 MaxHonorPoints = 75000 StartHonorPoints = 0 @@ -625,10 +743,6 @@ DisableWaterBreath = 4 AllFlightPaths = 0 AlwaysMaxSkillForLevel = 0 ActivateWeather = 1 -Battleground.CastDeserter = 1 -Battleground.QueueAnnouncer.Enable = 1 -Battleground.QueueAnnouncer.PlayerOnly = 0 -Battleground.PrematureReward = 1 CastUnstuck = 1 Instance.IgnoreLevel = 0 Instance.IgnoreRaid = 0 @@ -641,6 +755,8 @@ MinPetitionSigns = 9 MaxGroupXPDistance = 74 MailDeliveryDelay = 3600 SkillChance.Prospecting = 0 +SkillChance.Milling = 0 +OffhandCheckAtTalentsReset = 0 Event.Announce = 0 BeepAtStart = 1 Motd = "Welcome to a Trinity Core server." @@ -714,8 +830,13 @@ TalentsInspecting = 1 # 1.5 - 150% # 0 - off (0%) # +# CreatureFamilyFleeAssistanceRadius +# Radius which creature will use to seek for a near creature for assistance. Creature will flee to this creature. +# Default: 30 +# 0 - off +# # CreatureFamilyAssistanceRadius -# Creature family assistance radius +# Radius which creature will use to call assistance without moving # Default: 10 # 0 - off # @@ -723,6 +844,10 @@ TalentsInspecting = 1 # Reaction time for creature assistance call # Default: 1500 (1.5s) # +# CreatureFamilyFleeDelay +# Time during which creature can flee when no assistant found +# Default: 7000 (7s) +# # WorldBossLevelDiff # Difference for boss dynamic level with target # Default: 3 @@ -779,8 +904,10 @@ TalentsInspecting = 1 ThreatRadius = 60 Rate.Creature.Aggro = 1 +CreatureFamilyFleeAssistanceRadius = 30 CreatureFamilyAssistanceRadius = 10 CreatureFamilyAssistanceDelay = 1500 +CreatureFamilyFleeDelay = 7000 WorldBossLevelDiff = 3 Corpse.Decay.NORMAL = 60 Corpse.Decay.RARE = 300 @@ -864,6 +991,12 @@ Channel.SilentlyGMJoin = 0 # 0 (invisible) # 1 (visible) # +# GM.AcceptTickets +# Is GM accepting tickets from player by default or not. +# Default: 2 (last save state) +# 0 (disable) +# 1 (enable) +# # GM.Chat # GM chat mode at login # Default: 2 (last save state) @@ -877,7 +1010,7 @@ Channel.SilentlyGMJoin = 0 # 1 (enable) # # GM.InGMList -# Is GM showed in GM list (if visible) in non-GM state (.gmoff) +# Is GM showed in GM list (if visible) in non-GM state (.gm off) # Default: 0 (false) # 1 (true) # @@ -892,7 +1025,7 @@ Channel.SilentlyGMJoin = 0 # 0 (not include) # # GM.StartLevel -# GM starting level (1-255) +# GM starting level (1-100) # Default: 1 # # GM.AllowInvite @@ -904,18 +1037,32 @@ Channel.SilentlyGMJoin = 0 # Are players allowed to add GMs to their friend list # Default: 0 (false) # 1 (true) +# +# GM.LowerSecurity +# Disallow a lower security member to interact with a higher one using commands +# Default: 0 (disable) +# 1 (enable) +# +# GM.AllowAchievementGain +# If enabled it allows gaining achievements for GM characters +# Default: 1 (enable) +# 0 (disable) +# ################################################################################################################### -GM.LoginState = 2 -GM.Visible = 2 -GM.Chat = 2 -GM.WhisperingTo = 2 -GM.InGMList = 0 -GM.InWhoList = 0 -GM.LogTrade = 1 -GM.StartLevel = 70 -GM.AllowInvite = 0 -GM.AllowFriend = 0 +GM.LoginState = 2 +GM.Visible = 2 +GM.AcceptTickets = 2 +GM.Chat = 2 +GM.WhisperingTo = 2 +GM.InGMList = 0 +GM.InWhoList = 0 +GM.LogTrade = 1 +GM.StartLevel = 80 +GM.AllowInvite = 0 +GM.AllowFriend = 0 +GM.LowerSecurity = 0 +GM.AllowAchievementGain = 1 ################################################################################################################### # VISIBILITY AND RADIUSES @@ -929,9 +1076,9 @@ GM.AllowFriend = 0 # Visibility.Distance.Creature # Visibility.Distance.Player # Visibility distance for different in game object -# Max limited by active player zone: ~ 333 +# Max limited by active player zone: ~ 166 # Min limit dependent from objects -# Default: 132 (cell size) +# Default: 66 (cell size) # Min limit is max aggro radius (45) * Rate.Creature.Aggro # # Visibility.Distance.Object @@ -957,10 +1104,10 @@ GM.AllowFriend = 0 ################################################################################################################### Visibility.GroupMode = 0 -Visibility.Distance.Creature = 132 -Visibility.Distance.Player = 132 -Visibility.Distance.Object = 132 -Visibility.Distance.InFlight = 132 +Visibility.Distance.Creature = 66 +Visibility.Distance.Player = 66 +Visibility.Distance.Object = 66 +Visibility.Distance.InFlight = 66 Visibility.Distance.Grey.Unit = 1 Visibility.Distance.Grey.Object = 10 @@ -971,6 +1118,8 @@ Visibility.Distance.Grey.Object = 10 # Rate.Mana # Rate.Rage.Income # Rate.Rage.Loss +# Rate.RunicPower.Income +# Rate.RunicPower.Loss # Rate.Focus # Rate.Loyalty # Health and power regeneration and rage income from damage. @@ -1035,6 +1184,14 @@ Visibility.Distance.Grey.Object = 10 # Reputation Gain rate # Default: 1 # +# Rate.Reputation.LowLevel.Kill +# Reputation Gain form low level kill (grey creture) +# Default: 1 +# +# Rate.Reputation.LowLevel.Quest +# Reputation Gain rate +# Default: 1 +# # Rate.InstanceResetTime # Multiplier for the number of days in between global raid/heroic instance resets. # Default: 1 @@ -1089,7 +1246,7 @@ Visibility.Distance.Grey.Object = 10 # # Death.Bones.World # Death.Bones.BattlegroundOrArena -# Enabled/disabled creating bones instead corpse at resurrection (in normal zones/instacnes, or battleground/arenas) +# Enable/disable creating bones instead corpse at resurrection (in normal zones/instacnes, or battleground/arenas) # Default: 1 (enabled) # 0 (disabled) # @@ -1099,6 +1256,8 @@ Rate.Health = 1 Rate.Mana = 1 Rate.Rage.Income = 1 Rate.Rage.Loss = 1 +Rate.RunicPower.Income = 1 +Rate.RunicPower.Loss = 1 Rate.Focus = 1 Rate.Loyalty = 1 Rate.Skill.Discovery = 1 @@ -1127,6 +1286,8 @@ Rate.Mining.Amount = 1 Rate.Mining.Next = 1 Rate.Talent = 1 Rate.Reputation.Gain = 1 +Rate.Reputation.LowLevel.Kill = 1 +Rate.Reputation.LowLevel.Quest = 1 Rate.InstanceResetTime = 1 SkillGain.Crafting = 1 SkillGain.Defense = 1 @@ -1148,50 +1309,101 @@ Death.CorpseReclaimDelay.PvE = 0 Death.Bones.World = 1 Death.Bones.BattlegroundOrArena = 1 + ################################################################################################################### +# BATTLEGROUND CONFIG # -# Rated arena matches config +# Battleground.CastDeserter +# Cast Deserter spell at player who leave battleground in progress +# Default: 1 (enable) +# 0 (disable) # -# MaxRatingDifference: the maximum rating difference between two groups in rated matches -# Default: 0 (disable, rating difference is discarded) +# Battleground.QueueAnnouncer.Enable +# Enable queue announcer posting to chat +# Default: 0 (disable) +# 1 (enable) # -# RatingDiscardTimer: after the specified milliseconds has passed, -# rating information will be discarded when selecting teams for matches -# also initiates an update by this timer -# Default: 60000 +# Battleground.QueueAnnouncer.PlayerOnly +# Enable queue announcer posting to chat +# Default: 0 (disable) +# 1 (enable) +# +# Battleground.InvitationType +# Set Battleground invitation type +# Default: 0 (normal - invite as much players to bg as possible, don't bother with ballance) +# 1 (Experimental - don't allow to invite much more players of one faction) # -# AutoDistributePoints: set if arena points should be distributed automatically, or by GM command -# Default: 0 (disable) (recommended): use gm command or sql query to distribute the points -# 1 (enable): arena points are distributed automatically +# Battleground.PrematureFinishTimer +# The time to end the bg if there are less than MinPlayersPerTeam on one side in milliseconds +# Default: 300000 (5 minutes) +# 0 - disable (not recommended) # -# AutoDistributeInterval: how often should the distribution take place -# if automatic distribution is enabled -# in days -# Default: 7 (weekly) +# BattleGround.PremadeGroupWaitForMatch +# The time in which premade group of 1 faction waits in BG Queue for premade group of other faction +# Default: 1800000 (30 minutes) +# 0 - disable (not recommended) # ################################################################################################################### -Arena.MaxRatingDifference = 0 -Arena.RatingDiscardTimer = 60000 -Arena.AutoDistributePoints = 0 -Arena.AutoDistributeInterval = 7 +Battleground.CastDeserter = 1 +Battleground.QueueAnnouncer.Enable = 0 +Battleground.QueueAnnouncer.PlayerOnly = 0 +Battleground.InvitationType = 0 +BattleGround.PrematureFinishTimer = 300000 +BattleGround.PremadeGroupWaitForMatch = 1800000 + ################################################################################################################### +# ARENA CONFIG +# +# Arena.MaxRatingDifference +# The maximum rating difference between two groups in rated matches +# Default: 150 (enable, recommended) +# 0 (disable, rating difference is discarded) +# +# Arena.RatingDiscardTimer +# After the specified milliseconds has passed, +# rating information will be discarded when selecting teams for matches +# also initiates an update by this timer +# Default: 600000 (10 minutes, recommended) +# 0 (disable) +# +# Arena.AutoDistributePoints +# Set if arena points should be distributed automatically, or by GM command +# Default: 0 (disable) (recommended): use gm command or sql query to distribute the points +# 1 (enable) arena points are distributed automatically # -# Battleground config +# Arena.AutoDistributeInterval +# How often should the distribution take place +# If automatic distribution is enabled in days +# Default: 7 (weekly) +# +# Arena.QueueAnnouncer.Enable +# Enable bg queue announcer posting to chat +# Default: 0 (disable) +# 1 (enable) +# +# Arena.ArenaSeason.ID +# Current area season id show in client +# Default: 1 # -# PrematureFinishTimer: the time to end the bg if there are less than minplayersperteam on one side -# in milliseconds -# Default: 300000 -# 0 - disable +# Arena.ArenaSeason.InProgress +# Current area season state +# Default: 1 (active) +# 0 (finished) # ################################################################################################################### -BattleGround.PrematureFinishTimer = 300000 +Arena.MaxRatingDifference = 150 +Arena.RatingDiscardTimer = 600000 +Arena.AutoDistributePoints = 0 +Arena.AutoDistributeInterval = 7 +Arena.QueueAnnouncer.Enable = 0 +Arena.ArenaSeason.ID = 1 +Arena.ArenaSeason.InProgress = 1 ################################################################################################################### -# # NETWORK CONFIG # # Network.Threads @@ -1220,7 +1432,7 @@ Network.TcpNodelay = 1 ################################################################################################################### # AUCTION HOUSE BOT SETTINGS -# +# # AuctionHouseBot.EnableSeller # Enable/Disable the part of AHBot that puts items up for auction # Default 0 (disabled) @@ -1231,7 +1443,7 @@ Network.TcpNodelay = 1 # # Auction House Bot character data # AuctionHouseBot.Account is the account number (in realmd->account table) of the player you want to run as the auction bot. -# AuctionHouseBot.GUID is the GUID (in characters->characters table) of the player you want to run as the auction bot. +# AuctionHouseBot.GUID is the GUID (in characters->characters table) of the player you want to run as the auction bot. # Default: 0 (Auction House Bot disabled) # # AuctionHouseBot.VendorItems @@ -1258,7 +1470,7 @@ Network.TcpNodelay = 1 # Default 1 # Bind_Quest_Item # Default 0 -# +# # AuctionHouseBot.ItemsPerCycle # Number of Items to Add/Remove from the AH during mass operations # Default 200 @@ -1371,6 +1583,14 @@ Ra.Secure = 1 # NoResetTalentsCost # Enable or disable no cost when reseting talents # +# +# OutdoorPvP.Wintergrasp.StartTime = 30 +# The start time of the first battle after server starts (default: 30 minutes) +# OutdoorPvP.Wintergrasp.BattleTime = 30 +# Time limit of a battle +# OutdoorPvP.Wintergrasp.Interval +# Interval between battles (default: 150 minutes) +# # ForbiddenMaps # map ids that users below SEC_GAMEMASTER cannot enter, with delimiter ',' # Default: "" @@ -1412,6 +1632,9 @@ PvPToken.Enable = 0 PvPToken.MapAllowType = 4 PvPToken.ItemID = 29434 PvPToken.ItemCount = 1 +OutdoorPvP.Wintergrasp.StartTime = 30 +OutdoorPvP.Wintergrasp.BattleTime = 30 +OutdoorPvP.Wintergrasp.Interval = 150 NoResetTalentsCost = 0 ShowKickInWorld = 0 RecordUpdateTimeDiffInterval = 60000 |
