Commit Graph

106 Commits

Author SHA1 Message Date
Spp
b99c347747 Core: Remove Player.h dependency from all the possible headers 2012-11-17 05:18:37 +01:00
Spp
876ad50dcd Core/Misc: Tweaked ThreatContainer internals
(and many cosmetic changes here and there)
2012-10-26 14:31:19 +02:00
Spp
013fb1f4d9 Core/Misc: reduced amount of string memory allocations (Step I) 2012-10-24 15:34:48 +02:00
Elron103
46852a3808 Core/Scripting: Fix DoAction function of SummonList incorrectly removing entries in SummonList 2012-09-02 00:19:13 +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
Vincent-Michael
634b3645d5 Core/Misc: Use proper headers to optimize compile 2012-07-30 05:38:40 +02:00
Kandera
0ac9c5b039 Core/Escort: few modifications to add the IMMUNE_TO_NPC flag after npc does a full reset. 2012-07-10 17:27:13 -04:00
Kandera
450f9e7d99 Core/Escort: fix issues with escorts not attacking enemies. 2012-07-10 16:19:18 -04:00
Chaplain
716e2db0e1 Core/Misc: Code-style + some const methods. 2012-06-21 21:05:45 +03:00
Elron103
f3aacb669c Scripts/Miscellaneous: Enable const-ness for various functions in ScriptedAI (Author: DorianGrey)
- Improve codestyle, since objects internal state is not changed here
- Make these functions available for inherited CanAIAttack() function
2012-06-20 21:29:41 +02:00
Chaplain
469ba0b0e7 Clean up for 58f63509cd
*restore const methods in spellauraeffects
*fix typo in Unit::CalculateMeleeDamage thx bytewarrior
*minor speed up in SpellInfo::GetMaxTicks() thx Warpten
*deleted duble ';;' thx bytewarrior
*speed up in SpellInfo::GetMaxTicks() thx goes to Vincent-Michael
2012-05-10 20:42:07 +03:00
kaelima
71bf2684be Core/Script: Use DoMeleeAttackIfReady in default ScriptedAI::UpdateAI method (fixes offhand attacks if not UpdateAI is overridden) 2012-04-12 17:53:52 +02:00
faramir118
e3f198ca56 couple wrong return types 2012-04-11 19:58:12 +02:00
kaelima
4c961ff393 Core/Scripts: Remove some unnecessary creature/player casts in scripts and do some safer casting in a silithus script 2012-04-09 14:28:46 +02:00
Machiavelli
bc96df1aae Core/Shared: Move container functions to shared project under Trinity::Container namespace. Also implement RandomResizeList which takes a predicate function as parameter.
Core/ScriptedAI: Extend SummonList::DoAction to take a predicate function as parameter and allow specifying a maximum number of units to be selected.
2012-04-08 17:40:05 +02:00
Gyx
a1c4786ba0 Core/Script: Code style and some rewriting.
MoveInLineOfSight(Unit* unit) -> MoveInLineOfSight(Unit* who)

Signed-off-by: Gyx <2359980687@qq.com>
2012-04-01 19:56:41 +08:00
Machiavelli
03a24a84e4 Core/Units:
- Implement UNIT_FIELD_HOVERHEIGHT (requires DB data). This field, sent in update object packet, will determine the height at which a creature hovers if it has movementflag_hover applied. Note that hovering will now update the server-sided z-coordinate by the value of this field, and that all subsequent positional updates to the client will need to send z coordinate MINUS the hover height offset, or the hoverheight will be visually doubled client side.
- Correct our usage of movementflag_flying, movementflag_can_fly, movementflag_hover and movementflag_disable_gravity (previously levitate), and how they relate to InhabitType in the database. This fixes "flying creatures on steroids" bug (wings flapping too fast), and potentially a lot of visual issues in AI scripts. Note that a lot of scripts still set wrong movementflags, these need to be fixed on a case by case basis.
- Send correct packets for SPELL_AURA_FEATHER_FALL, SPELL_AURA_WATER_WALK and SPELL_AURA_HOVER apply/unapply.
- Send correct packet contents for movement update in Unit::SetSpeed.
- Misc. cleanup in affected scripts.
2012-03-12 00:53:45 +01:00
Nay
2b2d054f64 R.I.P SimpleAI
- Convert SimpleAI to (DB) SmartAI
- Spell ids corrected (and completed some of the scripts)
- Random cleanup (code style) in some scripts
2012-03-11 16:59:17 +00:00
Shauren
f85fdbebe7 Core/DBC: Remove store getters (useless since we don't have scripts as external dll) 2012-03-10 20:53:26 +01:00
Spp
d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +01:00
Venugh
1cac01b3df Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit. 2012-02-23 11:50:58 +01:00
Shocker
08be716ef8 Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_* 2012-02-03 19:02:17 +02: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
Valcorb
ed27fb6d7d Update the rest of the headers 2012-01-13 16:58:48 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Spp
d59c5e627f Fix warnings 2011-12-15 11:12:15 +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
megamage
d156e066cf Rename "SetPosition" to "UpdatePosition".
Replace CreatureRelocation in scripts with new Creature::SetPosition.
2011-10-10 17:08:01 -04: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
Shauren
2ff1c28c4c Scripts/Icecrown Citadel
* The Lich King
2011-10-05 20:48:34 +02: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
Souler
99c63e86ae Scripts/Ulduar: Make XT-002 and Ignis enter evade mode if pulled out from their fight areas.
Also implement a default case for EnterEvadeIfOutOfCombatArea.
2011-09-22 22:14:52 +02:00
QAston
ec7da6f911 Core/ScriptedAI: remove ScriptedAI::CanCast function which is not functioning properly (compare that func with Spell::CheckCast to see how it should work) and is unused. Closes #2275. 2011-09-12 00:20:37 +02:00
Shauren
f13f32c972 Core/Achievements: Award normal mode achievements when instance was done on heroic mode 2011-09-05 15:21:37 +02:00
Fredi Machado
78e10e9cd0 Core/AI: Cleaning up hungarian notation 2011-08-20 20:31:31 -03:00
Fredi Machado
0b64d726c2 Core/AI: Code style and cleanups 2011-08-18 14:55:59 -03:00
Machiavelli
58f10c74f7 Core/Spells: Change low level bool triggered with bitmask TriggerCastFlags to better manipulate the behaviour of certain triggered spells. 2011-07-31 21:58:25 +02:00
Spp-
fa50c0a464 Fix some warnings here and there 2011-07-27 11:00:39 +02:00
QAston
b0fe236265 Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo
*GetSpellProto is now GetSpellInfo
*SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].*
*sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo()
*SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff()
*SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class.
*GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections
*code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
2011-07-26 23:09:28 +02:00
kaelima
b9e8694540 Core: Continued cleanup
If and for whitespaces.
2011-06-12 02:30:32 +02:00
click
c77aa6e846 Core: And some more cleanups... 2011-06-12 02:00:43 +02:00
click
f16df538ee Core: More codestyle cleanups 2011-06-12 01:47:45 +02:00
click
158966dc79 Core: Codestyle cleanup 2011-06-11 22:35:29 +02:00
click
df20ba9956 Core/AI: Fix previous commit (467f33e) 2011-05-28 02:14:47 +02:00
click
467f33e3d9 Core/AI: Minor adjustment on the WorldBossAI : Avoid putting the entire map in combatmode... 2011-05-28 01:24:27 +02:00
click
fac7534611 Core/AI: Add WorldBossAI for world-side (non-instanced) bosses (essentially a stripped version of BossAI) 2011-05-28 00:28:04 +02:00
click
2d1b3ccaa1 Compile warnings fixes 2011-05-27 14:45:44 +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
Shauren
a644206f88 Scripts: Removed SEND_VENDORLIST and SEND_TRAINERLIST defines 2011-05-26 23:31:46 +02:00