Commit graph

72 commits

Author SHA1 Message Date
Ambal
40ef9cbf2f [11284] Implement prepared statements for INSERT+DELETE+UPDATE SQL requests. Should improve player save performance + lower MySQL server CPU usage.
Note: PostgreSQL does not have prepared statements implemented using native APIs.

Huge thanks to Undergarun, kero99 and Vinolentus.

Signed-off-by: Ambal <pogrebniak@gala.net>
2011-03-25 22:17:59 +02:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +03:00
zergtmn
ec6089bbd8 [10935] Move script calls to ScriptMgr
- Script library presence is now optional.
- Some script hooks have new names. Scripting libraries need to be adjusted accordingly.

Signed-off-by: zergtmn <zerg@myisp.com>
2010-12-29 21:48:06 +05:00
VladimirMangos
ce7b98c45e [10799] Add GetGuidStr() short call for GetObjectGuid().GetString() and use it. 2010-12-01 09:56:13 +03:00
VladimirMangos
bffc07e4bc [10689] Restore some item checkes for temporary loot case. 2010-11-07 02:20:10 +03:00
VladimirMangos
a32d68febd [10671] Convert some Unit owner/etc guids to ObjectGuid way. 2010-11-01 13:19:50 +03:00
VladimirMangos
f48e768a70 [10662] Implement partly item looting
* Not deleted normal item loot at first loot window close.
* Save current item loot content to DB for later continue looting.
* Cleanup spell effect SPELL_EFFECT_OPEN_LOCK check code
* Cleanup Player::AutoStoreLoot calls
2010-11-01 02:04:08 +03:00
VladimirMangos
46d740bbf4 [10641] Fixed use item dynamic/item proto flags.
* List its independelty. Each from this 2 fields have own flags. Cleanup lists.
* Not copy proto flags to item flags update field. This fix heroic item versions
  show in client in result mixed use ITEM_DYNFLAG_WRAPPED (0x8) with ITEM_FLAG_HEROIC (0x8)
* Update uses to proto case use for some cases where before wrongly has been used item dyn.flags
* For ITEM_DYNFLAG_UNLOCKED (0x4) set for item at unlock and check for prevent re-unlocking.
  This mostly for future case when will be implemented partly loting items support.
* For ITEM_FLAG_LOOTABLE (0x4) check loot absent or conflicting setting with containers/casted at use items.
  Report wrong cases art loading.
* Better check related loot tables content using ITEM_FLAG_PROSPECTABLE and ITEM_FLAG_MILLABLE
2010-10-25 16:27:14 +04:00
VladimirMangos
851e15c70a [10635] Convert many opcode handlers to ObjectGuid use.
Also re-enabled anticheating check for bank window open
base at .bank command access rights.
2010-10-21 10:43:14 +04:00
Schmoozerd
c44438a517 [10607] Handle GAMEOBJECT_TYPE_GENERIC at Use() to trigger despawn of GO
In addition, a check is added to prevent unexpected call to Use() at received opcode. Despawn of this type GO can then only be used with explicit call to Use()

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-10-14 14:44:57 +02:00
VladimirMangos
5e9b5a5297 [10512] Fixed cast item remove at trade enchanting in some cases
Also nit allow item use spels casts if item in trade.
2010-09-21 10:35:58 +04:00
VladimirMangos
45cdc67f58 [10338] Create Map version for GetPlayer/GetUnit fucntions
* This let make map local way access for cases when player/all units
  expected to be at same map (for scripts cases for example).
  Ofc, still exist many places where code expect world wide player search.
  Spell casting for support far target cases, groups/guilds/chat/etc packets

* Function Unit::GetUnit depricated and will removed soon.
* Function GetCreatureOrPetOrVehicle renamed to less horriable GetAnyTypeCreature name.
2010-08-10 23:22:11 +04:00
Laise
a32b3063a2 [10156] Add shared object for auras of same spell and move spell proc code to its own file, also spread procs by auras and effect indexes. 2010-07-07 19:08:26 +03:00
Laise
6bfd0aa5b5 [10079] Don't allow cancel passive spells 2010-06-19 20:52:18 +03:00
VladimirMangos
81851074ad [10075] Attempt use more expected by result buffs downranking algo.
* In small rate more fast
* Not affect non-buff ranked spells like 10909
2010-06-18 04:21:34 +04:00
VladimirMangos
07a931e141 [10074] Add IsPassive(SpellEntry*) function and use in cases wjern entry already known.
Some other small code cleanups
2010-06-18 02:17:51 +04:00
VladimirMangos
2326292981 [10059] Cleanup in Player::m_mover uses
* Also fix triggered by related checks unread packet tail spam cases.
* Fix one case when expected death at fall controlled player
  under ground has been possible avoided
2010-06-15 03:50:52 +04:00
VladimirMangos
d86dcd60d7 [9925] Add more log filters
* damage - different direct damage calculation tracing
* combat - combat state updates, roll attack result and etc
* spell_cast - spell cast progress and aura apply
2010-05-18 12:38:52 +04:00
zhenya
fd131fb408 [9867] Prevent another potion drink until combat end.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-05-11 11:29:55 +04:00
VladimirMangos
722135b326 [9838] More log filters and macro uses.
* LogFilter_Weather
* LogFilter_PeriodicAffects
* LogFilter_PlayerMoves
* LogFilter_SQLText
* LogFilter_AIAndMovegens
* LogFilter_PlayerStats
2010-05-05 18:46:10 +04:00
VladimirMangos
15dd77873e [9779] Drop trailing whitespaces. 2010-04-23 05:28:51 +04:00
VladimirMangos
c8fd454a79 [9551] Add and use PackedGuid wrapper.
Also
* use more wide bytebuff << >> operators for objects
* use at read packet faisl alsways exception way instead some time used bool results.
2010-03-08 20:23:16 +03:00
pasdVn
53623696cc [9503] Updated behavior of auto shot according to the client changes.
Signed-off-by: ApoC <apoc@nymfe.net>
2010-03-02 22:11:35 +01:00
VladimirMangos
ded1e3c263 [9475] Add and use TotemSlot enum type 2010-02-28 07:31:25 +03:00
VladimirMangos
62726741d6 [9455] Check glyph index send by client at glyph adding to prevent cheating. 2010-02-26 01:58:22 +03:00
VladimirMangos
ff8d494ed4 [9408] Add MAX_EFFECT_INDEX to enum SpellEffectIndex and use it. 2010-02-18 23:33:16 +03:00
NoFantasy
7c555add76 [9403] Replace number with enum name where explicitly used in array/other checks
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-02-17 19:07:00 +01:00
tomrus88
b85417df73 Movement packets cleanup. 2010-02-01 17:03:04 +03:00
NoFantasy
544d396beb [9205] Move script call GOHello to GameObject::Use
This provide more accurate call in case of delay use from spell effects

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-17 23:44:33 +01:00
NoFantasy
dbf0fafbfe [9182] Replace 0 with NULL in a few CastSpell calls (removed where not needed)
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-01-15 01:43:02 +01:00
VladimirMangos
fe6e2e1746 [9122] Updated copyright notice for new year.
Also fix some lost in past cases.
2010-01-08 00:02:21 +03:00
balrok
16b39c1ebf [9008] modelids for shapeshifts from dbc
this will correct some modelids:
form         old model, new model
FORM_TRAVEL: 632   --> 918      (now a bit smaller)
FORM_GHOUL:  10045 --> 25527    (whisp --> ghoul)
FORM_CREATUREBEAR: 902 --> 2281 (old brown horse -> bear)

implement shapeshift for spell 24347

this commit also
fix the errormessages with: "Race %u not found in DBC: wrong DBC files"
which were triggered from this code
and will fix the modelid for creature 2038
since it's also using a shapeshift aura and only got the horde-modelid

+ some new entries in ShapeshiftForm-enum
+ some research for the shapeshift.dbc
2009-12-16 21:09:42 +01:00
XTZGZoReX
0734adb746 [8789] Rename several singleton macros to use more consistent names.
* objmgr -> sObjectMgr
 * spellmgr -> sSpellMgr
 * WaypointMgr -> sWaypointMgr
 * poolhandler -> sPoolMgr
 * objaccessor -> sObjectAccessor
 * mapmgr -> sMapMgr
 * sInstanceSaveManager -> sInstanceSaveMgr
 * ticketmgr -> sTicketMgr
 * CreatureEAI_Mgr -> sEventAIMgr
 * auctionmgr -> sAuctionMgr
 * achievementmgr -> sAchievementMgr
2009-11-08 12:11:34 +01:00
VladimirMangos
b942616ded [8710] Make vehicle guid counter per-map local.
Also update/drop/move to Map some dependent functions.
2009-10-22 17:43:41 +04:00
VladimirMangos
308439a335 [8601] Fixed some movement *_ACK packets structure after switch. 2009-10-08 16:02:28 +04:00
tomrus88
fdc20af337 Some fixes. 2009-08-28 22:33:52 +04:00
VladimirMangos
6ced2e979d [8403] Fixed cast spell opcode parsing for some cases with additional data. 2009-08-22 04:47:21 +04:00
VladimirMangos
55a56ad71e [8383] Implement WorldSession::HandleCancelChanneling. 2009-08-18 04:13:06 +04:00
VladimirMangos
2b534cbc23 [8382] Implement ByteArray functions for skip read of fields not needed for server in received packets.
* Use this fucntions in some case.
* Change some packets to form: read fields first check later for better control recieved packets structure.
* Fix CMSG_STAND_STATE_CHANGE packet structure to more correct.
2009-08-18 03:49:50 +04:00
VladimirMangos
74d27294aa [8381] Some refactoring work in Unit::m_currentSpells code.
* Restrict access, use enum args, move some repeated code parts to function.
* Make m_selfContainer set only part of Unit::SetCurrentCastedSpell
2009-08-18 02:12:56 +04:00
arrai
a24f39a36f [8378] Use exceptions instead of explicit size checking for each packet
CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd
could crash due to the asserts in ByteBuffer.h. That was exploitable by
malicious players.
Furthermore, there were duplicate checks: Additionally to
CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye
on not exceeding the packet boundaries - just to crash the server for
sure in such a case.
To prevent memory leaks or other undesirable states, please read in
every handler all variables _before_ doing any concrete handling.
2009-08-16 23:50:22 +02:00
freghar
cd17ada2e5 [8221] Removed trailing whitespaces
With excluded dep/ - as usual.

Signed-off-by: freghar <compmancz@gmail.com>
2009-07-20 17:53:14 +02:00
VladimirMangos
0b9e41332c Allow cancel mind control spells while control target. 2009-07-07 00:12:18 +04:00
VladimirMangos
2061939428 [8019] Prevent npc spell click when player or target in combat. 2009-06-15 02:47:53 +04:00
VladimirMangos
5254a498df [8016] Work at npc click table data use.
* New fields in `npc_spellclick_spells` for allow set npc spell click mode from quest to infinity
  or to another quest, or from reward quest.
* Not expect (and forbid set UNIT_NPC_FLAG_SPELLCLICK in DB and set it at `npc_spellclick_spells` loading.
* Apply some speedups for creature checks affected by spel click state
2009-06-15 01:01:38 +04:00
VladimirMangos
07fa9cc8d7 [7983] Make static Spell::SendCastResult accessable from script DLL. 2009-06-09 14:47:28 +04:00
NoFantasy
6a1b4e5729 [7980] Implement item use target requirements store and check (new table item_required_target).
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

* Also implement this table reload
* Static Spell::SendCastResult function for call not from spell code.
  Can be also used in scripts where need send explicitly spell cast error to client.
2009-06-09 00:26:36 +04:00
tomrus88
42f8ce5f3e [7911] Applied coding style. 2009-05-29 19:07:28 +04:00
arrai
fefe56e3c5 [7776] Completed implementation of CMSG_SPELLCLICK
For vehicles, you have to add the correct SPELL_AURA_CONTROL_VEHICLE spells to
npc_spellclick_spells, otherwise you won't be able to use them
2009-05-05 18:58:58 +02:00
VladimirMangos
fc0e1ecdf1 [7690] Move GetCreature/GetGameobject to class Map.
* This let get objects at map without reference to player or another object.
* Simplify future implementation for per-map storage for like objects
2009-04-20 19:08:13 +04:00