Commit Graph

225 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
Vincent-Michael
634b3645d5 Core/Misc: Use proper headers to optimize compile 2012-07-30 05:38:40 +02:00
Santiago
c7a0378a82 Core/SAI: Added new parameter to actions 90 and 91
Allows to set and remove all possible bytes1 based on `type` parameter
You can see them listed in Unit.h for reference
2012-07-21 01:29:15 -03:00
Shauren
577d5b4fd1 Core/SmartScript: Corrected size of pointId parameter for MOVE_TO_POS SAI action 2012-07-03 16:22:14 +02:00
Shauren
ea9339b171 Core/SmartAI: Fixed SMART_ACTION_SET_RANGED_MOVEMENT parameters 2012-06-23 12:15:52 +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
53b561f550 Core/SAI: Remove some unused conditions related code
SAI conditions were implemented in a different way than initially planned

Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-18 00:42:37 +01:00
Nay
0e4d6bf4df Missing break on 8c16cc2260
Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-17 23:13:48 +01: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
15eb5f0749 Core/SmartAI: Allow calling talk action on targeted creature even if scripted object itself is not a creature 2012-06-12 22:22:18 +02:00
Subv
38f6f9d8cb Core/SAI: Missing change from previous commit 2012-06-11 11:15:33 -05:00
Shauren
28f8e42a69 Core/AI: Added EventInform hook for GameObjectAI and implemented it in SAI 2012-06-11 11:10:46 +02:00
Subv
089b0a44d7 Core/SAI: Fixed the cage GameObject template script, the script should start when the gameobject is activated, not in gossip hello 2012-06-07 08:09:16 -05:00
Discover-
19dbfbeb62 Core/SAI: Fixed a mistake in SMART_TARGET_INVOKER_PARTY which made it add the same player to the targetlist twice if there was a group. 2012-06-04 17:20:40 +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
Discover-
1b77fd45fa Core/SAI: Revert SMART_ACTION_SET_STAND_STATE from 013fe44b92, can be done with SMART_ACTION_SET_UNIT_FIELD_BYTES_1. 2012-05-30 01:00:55 +02:00
Discover-
154a030a68 Core/SAI: Fix previous commit. Thanks Shauren for notifying. 2012-05-29 12:29:10 +02:00
Discover-
013fe44b92 Core/SAI: Implement SMART_ACTION_SET_RANGED_MOVEMENT (79) and SMART_ACTION_SET_STAND_STATE (101). Updated wiki accordingly. These were required in order to properly be able to convert EventAI to SmartAI. 2012-05-29 12:19:46 +02:00
Nay
66ce5a1148 And I forgot to Ctrl+S, yay me. 2012-05-20 16:36:44 +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
kaelima
c3287fee06 Core/SmartAI:
- Improve an error msg in ProcessAction
- Allow dist/angle to be 0.0f and set default if negative when using SMART_ACTION_FOLLOW
- Some minor cleanup in Opcodes.cpp, all smsg's should have Handle_ServerSide
2012-05-19 13:04:58 +02:00
Subv
50f2be538c Fixed build 2012-04-19 18:43:41 -05:00
Subv
a5aba350a0 Core/SmartAI: Allow SMART_ACTION_SUMMON_GO and SMART_ACTION_SUMMON_CREATURE to use x, y, z and o parameters as relative offsets for a summoning position (example, summon creature 20 yards in front of the invoker)
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-04-19 18:33:25 -05:00
Shauren
4f14693ef2 Core/Scripts: Corrected previous commit and added a few AI hooks to GameObjectAI 2012-04-14 18:26:16 +02:00
Shauren
b5dc7bc45b Core/SmartScript: Fixed crashes with stored target lists
Closes #5786
2012-04-05 22:13:20 +02:00
Subv
6759bcab16 Core/SAI: Added a new event flag to allow events to NOT reset when the creature evades (SMART_EVENT_FLAG_DONT_RESET)
Closes #5568

Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-04-05 12:10:56 -05:00
Shocker
a08cb234c0 Merge pull request #5918 from GyxTom/master
Core/Misc: Various cleanups
2012-03-28 18:00:42 -07:00
click
cf29214364 Core/AI: Fix some wannabe-invinceable typos here and there... 2012-03-29 00:47:56 +02:00
kandera
d94608777c Core/Scripts: Fix invincibility hp level for smart scripts. 2012-03-28 19:21:40 -03:00
Gyx
1544b208da Core/Game: Code style again.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-28 20:00:29 +08:00
Gyx
72cdcbfced Core/Game: Code style.
Signed-off-by: Gyx <2359980687@qq.com>
2012-03-28 19:11:50 +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
Subv
ac4536327f Core/SAI: Allow using SMART_TARGET_ACTION_INVOKER with SMART_ACTION_MOVE_TO_POS
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-03-21 19:37:21 -05:00
Shauren
90cacb9ab9 Core/SmartScript: Fixed possible crashes when attempting to use StoreTargetList with a the same list already stored on the same id 2012-03-19 11:43:50 +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
Discover-
c4fd6b89db Core/SAI: SMART_ACTION_MOVE_TO_POS will now have param1 as PointId. This means you can now (properly) use SMART_EVENT_MOVEMENTINFORM when reaching the point you make the NPC move to.
Wiki is updated accordingly.
2012-03-03 23:41:29 +01:00
Shauren
254256668b Core: Fixed compile without PCH 2012-03-01 23:45:07 +01:00
Shauren
09f0a2c04f Core/CreatureTextMgr: Added support for creature_text localization 2012-03-01 22:26:05 +01:00
Spp
d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +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
Venugh
5416b734e4 Core/Movement: Use SetLevitate(true/false) instead of AddUnit/RemoveUnit. 2012-02-23 12:32:21 +01:00
Venugh
1cac01b3df Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit. 2012-02-23 11:50:58 +01:00
Spp
1e246cb66c Fix build (gcc) and fix warnings 2012-02-22 09:15:57 +01:00
Subv
25d9e2ec29 Core/SAI: Implemented SMARTCAST_AURA_NOT_PRESENT as castflag, the spell will only be casted if the target does not have the aura
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-02-18 19:10:18 -05:00
click
5411e1ce52 Core: Clean up whitespace and tabs in the base sourcetree 2012-02-18 16:52:08 +01:00