Commit Graph

59 Commits

Author SHA1 Message Date
Shauren
df11916ad5 Core/NetworkIO: Allow receiving packets bigger than buffer size and properly handle situations where not entire packet was read in one go
Core/Authserver: Restored authenticator functionality
2014-08-10 11:00:27 +02:00
DDuarte
a394205eca Core/Server: Add missing overrides 2014-08-09 20:17:40 +01:00
Vincent-Michael
7c6e1b1505 Revert "Core: Fix build for vs2014"
This reverts commit e303451189.
2014-08-07 21:21:19 +02:00
Vincent-Michael
e303451189 Core: Fix build for vs2014 2014-08-07 20:41:33 +02:00
Shauren
7d97b4b841 Core/Misc: Fixed textlike/hexlike methods of ByteBuffer to print properly 2014-08-06 10:00:23 +02:00
Shauren
6f272ea5b7 Core/Network: Optimized packet sending by removing unneccessary memory copying 2014-07-27 17:46:46 +02:00
Shauren
e77c0b6ed4 Core/Network: Allow storing any packet types in Socket write queue to reduce the amount of copying going on 2014-07-27 14:59:46 +02:00
Subv
0db743c4ff Merge branch 'master' of github.com:TrinityCore/TrinityCore into boost
Conflicts:
	src/server/authserver/Server/AuthSession.cpp
	src/server/game/Server/WorldSession.h
	src/server/shared/Packets/ByteBuffer.cpp
	src/server/shared/Utilities/Util.h
2014-06-23 16:35:54 -05:00
leak
7dd6f0f1d8 Replaced all ACE_OS::localtime_r calls 2014-06-22 15:42:46 +02:00
leak
ccf3374e49 Removed ACE dependies from ByteBuffer 2014-06-21 20:21:33 +02:00
Vincent-Michael
1d39db16b9 Core/Misc: Kill Whitespace ... 2014-06-07 23:58:08 +02:00
jackpoz
6a54ed88c6 Core/NetworkIO: Fix performance loss when handling bad packets
Revert f9cb4280bd which retrieved the callstack each time a ByteBufferPositionException or a ByteBufferSourceException occurred, for example with bad packet structure.
2014-06-01 00:29:33 +02:00
jackpoz
b4327bfc69 Core/Misc: Fix no-pch build 2014-05-25 15:48:06 +02:00
jackpoz
5e66253de2 Core/Misc: Throw an exception if client sends invalid float/double data
Throw a ByteBufferException if client sends 1.#INF0000, 1.#QNAN000, 1.#IND0000 or other invalid float/double values.
Handle this invalid values in StaticMapTree::isInLineOfSight() to avoid triggering an assert.
Fixes #12126
2014-05-25 15:18:55 +02:00
jackpoz
5e86dea0b0 Shared/Packets: Handle crash by throwing an exception instead
Throw a ByteBufferException when trying to access the first element of an empty ByteBuffer class
2014-05-18 00:51:40 +02:00
Shauren
0f5632c70e Core/Misc: Fixed some -Weffc++ warnings 2014-04-20 16:48:35 +02:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +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
Nay
38f5c916cf Core: Fix non PCH build 2013-09-11 20:58:49 +01:00
jackpoz
9578b5f87a Core/Thread: Fix race condition converting time values to local time
Replace thread-unsafe localtime() http://www.cplusplus.com/reference/ctime/localtime/ with thread-safe portable ACE_OS::localtime_r() .

Helgrind log:
 Possible data race during read of size 4 at 0x6F183C0 by thread #1
 Locks held: none
  at 0x14E72E3: World::InitDailyQuestResetTime() (World.cpp:2772)
  by 0x14E3A01: World::SetInitialWorldSettings() (World.cpp:1790)
  by 0x101122A: Master::Run() (Master.cpp:164)
  by 0x101740C: main (Main.cpp:142)

 This conflicts with a previous write of size 4 by thread #2
 Locks held: none
  at 0x6C2D3BA: __tzfile_compute (tzfile.c:797)
  by 0x6C2D036: __tz_convert (tzset.c:627)
  by 0x164146C: LogMessage::getTimeStr(long) (Appender.cpp:23)
  by 0x1641550: LogMessage::getTimeStr() (Appender.cpp:31)
  by 0x1641722: Appender::write(LogMessage&) (Appender.cpp:80)
  by 0x1633FCE: Logger::write(LogMessage&) (Logger.cpp:83)
  by 0x16433D8: LogOperation::call() (LogOperation.cpp:29)
  by 0x16428A4: LogWorker::svc() (LogWorker.cpp:45)
2013-09-07 14:37:54 +02:00
Spp
00c1168897 Core/Misc: Remove trailing whitespace, compile warnings and minor cosmetic changes 2013-05-21 08:37:28 +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
d7d62e4248 Core: Fix compile with WITH_COREDEBUG option enabled 2013-03-26 19:34:49 +01:00
Spp
3c6c8c1117 Core/Misc: Remove the use of logging system from WPFatal (Fixes tools compile)
Closes #9501
2013-03-26 09:44:01 +01:00
Spp
1a6a23ec96 Core/Misc: Minor optimizations (+code changes to reduce differences with 4.3.4 branch)
Core/Logging: Create new logger type "Cheat". Will be used to log all cheat attempts
2013-03-25 13:26:48 +01:00
Nefarion
49fd11ab5a First step of comment style refactoring to doxygen-style. 2013-03-08 21:55:37 +01:00
Spp
fa5dd4bd4e Core/Misc: Remove some calls to const_cast 2013-01-30 08:39:06 +01:00
Spp
802657250c Core/Misc: Apply codestyle to multiple files 2013-01-14 09:50:59 +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
db4a69f773 Crash Fix after b99c347 2012-11-17 14:34:25 +01:00
Shauren
f03e650474 Core/Calendar: Fixed breaking calendar event UI after relogging 2012-09-13 16:38:18 +02:00
LordJZ
f9cb4280bd Core/ByteBuffer: Print stack trace in ByteBufferException::PrintError. 2012-08-05 00:28:23 +02:00
Spp
634776e0bc Fix compile under windows 2012-08-03 15:54:54 +02: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
Shauren
e0997874f5 Core/SpellScripts: Changed OnUnitTargetSelect hook to OnObjectAreaTargetSelect, it will now work with WorldObject instead of only Units and call it even for empty target lists 2012-06-29 21:53:35 +02:00
Shauren
5843851559 Core/DBLayer: More prepared statement corrections 2012-03-29 23:22:10 +02:00
click
45946e23ba Core: Adjust parameter output values to avoid excessive warning outputs on GCC and some other minor warnings 2012-03-04 21:38:57 +01:00
Shauren
03a7a80687 Core/Packets: Fixed exceptions being incorrectly thrown when appending empty strings to packets
Closes #5486
Closes #5495
2012-02-29 20:12:11 +01:00
teyrnon
8e18726b69 Update src/server/shared/Packets/ByteBuffer.h 2012-02-29 15:09:51 +02:00
Shauren
7eff1c8f53 Core: Build fix (for real this time) and warning fix 2012-02-29 12:02:28 +01:00
Shauren
77c848b937 Fixed build broken in 218ed813d0 2012-02-28 23:03:38 +01:00
Machiavelli
218ed813d0 Core/Misc: Add more extensive ByteBuffer exceptions to trace down seemingly random crashes. 2012-02-28 14:51:50 +01: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
9e517c963b Cosmetic: Replace "* )" with "*)" and "* /*" with "* /*" 2011-09-29 09:32:55 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Spp-
079f292b15 Core: Some more missing changes from previous commit (Pass by const reference for simple objects replaced with pass by value). Also fix unintended change 2011-08-01 14:51:44 +02:00
Spp-
acd0fc79f6 Core: Pass by const reference for simple objects replaced with pass by value 2011-08-01 14:23:27 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00