Commit Graph
128 Commits
Author SHA1 Message Date
Vincent-Michael 5305626214 Core/Conditions: Implemented CONDITION_MAP_DIFFICULTY 2012-09-15 20:27:01 +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
Spp 8a1e7dd070 Core/Loading: Re-enable Server loading log 2012-08-16 00:23:44 +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 c8d20004a5 Core: Minor code style corrections 2012-06-30 16:07:09 +02:00
Nay e56b2cdd59 Core: Fix a few compile warnings 2012-05-20 17:58:35 +01:00
Nay 2d0e5e2e0c Core/Conditions: Add missing code for CONDITION_TITLE
DB/Char: Add changes to character base
Thanks to manuel and QAston for noticing
2012-04-08 12:56:18 +01:00
Nay 7a5f6dd198 Core/Conditions: Add CONDITION_TITLE
Original patch by svetilo12
2012-04-07 23:15:16 +01:00
Nay a92820b51c Core/DBLayer: Correct few more wrong read types (No. 1)
DB/World: Some consistency in the ints "length" field (not really a length)

From A to D world tables verified; missing all the others

int(11) -> int32
unsigned int(10) -> uint32
mediumint(8) -> int32
unsigned mediumint(8) -> uint32
smallint(6) -> int16
unsigned smallint(5) -> uint16
tinyint(4) -> int8
unsigned tinyint(3) -> uint8
2012-03-27 00:43:56 +01: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
click a153e0ca06 Core: Remove some whitespace and tabs 2012-03-07 00:05:34 +01:00
Machiavelli e2c20cca72 Core/Conditions: Small optimization in ConditonMgr, as well as proper rules for spellclick conditions in Clean(), and finally some documentation added on how to add new source types. 2012-03-01 14:43:35 +01:00
Machiavelli 8e8ff7c660 Core/Conditions: Remove some useless checks in Condition::Meets against a value that's _supposed to be_ const 0 in database. 2012-02-29 13:57:16 +01:00
Machiavelli 7567d5e359 Core/Conditions: Fix grouping for CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT
Perhaps in the future a more generic solution can be implemented to prevent lots of repetitive code
2012-02-22 11:54:01 +01:00
Spp 1e246cb66c Fix build (gcc) and fix warnings 2012-02-22 09:15:57 +01:00
QAston 18948755ca Merge. 2012-02-21 20:17:45 +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
Machiavelli 16818d7548 Core/Conditions: Convert npc_spellclick_spells data to condition system. This implements CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT (previous CONDITION_SOURCE_TYPE_UNUSED_18). Wiki needs to be updated accordingly. 2012-02-20 23:25:59 +01:00
Subv c6f4ab10e1 Core/Scripts: Fixed Thrall's weapon and shield models in Old Hillsbrad Foothills.
closes #3904

Signed-off-by: Subv <[email protected]>
2012-02-19 19:01:03 -05:00
click 5411e1ce52 Core: Clean up whitespace and tabs in the base sourcetree 2012-02-18 16:52:08 +01:00
Spp 03c34ee507 Fix a lot of warnings 2012-02-16 13:56:28 +01:00
QAston e47ec04b4d Core/Db/Conditions: Drop CONDITION_CREATURE_TARGET, CONDITION_TARGET_HEALTH_BELOW_PCT, CONDITION_TARGET_RANGE and 3rd parameter for CONDITION_AURA. Instead of those use other available conditions, which are not limited to player's selection only. 2012-02-16 13:16:43 +01:00
QAston ad6613261c Core/Db/Conditions: Drop usage of CONDITION_ITEM_TARGET and CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET and use CONDITION_SOURCE_TYPE_SPELL instead. 2012-02-16 12:09:09 +01:00
QAston de706b3211 Core/Db/Conditions: Add new condition targets for:
- CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE ConditionTarget = 1 - check vehicle
- CONDITION_SOURCE_TYPE_VEHICLE_SPELL ConditionTarget = 1 - check vehicle
- CONDITION_SOURCE_TYPE_GOSSIP_MENU = 1 - check gossip provider
- CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 1 - check gossip provider
2012-02-15 22:13:27 +01:00
Subv ded43242eb Fixed build 2012-02-14 13:53:33 -05:00
Subv 8a72aede16 Codestyle: Renamed some variables to fit codestyle, corrected order in structure/class fields to match alignment (they use slightly less memory now)
Signed-off-by: Subv <[email protected]>
2012-02-14 12:46:26 -05:00
Subv d790adefe0 Codestyle: Renamed some variables to fit codestyle
Signed-off-by: Subv <[email protected]>
2012-02-12 20:10:09 -05:00
Matthew Goff b0145e3b39 Core/Quests: Correct use of parenthesis in IsAutoComplete and IsAutoAccept
Closes #5195
2012-02-11 22:26:53 +00:00
Pitcrawler 6bb7f15092 DB/NPCs: Remaining Grizzly Hills gossips
Scripts|SAI: Convert npc_kingdom_of_dalaran_quests to SAI
Closes #4845
2012-02-11 20:01:06 +00:00
Nay 605d3ffa52 Copy paste is bad, mkay? 2012-02-11 19:51:03 +00:00
Nay 5c62fd1d6a Core/Db/Conditions: Add conditions for world state and phasemask
CONDITION_WORLD_STATE - 11 - index - value - 0
CONDITION_PHASEMASK - 26 - value - 0 - 0
Idea by @LiMCrosS
2012-02-11 19:46:41 +00:00
Subv 5d93b33f0f Fixed codestyle from last commit 2012-02-11 10:53:33 -05:00
Subv c5e2e189de Core/Conditions: Allow to set SAI conditions to both the invoker and the object using ConditionTarget column.
ConditionTarget 0 = invoker
ConditionTarget 1 = object

Signed-off-by: Subv <[email protected]>
2012-02-11 10:49:28 -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
QAston 9d455c1e6f Fix build with GCC (it seems like it doesn't allow using references to temporary objects). 2012-02-11 00:15:05 +01:00
QAston ce4a4ffe50 Core/Db/Conditions: Add ContidionTarget column which allows selection of objects which will be checked by condition, depending on SourceTypeOrReferenceId.
So far usable only with CONDITION_SOURCE_TYPE_SPELL:
ContidionTarget = 0 - check caster
ContidionTarget = 1 - check explicit target
2012-02-10 23:42:08 +01:00
QAston 46b9942f97 Core/Db/Conditions: remove ConditionValue2 parameter CONDITION_SPELL which was used for checking if player doesn't have spell and use NegativeCondition parameter instead. 2012-02-10 18:49:40 +01:00
Nay ed3e5d816a Core/Db/Conditions: CONDITION_NOITEM and CONDITION_NO_AURA became deprecated with NegativeCondition
Wiki updated.
2012-02-10 16:32:26 +00:00
QAston 586a76e3a0 Core/Db/Conditions: Add 3rd parameter to CONDITION_ITEM so it can now perform a check if item exists in bank aswell as in equipment. 2012-02-10 16:47:58 +01:00
QAston f2f1150761 Fixed build. 2012-02-10 15:43:19 +01:00
QAston 676151f6ac Core/Db/Conditions: Don't use ConditionValue3 as a reference id for template conditions - ConditionTypeOrReference serves this purpose. 2012-02-10 15:30:33 +01:00
QAston 8713b44ee7 Core/Db/Conditions: Prepare conditions system to work on objects of different type than players.
Warning: API has changed a bit:
ConditionScript::OnConditionCheck(Condition* condition, Player* player, Unit* invoker) is now
ConditionScript::OnConditionCheck(Condition* condition, WorldObject* object, WorldObject* invoker)
2012-02-10 14:18:59 +01:00
QAston e0ad0f0e8d Minor correction to a7fc2586e7 - load columns from db in the same order they're stored. 2012-02-10 12:54:34 +01:00
QAston a7fc2586e7 Core/Db/Conditions: Add NegativeCondition column to conditions table which allows to check whenever player does not meet condition specified by ConditionTypeOrReference column (ConditionTypeOrReference and ConditionValue3 set to reference id are not affected by the change) 2012-02-10 12:46:01 +01:00
QAston 0b1da6c0ad Core/Db/Conditions: update error log. 2012-02-09 18:18:06 +01:00
QAston e0c699b0f3 Core/Db/Conditions: allow CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET to be used for spells with any spell using unit as explicit target instead of just TARGET_UNIT_TARGET_ANY and TARGET_UNIT_TARGET_ENEMY. 2012-02-09 18:12:47 +01:00
Subv2112 29f8e4309e Core/Conditions: Allow using guid (negative value) in SAI conditions 2012-01-31 09:50:02 -05:00
Subv2112 74b64150bb Core/Conditions: Implemented SAI conditions, only usable with events in which the invoker is a player.
sourceType = 22
sourceEntry = entryorguid
sourceGroup = eventId + 1
sourceId = SAI sourceType (0 = creature, 1 = gameobject, etc)

Also refactored some code

Signed-off-by: Subv2112 <[email protected]>
2012-01-29 13:49:19 -05:00
Subv2112 59f378ea89 Core/Conditions: Fixed the error introduced in the previous commit 2012-01-28 12:45:27 -05:00