Commit Graph

171 Commits

Author SHA1 Message Date
Vincent-Michael
57e9a97bc4 Core/Map: Kill Engrish (thx Takenbacon)
Closes #8574
2012-12-06 11:27:46 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Spp
b5c9ab8802 Core/Misc: Reduction of header dependencies - Step II 2012-11-20 12:30:30 +01:00
Spp
b99c347747 Core: Remove Player.h dependency from all the possible headers 2012-11-17 05:18:37 +01:00
ille
9ee32331d7 use Thread-Safe Interface design pattern to allow recursive calls on non windows os
described here http://wiki.hsr.ch/PnProg/files/ThreadSafeInterface.pdf
http://www.aoc.nrao.edu/php/tjuerges/ALMA/ACE-5.5.2/html/ace/classACE__Thread__Mutex.html#_details
recursion in :
EnsureGridCreated() -> LoadMapAndVMap() -> LoadMap() -> EnsureGridCreated()
2012-11-03 15:48:27 +01:00
Spp
013fb1f4d9 Core/Misc: reduced amount of string memory allocations (Step I) 2012-10-24 15:34:48 +02:00
Spp
67a03027ae Proper naming of LfgDungeon structures 2012-10-19 17:47:51 +02:00
Spp
d0334bf948 Core/Dungeon Finder: Some optimizations.
- Store teleport coordinates to avoid recalculations each time someone has to be teleported
- Correct teleport error msg when player is charming or using vehicle
- Internal changes in storage types
- Proper code for missing achievement lock type
- Better debug msgs
- Trying to get rid of "Player*" and "Group*" inside LFGMgr as much as possible (Step 1)
2012-10-18 09:15:10 +02:00
Kandera
21164bd93d Core/Maps: fix being able to be ported to an instance while in a group with a temporary save. was causing some issues. 2012-10-05 13:34:32 -04:00
Vincent-Michael
06eff1644d Core/Vehicles: Fix warnings 2012-09-10 15:44:12 +02:00
Shauren
1e9fc84a12 Core: Warning fixes
C4100: 'x' : unreferenced formal parameter
C4310: cast truncates constant value
C4389: '==' : signed/unsigned mismatch
C4668: 'x' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C4701: potentially uninitialized local variable 'x' used
C4826: Conversion from 'HMODULE' to 'DWORD64' is sign-extended. This may cause unexpected runtime behavior.
C6067: Parameter '3' in call to 'sprintf' must be the address of the string
C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'CloseHandle'
2012-09-04 14:40:41 +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
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
Chaplain
716e2db0e1 Core/Misc: Code-style + some const methods. 2012-06-21 21:05:45 +03:00
Shauren
32aa983fe2 Core/Maps: Fixed possible crash when resetting instances 2012-06-08 14:52:52 +02:00
Shauren
c7775c8d72 Core/Maps: Moved object respawn time storage from global to map level. This removes unneccessary locking since all objects run within its map's thread. 2012-06-07 23:20:57 +02:00
Nay
e56b2cdd59 Core: Fix a few compile warnings 2012-05-20 17:58:35 +01:00
kaelima
49e24e2dfb Core/Cleanup:
Mostly if(.. -> if (.. and for(.. -> for (..
but also some miscellaneous cleanup
2012-04-08 23:59:52 +02: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
leak
cd52a9aacf Core: I herd you like semicolon.. 2012-03-24 15:54:45 +01:00
leak
09dcee9867 Core: Fix warnings properly 2012-03-24 15:50:18 +01:00
leak
3d0063abee Core: Fix warnings 2012-03-24 15:37:54 +01:00
leak
12e55a04bb Core/DBLayer: Convert PQuery() queries to prepared statements 2012-03-24 01:25:08 +01:00
kaelima
6217583627 Core/Map:
- Remove mysterious restriction in visibilityhelper for gameobjects
- Some cleanup in CheckAreaExploreAndOutdoor() and GridDefines.h
- Set nocreate for cells visited in Map::VisitNearbyCellsOf
2012-03-12 04:33:24 +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
Shauren
e5d23103f3 Core/Maps
* Corrected liquid type extraction in maps - MCLQ chunk must be parsed together with MH2O (they stack)
* Fixed liquid detection in WMO objects
* Implemented LiquidType.dbc use, players will now get proper auras in special liquids
* Turned off slime damage by default (Naxxramas uses periodic damage aura for this purpose)
* Implemented liquid type overrides basing on area/zone
* Renamed final temp_gameobject_models to GameObjectModels.dtree (the temporary one produced by vmap extractor remains unaffected)

Note: Map and Vmap re-extraction is required
2012-03-07 13:09:35 +01:00
Machiavelli
6bb689b494 Core/Units: Properly update passenger position if vehicle uses waypoint movement. Fixes e.g. Icefang path 2012-03-01 17:06:41 +01:00
Shauren
a934abbbb7 Core/Calendar
* Added sending SMSG_CALENDAR_RAID_LOCKOUT_REMOVED when instance save is removed
* Refactored sending SMSG_CALENDAR_RAID_LOCKOUT_ADDED/REMOVED into separate method
2012-02-24 19:31:40 +01:00
Shauren
9c3357c1de Core/Calendar
* Fixed raid resets display in calendar
* Active instance locks will now be added to calendar as soon as they are created (not after login)
2012-02-24 19:06:53 +01:00
Spp
1e246cb66c Fix build (gcc) and fix warnings 2012-02-22 09:15:57 +01:00
Subv
8660f20703 Merge pull request #5290 from kandera/fix_blink
fix blink making you fall under ground when blinking into water (needs c...
closes #5289
2012-02-18 04:36:23 -08:00
Kandera
e277588689 fix blink making you fall under ground when blinking into water (needs correct liquid level calculations) 2012-02-17 14:25:08 -05:00
leak
ba4d1c36f1 Core/Maps: Remove redundant if() 2012-02-16 16:17:56 +01:00
Spp
03c34ee507 Fix a lot of warnings 2012-02-16 13:56:28 +01:00
Subv
f8df838db9 Fixed build, thanks Amit86 for noticing 2012-02-14 13:47:35 -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 <s.v.h21@hotmail.com>
2012-02-14 12:46:26 -05: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
kaelima
03b2717931 Core/Map:
- Fixed crash when a player was disconnected during a transfer to another map.
- Only call OnPlayerLeaveMap if player is removed from map. (Ty QAston)
2012-02-10 12:43:13 +01: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
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
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
megamage
ce0dfa88a6 Revert "Temp fix for *nix build."
It builds in *nix without this patch.

This reverts commit e84fffe588.
2011-12-22 10:15:17 -05:00
megamage
e84fffe588 Temp fix for *nix build. 2011-12-22 08:57:16 -05:00
megamage
8cf2062c1f Update grid system. Try to fix some crashes and transport passengers (now they are despawned after a while). 2011-12-20 17:07:09 -05:00
Shauren
b4df932e71 Core/Dungeon Finder: Implemented Luck of the Draw buff 2011-12-18 22:09:03 +01:00
Shauren
23a5c5e855 Core/Maps: Removed some incorrect checks in GetHeight, flying creatures should now fall correctly when killed 2011-12-13 18:19:25 +01:00
kaelima
11fb0beaf0 Core/Misc: Fixed some duplicate checks for player typeid in Unit::Kill and Spell::EffectSummonDeadPet. Also some random cleanup 2011-12-10 13:48:41 +01:00
megamage
cde7ea260e Make AddToMap return bool. 2011-11-28 13:23:20 -05:00
megamage
49b2407077 Add an ASSERT to find out the reasons of some crashes. 2011-11-28 11:32:52 -05:00
Shauren
358b33239a Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit 2011-11-23 19:17:33 +01:00