Commit Graph

45 Commits

Author SHA1 Message Date
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Spp
1e50a08604 Core/Logging: Fix PlayerDump logging 2012-10-22 10:37:39 +02:00
ZxBiohazardZx
3aa586986f Core/Codestyle: some small improvements for Doxygen Purposes 2012-10-02 23:20:03 +02:00
Nay
b89b8ff277 Core/Loading: Change info/error messages to printf when config is not loaded 2012-08-29 20:02:55 +01:00
Shauren
7dc26c7ff7 Core/Misc: Warning fixes 2012-08-21 18:20:42 +02:00
Nay
d1b10082a2 Whitespace is the root of all evil (version 2) 2012-08-03 22:55:18 +01:00
Spp
55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
Machiavelli
e960016dc4 Partial revert of "Core/DB Layer: Fix a memory leak.", mysql library related stuff. Original memory leak fix is still in place. 2012-03-26 13:33:47 +02:00
Machiavelli
43048afc7e Core/DB Layer: Fix a memory leak. 2012-03-26 08:29:41 +02:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Spp
b16d2245bb Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
2011-09-29 12:43:05 +02:00
Spp
be12603150 Configuration/ConfigMgr: converted from singleton to namespace with free functions. 2011-09-28 13:00:43 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
runningnak3d
c41839a243 Core/Authserver: vi change word (cw) FAIL! 2011-04-12 14:33:42 -04:00
runningnak3d
cf5e97003e Core/AuthServer: Some minor text cleanup. 2011-04-12 14:30:18 -04:00
Machiavelli
bd85914d92 Core/DBLayer: Properly manage mysql library initialization and shutdown in authserver and worldserver. Prevent multiple calls and make it more elegant. 2011-01-13 21:30:37 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
silinoron
da8d794f4b Core/Authserver: Put code in line with recent singleton changes.
--HG--
branch : trunk
2010-12-27 09:27:43 -08:00
silinoron
60c6d462e4 Core/Authserver: Significant cleanup in preparation for a rewrite.
Dropped support for running as a service on windows; it may be back in some form later.
Otherwise there should be no functional changes.

--HG--
branch : trunk
2010-12-27 09:02:02 -08:00
Shauren
928443d899 Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG--
branch : trunk
2010-12-23 23:25:44 +01:00
Machiavelli
ea29d87dcc Backed out changeset: 8326a2411148
--HG--
branch : trunk
2010-12-13 09:18:49 +01:00
Machiavelli
f5d6319d4d Core/DBLayer:
- Make the mysql connectionpool shared for async and syncrhonous connections.
- Allow configurable amount of connections for the pool
- Allow configurable amount of delaythreads
Note that delaythreads now only represent in-core threads. Whenever they execute a task they will pick a free connection from the pool instead of using their previously unique assigned connection.
The purpose of this design change is better distribution of SQL requests (no bottlenecks paired with idling) among available resources.
This also prevents a ¨memory waste¨ of preparing async prepared statements on synchronous connections (that were never called) - and vice versa. Now, connections aren´t explicitly async or synchronous, they serve both purposes.

Use at own risk, might cause instabilities.
Don´t forget to update your config files and clear your cmake cache.

--HG--
branch : trunk
2010-12-04 21:50:36 +01:00
click
f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click
8ea4b32fab Update copyright headers (following the same standard in all files = good)
--HG--
branch : trunk
2010-10-07 12:41:56 +02:00
Machiavelli
a9e9a2c884 Core/DBLayer:
- DB Threading model update
* Get rid of ThreadBundleMask and bundled connection
* Implement configurable amount of Synch threads for databasepools
* Use modulus based algorithm to check for free synchronous connections instead of previous ¨get connection by thread key or bundlemask¨ feature
* Locks on mysql context objects are now managed outside the mysql query methods

Fixes issue #4058
Fixes issue #4059
Introduces a ton of more issues. Use at own risk. You were warned. Really.

Don´t forget to update your worldserver.conf

--HG--
branch : trunk
2010-09-27 00:20:56 +02:00
Machiavelli
62946f9ef6 Core/DBLayer:
- Rewrite KeepAlive method for DatabaseWorkerPool. Use mysql_ping instead of explicit select queries, and also schedule KeepAlives for asynchronous threads.
NOTE: While the function is implemented and previous keepalive calls were transformed, it´s possible the keepalive call will need to be placed in several other locations in the code. Please leave feedback on whether or not this fixes your timeout issues.

Update issue #4062

--HG--
branch : trunk
2010-09-25 01:05:24 +02:00
Machiavelli
273679c5ba Core/DBLayer
- Store threadbundlemask internally per database pool and prevent direct access to config file post startup
- Fix threadbundlemask flag checking for ReactorRunnable, WorldRunnable
- Remove CLI threadbundlemask flag, CLI doesn´t need a seperate mysql connection nor thread
- Remove unused Character Database connection from WorldSocketMgr / ReactorRunnable
- Add proper LoginDatabase connection to RA Runnable (soon to be overhauled)

Note: still experimental and not tested for live use

--HG--
branch : trunk
2010-09-03 10:52:32 +02:00
Machiavelli
0117af4c37 Core/DBLayer:
- Implement deriviate classes of MySQLConnection for every database type (world, realm, characters)
- Make DatabaseWorkerPool templatized and use the above mentioned classes as parameter
- Implementation of the new types in code
(This is in preparation of prepared statement interface)

--HG--
branch : trunk
2010-09-02 17:47:50 +02:00
Spp
16d95d3115 Core: Fix some warnings
--HG--
branch : trunk
2010-08-23 07:51:19 +02:00
Machiavelli
87218eadcd * HIGHLY EXPERIMENTAL - USE AT OWN RISK *
Database Layer:
- Implement connection pooling: Instead of 1 delay thread per database, you can configure between 1 and 32 worker threads that have a seperate thread in the core and have a seperate connection to the MySQL server (based on raczman/Albator´s database layer for Trinitycore3)
- Implement a configurable thread bundle for synchroneous requests from seperate core threads (see worldserver.conf.dist for more info)
- Every mapupdate thread now has its seperate MySQL connection to the world and characters database
- Drop inconsistent PExecuteLog function - query logging will be implemented CONSISTENTLY later
- Drop current prepared statement interface - this will be done *properly* later
- You´ll need to update your worldserver.conf and authserver.conf
- You´re recommended to make a backup of your databases before using this.
* HIGHLY EXPERIMENTAL - USE AT OWN RISK *
* HIGHLY EXPERIMENTAL - USE AT OWN RISK *
etc.

--HG--
branch : trunk
2010-08-18 02:25:52 +02:00
click
b4bef54b7a Fix Windows-build (YES, IT COMPILES!) - partial revert of revision a9386a2655
- Use minihack on ACE to avoid using config.h on Windows platforms
- Put include-locations for ACE in AFTER everything else (for later use)
An insane thanks to paradox for being patient with testing changes and swapouts

--HG--
branch : trunk
2010-08-16 09:51:37 +02:00
click
916c7f09f8 Buildsystem/Linux: Deprecate and remove use of FindTermcap.cmake - it was only used as a solution for older CentOS versions
Core/Genrevision: Move defines from SystemConfig.h file into into revision.h (might need a rename now?) and delete it.
This should remove the infamous "rebuild all of game plzkthx"-symptom when upgrading to newer revisions.

--HG--
branch : trunk
2010-08-14 21:28:00 +02:00
click
d86a0e5060 Core: Remove some useless defines (handled in the configfiles)
--HG--
branch : trunk
2010-08-14 17:02:11 +02:00
click
1f80c7b3c0 Sourcefile sleanups -> tabs to spaces, remove whitespace - also update the cleanupscripts very slightly
--HG--
branch : trunk
2010-08-08 19:45:53 +02:00
click
c298bdb662 Remove duplicate "Error:" from some outError messages...
--HG--
branch : trunk
2010-07-31 03:12:51 +02:00
click
b118ab2356 remove ANSI escape codes from auth/worldserver error-output since it doesn't work on MS-based OS'es *sighs*
--HG--
branch : trunk
2010-07-29 17:15:03 +02:00
click
969bf213b8 Fix windows-build and change some warnings if configuration-files can not be read properly
- Add proper warning about missing [authserver] -tag in authserver configuration file if not found.
- Add proper warning about missing [worldserver] -tag in worldserver configuration file if not found.
Thanks to Qaston for finding the redefininition of strdup!

--HG--
branch : trunk
2010-07-29 09:00:55 +02:00
click
3296a944e7 Convert to using ACE for reading configurationfiles, and remove dependency on dotconfpp configuration library and related files
(patch by astellar - and a thankyou to vladimir for being a russian teddybear)

--HG--
branch : trunk
2010-07-29 01:22:45 +02:00
Machiavelli
fb4d4514e5 Add prepared statement example for auth server ping
--HG--
branch : trunk
2010-06-28 16:09:16 +02:00
Xanadu
ffaffe3fd7 * Renamed several VS projects and the executables they produce to reflect the new naming convention.
* Cleaned up some useless and redundant preprocessor definitions.
* Fixed the win build so that it correctly uses the mysql lib it built from the sources.
* Note that you still need to use 8615_mysql_openssl_libs.zip for the OpenSSL binaries.
* Also note that Win x64 build from the existing VS files is still fubar (mysql lib...).

--HG--
branch : trunk
2010-06-23 01:47:41 +02:00
Shauren
7195abfad0 Fixed TrinityRealm compile on windows
Fixed shared build on windows fully

NOTE: TrinityRealm config file has been renamed to authserver.conf!

--HG--
branch : trunk
2010-06-10 16:39:51 +02:00
Tartalo
a5f4e3de94 more cmake fixes. comment collision compilation until fixed
--HG--
branch : trunk
2010-06-08 01:20:06 +02:00
click
fd28bc6aff rename world server directory (trinitycore) to worldserver, rename authserver directory (trinityrealm) to authserver to reflect their real purposes
--HG--
branch : trunk
rename : src/server/trinityrealm/AuthCodes.cpp => src/server/authserver/AuthCodes.cpp
rename : src/server/trinityrealm/AuthCodes.h => src/server/authserver/AuthCodes.h
rename : src/server/trinityrealm/AuthSocket.cpp => src/server/authserver/AuthSocket.cpp
rename : src/server/trinityrealm/AuthSocket.h => src/server/authserver/AuthSocket.h
rename : src/server/trinityrealm/CMakeLists.txt => src/server/authserver/CMakeLists.txt
rename : src/server/trinityrealm/Main.cpp => src/server/authserver/Main.cpp
rename : src/server/trinityrealm/RealmAcceptor.h => src/server/authserver/RealmAcceptor.h
rename : src/server/trinityrealm/RealmList.cpp => src/server/authserver/RealmList.cpp
rename : src/server/trinityrealm/RealmList.h => src/server/authserver/RealmList.h
rename : src/server/trinityrealm/RealmSocket.cpp => src/server/authserver/RealmSocket.cpp
rename : src/server/trinityrealm/RealmSocket.h => src/server/authserver/RealmSocket.h
rename : src/server/trinityrealm/TrinityRealm.ico => src/server/authserver/TrinityRealm.ico
rename : src/server/trinityrealm/TrinityRealm.rc => src/server/authserver/TrinityRealm.rc
rename : src/server/trinityrealm/resource.h => src/server/authserver/resource.h
rename : src/server/trinityrealm/trinityrealm.conf.dist => src/server/authserver/trinityrealm.conf.dist
rename : src/server/trinitycore/CMakeLists.txt => src/server/worldserver/CMakeLists.txt
rename : src/server/trinitycore/CliRunnable.cpp => src/server/worldserver/CliRunnable.cpp
rename : src/server/trinitycore/CliRunnable.h => src/server/worldserver/CliRunnable.h
rename : src/server/trinitycore/Main.cpp => src/server/worldserver/Main.cpp
rename : src/server/trinitycore/Master.cpp => src/server/worldserver/Master.cpp
rename : src/server/trinitycore/Master.h => src/server/worldserver/Master.h
rename : src/server/trinitycore/RASocket.cpp => src/server/worldserver/RASocket.cpp
rename : src/server/trinitycore/RASocket.h => src/server/worldserver/RASocket.h
rename : src/server/trinitycore/TrinityCore.ico => src/server/worldserver/TrinityCore.ico
rename : src/server/trinitycore/TrinityCore.rc => src/server/worldserver/TrinityCore.rc
rename : src/server/trinitycore/WorldRunnable.cpp => src/server/worldserver/WorldRunnable.cpp
rename : src/server/trinitycore/WorldRunnable.h => src/server/worldserver/WorldRunnable.h
rename : src/server/trinitycore/resource.h => src/server/worldserver/resource.h
rename : src/server/trinitycore/trinitycore.conf.dist => src/server/worldserver/trinitycore.conf.dist
2010-06-05 22:44:53 +02:00