Commit Graph

177 Commits

Author SHA1 Message Date
kaelima
a2d533752c Core/MMaps: Add several safety checks to confirm a valid path generation.
- Address some issues in TargetMovementGenerator. Thanks Chevron
2012-09-07 04:21:11 +02:00
Nay
e3d9768a50 Core: Fix many "errors"/warnings and coding style (3)
Game

Errors were found using Cppcheck, open-source static analysis tool
2012-08-30 22:44:33 +01:00
Vincent-Michael
6891fe6248 Core/Battlefield: Add missing stuff for wintergrasp 2012-08-21 23:03:30 +02:00
Kandera
b9f60fe56c Core/Wintergrasp: finish implementation for battlefields. this is highly experimental enable at you're own risk. will almost definatly cause issues with the wintergrasp patch floating around 2012-08-20 16:23:24 -04:00
Manuel Carrasco
d7a7a9800b Battlefield: Make sBattlefieldMgr a pointer. By Subv. 2012-08-20 13:48:47 -04: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
Spp
5a99dfad14 Warning fixes + compile fix after the merge 2012-07-30 10:07:26 +02:00
Shauren
47054e6bc1 Build fix without pch 2012-07-22 14:40:41 +02:00
Shauren
1fd37ac61b Core/Object: Use updatefield flags extracted from client to determine whether to send or not a field value instead of sending all data to client for non-player objects 2012-07-22 14:20:26 +02:00
Chaplain
716e2db0e1 Core/Misc: Code-style + some const methods. 2012-06-21 21:05:45 +03:00
kaelima
c9efe05751 Core/Visibility: Change the default visibility distance for instances and battlegrounds to blizz-like values. 2012-06-03 05:36:27 +02:00
Vincent-Michael
ab77e597b1 Add function for SetObjectScale
Author: NoFantasy
Source: Mangos
2012-05-26 23:14:57 +02:00
QAston
b53485e053 Fix build and correct minor codestyle issue. 2012-04-28 15:10:52 +02:00
QAston
06923e21e8 Merge pull request #6239 from The-Game/master
Core/Spell: Fix unit tracking to not being limited to the caster of SPELL_AURA_MOD_STALKED.
2012-04-28 04:56:58 -07:00
The Game
9320131892 Check if unit has UNIT_DYNFLAG_TRACK_UNIT before checking auras to prevent prevent unnecessary operations, thanks you QAston for suggesting. 2012-04-24 13:11:22 -04:00
Shauren
4818c70dcb Core/Spells: Removed unneeded phase check from spell casts, its already done in canSeeOrDetect for spells that need it. Probably more phase checks are not needed either 2012-04-18 22:27:40 +02:00
The Game
7dc228ea54 Fix code style, thanks Discover. 2012-04-18 13:39:07 -04:00
The Game
3bfe59b41d Fix unit tracking to not being limited to the caster of SPELL_AURA_MOD_STALKED, fixes https://github.com/TrinityCore/TrinityCore/issues/6208 2012-04-17 11:40:58 -04:00
Shocker
b4341413e5 Merge pull request #5648 from Elron103/pull-requests
Core/Misc: Add a validity check for coordinates, prevents possible crashes with invalid coordinates
2012-04-10 17:15:24 -07:00
kaelima
49e24e2dfb Core/Cleanup:
Mostly if(.. -> if (.. and for(.. -> for (..
but also some miscellaneous cleanup
2012-04-08 23:59:52 +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
click
280f88db6b Merge pull request #5649 from Elron103/pull-requests2
Core/Movement: Fix random position finding near edges, avoid big z-coordinate differences
2012-03-30 18:14:58 -07:00
Gyx
5b7493fc66 Core/Misc: Code style and remove unused define.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-29 14:43:34 +08:00
Gyx
360014856d Core/Game: Code style.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-29 13:42:04 +08:00
Gyx
1544b208da Core/Game: Code style again.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-28 20:00:29 +08:00
Machiavelli
41cc704bf8 Core/Movement:
- Don't abort relocation if movementflag restrictions were violated. There might be lag between client and server and even different parts of the core that made this approach improper.
- MOVEMENTFLAG_ROOT cannot be used in conjunction with MOVEMENTFLAG_MASK_MOVING, but it's a valid flag to receive from client.
- Fix falling to ground when unapplying fly/waterwalk aura. NOTE: This is a client-side initiated fall, in the future this should be initiated and updated by the server. (Working on it)
- Rename MOVEMENTFLAG_FALLING to MOVEMENTFLAG_FALLING_FAR
- Rename MOVEMENTFLAG_JUMPING to MOVEMENTFLAG_FALLING

Closes #5751
2012-03-17 20:36:12 +01:00
Machiavelli
65453620e8 Core/Movement: Do not process server side relocation if reading movementinfo from client resulted in violations (= hacking). 2012-03-16 18:15:08 +01:00
Shauren
671fd4176a Core/GameObjects: Chests will now remain locked for players who left the group if loot from that boss is stored in it (note: this is just an implementation of locking the chest, they still need to be linked to a boss - not yet implemented) 2012-03-12 18:07:34 +01: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
Elron103
51e3a687d5 Core/Movement: Fix random position finding near edges, avoid big z-coordinate differences 2012-03-11 15:50:41 +01:00
Elron103
e36027e90b Core/Misc: Add a validity check for coordinates, prevents crashes 2012-03-11 15:45:21 +01:00
kaelima
b27bd661f0 Core/Object: Correct the updateflag order in SMSG_UPDATE_OBJECT. 2012-03-01 12:12:35 +01:00
kaelima
eb1a2a3672 Core/Object:
- Corrected the flag and use of UPDATEFLAG_LOWGUID.
- Send proper positions for objects on transports.
- Rename UPDATEFLAG_HAS_POSITION -> UPDATEFLAG_STATIONARY_POSITION
- Added some comments
2012-02-29 12:43:59 +01:00
Spp
d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +01:00
QAston
f09b5a6bea Core/Db/Conditions:
-Drop condition CONDITION_SPELL_SCRIPT_TARGET, use other condition types instead
-Change CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET to CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
--allow using this condition for more spell implicit target types (not just ENTRY)
--SourceGroup value for this src type is now effMask and it's now required

Core/Spells: Unify the way implicit targets are handled, fully implement some partially implemented target types, fix some minor bugs found on the way, general improvements and cleanup.
2012-02-21 20:17:45 +01:00
Subv
ff9830c18d Core/Spells: Blink wont be able to trespass solid objects anymore (walls/doors)
Refactored some code

Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-02-11 19:23:18 -05:00
QAston
784d58c023 Core/Db/Conditions: Add new condition types:
- CONDITION_OBJECT_ENTRY
- CONDITION_TYPE_MASK
- CONDITION_RELATION_TO
- CONDITION_REACTION_TO
- CONDITION_DISTANCE_TO
- CONDITION_ALIVE
- CONDITION_HP_VAL
- CONDITION_HP_PCT
2012-02-11 15:17:33 +01:00
Subv
9791bb599a Merge pull request #5160 from TrinityCore/dynamic_vmaps
Added Dynamic Vmaps, RE-EXTRACT YOUR VMAPS
2012-02-09 11:17:05 -08:00
Subv2112
93d199f043 Core/Collision: Ported dynamic line of sight patch by Silverice from MaNGOS and
added lots of improvements
Please re-extract vmaps
2012-02-09 13:58:22 -05:00
QAston
012be16796 Merge pull request #4726 from ille/baa2252bd31718e93ccc3e97aa81afeecb5ec9c3
Core/GameObject: implement stealth/invisibility for traps
2012-02-09 09:38:13 -08:00
Shocker
08be716ef8 Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_* 2012-02-03 19:02:17 +02:00
Subv2112
953587abdb Fixed build 2012-02-02 13:15:44 -05:00
Subv2112
8dc75e7091 Codestyle: Converted some casts to their respective ToClass() 2012-02-02 13:03:54 -05:00
Subv2112
f525087538 Core/Movement: Correctly fixed flying npcs falling to ground, no more glitches with this
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-29 15:28:19 -05: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
ille
baa2252bd3 implement objectdetection 2012-01-08 18:22:46 +01:00
elecyb
6b35b76fba Core/Spells: Some corrections after 65aca2b806, this should fix the console spam 2012-01-03 16:34:05 -03:00
elecyb
993c4e748f Core/Spells: Update nearby visible objects for new viewpoints, fix spells with Far Sight and Bind Sight effects. 2012-01-02 16:33:14 -03:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Spp
c1513b2c05 Warning fixes 2011-12-28 11:00:27 +01:00