Commit Graph

76 Commits

Author SHA1 Message Date
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
Discover-
e190a202ca Core/CreatureAI: Implement an OnSpellClick hook instead of the ugly way that uses DoAction with EVENT_SPELLCLICK.
Core/SmartAI: Implement SMART_EVENT_ON_SPELLCLICK. Parameter is the clicker.

If someone could update the wiki accordingly for SAI I would appreciate that. Thanks to @Shauren for some help!
2012-06-19 00:07:20 +02:00
Nay
d61f9fb40c Fix build in GCC
Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-17 22:11:27 +01:00
Nay
8c16cc2260 Core/SAI: Implement SMART_EVENT_ACTION_DONE (72, DoAction)
Param1 is event id
This event is triggered on spellclick (id=1001), fall on ground (id=1002) and charge (id=1003)

Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-17 21:50:01 +01:00
Shauren
28f8e42a69 Core/AI: Added EventInform hook for GameObjectAI and implemented it in SAI 2012-06-11 11:10:46 +02:00
Nay
cffcf633c3 Core/SAI: If spell id in SMART_ACTION_REMOVEAURASFROMSPELL is 0, remove all auras instead
Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-02 14:29:15 +01:00
Nay
7661858ac0 Core/SAI: Few changes to db data validation for actions and event flags 2012-05-20 16:13:52 +01:00
Gyx
1544b208da Core/Game: Code style again.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-28 20:00:29 +08:00
Nay
729f419af1 Core/DBLayer: Correct few more wrong read types (No. 4)
DB/World: Some consistency in the ints "length" field (not really a length)

All world dbs checked
2012-03-27 21:36:16 +01:00
Shauren
e64d1d43dd Core: Add proper cleanup at exit for smart script waypoints and instance encounters 2012-03-24 18:42:35 +01:00
Shauren
254256668b Core: Fixed compile without PCH 2012-03-01 23:45:07 +01:00
Spp
3e622ee7ac Core: Minor cleanup in ObjectMgr and warning fixes 2012-02-27 11:08:34 +01:00
Shauren
dc28b92415 Core: Random cleanup + compile fix 2012-02-23 13:01:16 +01:00
click
5411e1ce52 Core: Clean up whitespace and tabs in the base sourcetree 2012-02-18 16:52:08 +01:00
Subv2112
f4778a6b72 Core/SAI: Add the new action_types to the IsEventValid case check 2012-01-22 10:02:31 -05:00
Vincent-Core
c37afafbbf Core/SmartAI: Fix target type SMART_TARGET_INVOKER_PARTY 2012-01-22 01:49:53 +01:00
Subv2112
aaa255b83d Core/SAI: Implemented SMART_EVENT_GO_STATE_CHANGED and SMART_ACTION_GO_SET_LOOT_STATE
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2012-01-06 11:09:01 -05:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
leak
73cf793e56 Core/DBLayer: Refactor prepared statement defines Note:
The new format for the middle section is a 3-letter upper case abbreviation of the sql command being executed (select -> SEL, update -> UPD, etc.)
{DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
2011-12-31 20:14:38 +01:00
Subv2112
c145c67331 Core/SAI: Enabled SMART_TARGET_STORED
Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
2011-12-27 20:23:55 -05:00
Machiavelli
aefbc5701c Core/SAI: Remove an improper value in case switch.. no idea when/how/why that got there, but it's conflicting with recent changes. 2011-12-11 19:04:21 +01:00
Machiavelli
1b2c413933 Core/SAI: Preliminary implementation of SMART_EVENT_GAME_EVENT_START and SMART_EVENT_GAME_EVENT_END {param1: game_event.entry} 2011-12-11 16:23:43 +01:00
kaelima
a919265623 Core/DB: Fix character creation in Player::SaveToDB.
And some misc comments/whitespaces
2011-11-26 01:53:44 +01:00
kaelima
3d4d147196 Core/SmartAI:
- Drop useless actions SMART_ACTION_ENTER_VEHICLE, SMART_ACTION_LEAVE_VEHICLE and SMART_ACTION_REMOVE_PASSENGERS.
(Vehicles are aura-driven, just remove or add the proper aura to achieve the same as these actions did)
- Fixed possible crash in SMART_ACTION_SEND_GOSSIP_MENU
- Areatriggers should not be triggered by dead players
2011-10-31 02:01:17 +01:00
Nay
f17879d423 Core/SAI: Add input validation (params) to certain target types and update target comments 2011-10-30 13:12:39 +00:00
kaelima
f958fdf246 Core/SmartAI: Add actions SMART_ACTION_LEAVE_VEHICLE and SMART_ACTION_REMOVE_PASSENGERS.
Fix maxdist for SMART_TARGET_CLOSEST_PLAYER.
2011-10-25 23:50:00 +01:00
kaelima
3a3af64f68 Core/SmartAI:
- Fixed some issues with SMART_ACTION_SET_FLY (#1073)
- Fixed allowing 0 as input for  SMART_EVENT_ACCEPTED_QUEST and SMART_EVENT_REWARD_QUEST (#2680)
- Some cleanup
2011-10-24 23:21:34 +01:00
Geekotron
c2125ece3b Core/SAI: Add SMART_ACTION_SEND_GOSSIP_MENU.
It allows the scripter to change the gossip (and gossip menu option) of a creature with SAI
Param1 = `gossip_menu`.`entry`
Param2 = `gossip_menu_option`.`id`
2011-10-23 12:59:08 +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
Shauren
a11bee31c3 Core/SmartAI: Corrected validation check for SAI action summon, type parameter 2011-09-19 14:41:21 +02:00
Nay
fac814c87b Core/SAI: SMART_ACTION_SET_FACTION validation should check FactionTemplate(.dbc) and not Faction. 2011-08-26 17:26:51 +01:00
Fredi Machado
73b1448f29 Core/AI: English correction thanks u2blah for pointing 2011-08-21 00:07:38 -03: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
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
Jesper Meyer
b216522b3d Core/SAI: Add action SMART_ACTION_JUMP_TO_POS. 2011-07-02 07:52:03 +02:00
kaelima
d277ecc26a Core/SmartAI: Add ability to set/add/remove dynamicflags of a creature.
SmartAI Wiki is updated.
2011-06-12 17:50:23 +02:00
Shauren
339e8cb7e0 Core/SAI/EAI: Pass struct parameters by reference instead of value, saves unneeded copying 2011-05-12 10:40:53 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
leak
6d1924cee8 Removing SQLStorage class leftovers 2011-04-28 23:03:02 +02:00
leak
c51c817a45 Core/ObjectMgr: Refactor sCreatureStorage 2011-04-28 22:57:08 +02:00
leak
e2e9431ca3 Core/ObjectMgr: Refactor sGOStorage 2011-04-28 22:54:30 +02:00
Manuel Carrasco
4796848b83 Core/SAI: Implemented SMART_EVENT_IS_BEHIND_TARGET, it is triggered when the creature is behind its current target.
Signed-off-by: Manuel Carrasco <manue.l@live.com.ar>
2011-04-14 00:30:32 -03:00
Shauren
0fbde67824 Core/AI: Some code style cleanup 2011-03-27 12:54:42 +02:00
Shauren
2f79b0f266 Core: Removed all double (and more) empty lines 2011-03-21 10:52:14 +01:00
Shauren
9710c41a40 More warning fixes 2011-03-08 19:11:02 +01:00
Shauren
6c020c72cc Core/SAI: Implemented Gameobject action allowing to send SMSG_GAMEOBJECT_CUSTOM_ANIM with parameter set in param1 2011-03-02 16:50:09 +01:00
Nay
45db1591a4 DB/Schema: Properly use field types in smart_script table
Thanks Shauren
2011-02-20 19:11:42 +00:00