Commit Graph

64 Commits

Author SHA1 Message Date
leak
029bad6698 Replaced all remaining ACE based Singletons
Replaced ACE base AutoPtr class with shared_ptr
Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be)
2014-07-01 00:54:09 +02:00
leak
eb36acd152 Replaced ACE_Task_Base based LogWorker with ProducerConsumerQueue 2014-06-30 14:44:52 +02:00
leak
bf6e58b8d4 Ditched ACE_Singleton in favor of C++11 like Singleton 2014-05-31 15:58:59 +02:00
leak
b520f7da01 Damn you VS default settings.. 2014-05-30 15:46:17 +02:00
leak
5a363ee0e1 Replace authserver ACE related code with Boost/C++11 2014-05-30 14:54:56 +02:00
leak
35c2e97207 Replace ACE signal handling with Boost 2014-05-13 22:41:59 +02:00
Gacko
1b2e4d8110 Remove whitespaces from previous commit 2014-02-05 17:49:04 +01:00
Gacko
d0c9970be0 Authserver / Worldserver: Fix warnings about unused variables 2014-02-05 17:33:28 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
jackpoz
2a7f03039d Core/Misc: Fix warnings
Fix warnings appearing with -Wstrict-aliasing flag.
2013-12-28 17:24:43 +01:00
Spp
94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
Chaplain
aa8bfeec4f Auth/Misc: Code cleanup.
*Random performance optimizations
2013-09-02 19:40:31 +03:00
Nay
1bb3c4a2b4 Misc: Fix warnings and build
Closes #10396
2013-07-29 14:24:53 +01:00
Nay
3330239a02 Servers: Fix typo 2013-07-28 20:12:06 +01:00
Nay
e3f7be12ef Servers: Enable UseProcessors and ProcessPriority settings to be used on Linux 2013-07-28 18:58:12 +01:00
Nay
f71d894a21 Servers: Fix some code style issues in world and authserver 2013-07-28 16:59:07 +01:00
Shauren
779a59e7e2 Core/Config: Refactored ConfigMgr
* Loading initial configuration files is now separate from loading any additional custom configs
2013-07-15 17:31:44 +02:00
Spp
d1677b2db0 Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
    Memleak fix
2013-05-13 15:07:36 +02:00
Spp
be3826825e Core/Logging: Use correct realmId when logging to DB 2013-01-16 08:59:56 +01:00
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