Commit Graph

45 Commits

Author SHA1 Message Date
Shauren
112bc49c9a Core/Units: Removed most calls to SendMovementFlagUpdate for creatures 2013-06-30 16:31:24 +02:00
Malcrom
66978cfc3b Core: Some function renaming. 2013-06-11 19:54:27 -02:30
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
Nefarion
49fd11ab5a First step of comment style refactoring to doxygen-style. 2013-03-08 21:55:37 +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
b5c9ab8802 Core/Misc: Reduction of header dependencies - Step II 2012-11-20 12:30:30 +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
Gyx
360014856d Core/Game: Code style.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-29 13:42:04 +08:00
Spp
f495e0efe4 Warning fixes and some random cleanup here and there 2012-03-07 14:09:18 +01:00
Shauren
dc28b92415 Core: Random cleanup + compile fix 2012-02-23 13:01:16 +01:00
Machiavelli
dbbac0bdaa Core/Movement: Implement spline movement subsystem.
Spline movement controls movements of server-side controlled units (monster movement, taxi movement, etc).
Proper implementation of effects such as charge, jump, cyclic movement will rely on it.
However, need improve our states system before.

Technical changes:

* Added linear, catmullrom and bezier3 splines which based on client's algorthims. They can be reused for proper transport position interpolation.
* Precission increased. There are no more position desync issues since client's position calculation formulas used.
* Now possible to move by paths with multiple points, send whole path to client.

--
Original author of research and implementation: SilverIce. Massive kudos.
Original port for Trinity (ref #4629) Chaplain and Venugh
With the following incremental fixes during my review:

- Restore flightmaster end grid pre-loading
- Fix uninitialized Creature::m_path_id
- Add missing trinity_string entries for .movegens command
- Fix a bug in WaypointMovementGenerator that would trigger unexpected pausing at waypoints for various amounts of time

Known issues:
- Errors like WaypointMovementGenerator::LoadPath creature XXX (Entry: YYYYY GUID: ZZZZZZ) doesn't have waypoint path id: 0.
This is caused by bad DB data. This commit didn't "break" it.

Do not forget to re-run CMake before compiling.
2012-01-14 15:36:07 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Shauren
358b33239a Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit 2011-11-23 19:17:33 +01:00
kaelima
be0b2fcf97 Core/Grid:
- Simplified CellArea calculation (Original author: SilverIce)

- Removed unused code in Cell class (Original author: SilverIce)

- Improve some Visit functions.
2011-10-19 17:40:44 +01:00
megamage
c29ff41001 Rename some classes in grid system.
Note: The naming of classes is still confusing. "cell" usually refers to class "Grid", and "grid" usually refers to class "NGrid". But it requires a lot of changes to clean this up.
2011-10-18 10:53:34 -04:00
kaelima
801ab6dd37 Core/MapScripts: Fixed SCRIPT_COMMAND_QUEST_EXPLORED again after 26869bda30. 2011-10-11 23:40:04 +02:00
megamage
3ba22d0d06 Rename Map::Add to Map::AddToMap, Map::Remove to Map::RemoveFromMap for better management. 2011-10-10 17:39:34 -04:00
Machiavelli
f266d3d957 One last culprit... 2011-10-08 14:36:38 +02:00
Machiavelli
26869bda30 Core: Fix a boatload of crashes after the mass cleanup... Thanks to Broodwyrm for spotting the culprits 2011-10-08 14:33:53 +02:00
Bootz
5b4c7783c2 REPO: Code-style clean-ups
* Fixed pMap->map
* Fixed pInstance->instance
* Fixed pInsta->instance
* Fixed pQuest->quest
* Fixed pWho->who
* Fixed pTarget->target
* Fixed pGo->go

~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
2011-10-07 19:45:43 -05:00
Bootz
81c0a3a847 REPO: code-style clean-up
* Fixed pPlayer->player
* Fixed pCreature->creature

~DevNote: codestyle for Player should be (*player), not *plr or *p...
same goes for Creatures (*creature)... more cleaning needed.
We've way too many codestyles happening here.
2011-10-07 11:08:09 -05:00
Bootz
f1ccb83dc0 REPO: Code-style change
* Fixed pUnit-unit
2011-10-07 10:48:56 -05:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Shauren
ea14e096ac Core/Entities: Vehicles should be able to be both source and target of map scripts 2011-09-06 10:33:45 +02:00
Chaplain
bea649d045 Core: cleanup.
*remove some garbage
*little bit moore const func
*fix process of args in vmap3_extractor
2011-09-01 22:38:32 +03:00
Spp-
ceefc8c3d7 Core/Misc: Replace dynamic_cast<XXX*> with proper ToXXX 2011-07-08 11:12:19 +02:00
Machiavelli
6a59d7ddc1 Core/Entities: Vehicles should be able to be the source of map scripts 2011-06-28 21:43:06 +02:00
kaelima
b9e8694540 Core: Continued cleanup
If and for whitespaces.
2011-06-12 02:30:32 +02:00
Shauren
0ad14aeafd Core/Gossip: Gossip menu items will now have constant index, allowing to properly define scripts relying on that index when mixed with conditions. Script-created menus via ADD_GOSSIP_ITEM will still have the index generated dynamically 2011-05-26 23:57:17 +02:00
Azazel
6fb2bf4224 Core: use enum InventoryResult as return type for functions working with player items.
Original patch by TOM_RUS.
2011-04-29 16:48:15 +06:00
zergtmn
1551b8a011 Core/Misc: move scheduled scripts counter to ScriptMgr (which is more logical, isn't it?) 2011-04-13 12:07:20 +06:00
Shauren
9710c41a40 More warning fixes 2011-03-08 19:11:02 +01:00
Azazel
5ddc2338a7 Core/Map scripts: make some error messages more informative and reformat code a little bit
Signed-off-by: Shauren <shauren.trinity@gmail.com>
2011-01-28 11:52:59 +01:00
Shauren
9c0cd63e93 Core/Scripts: Added wrapper method for despawning creatures DespawnOrUnsummon 2011-01-02 21:33:37 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01: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
Shauren
0f3b9019a8 Core: Get rid of dirty operator workaround for ACE_Singleton class implementation
--HG--
branch : trunk
2010-12-22 21:25:23 +01:00
Shauren
f4581f67b8 Core: Fixed uninitialized variable warnings
--HG--
branch : trunk
2010-12-14 15:58:45 +01:00
azazel
4fb572015a Core/Scripts: pass message parameter by reference in OnChat methods to make it possible to be modified inside the script.
--HG--
branch : trunk
2010-11-17 18:14:35 +06: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
click
461590832a Core: Generic cleanup (tab2spaces/whitespace removal)
--HG--
branch : trunk
2010-09-25 22:03:57 +02:00
azazel
eae0e5c822 Scripts/DB_Scripts: massive cleanup of SCRIPT_COMMAND_* related staff
* add union into ScriptInfo structure (thanks NoFantasy for the idea);
* move scripts methods from Map.cpp to new file MapScripts.cpp;
* remove magic numbers and introduce eScriptFlags enumeration.

It's just a beginning and more changes to come. Stay tuned!

--HG--
branch : trunk
2010-09-22 18:13:57 +06:00