aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_03_31_00_world_creature_loot_template.sql191
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.cpp18
-rw-r--r--src/server/authserver/authserver.conf.dist8
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.cpp8
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp12
-rwxr-xr-xsrc/server/game/Handlers/MailHandler.cpp2
-rwxr-xr-xsrc/server/game/Tickets/TicketMgr.cpp4
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.cpp2
-rwxr-xr-xsrc/server/shared/Database/Implementation/LoginDatabase.cpp2
-rwxr-xr-xsrc/server/shared/Database/Implementation/LoginDatabase.h2
-rwxr-xr-xsrc/server/shared/Database/PreparedStatement.cpp46
-rwxr-xr-xsrc/server/shared/Logging/Log.h2
12 files changed, 262 insertions, 35 deletions
diff --git a/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql b/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql
new file mode 100644
index 00000000000..a817cdccf50
--- /dev/null
+++ b/sql/updates/world/2012_03_31_00_world_creature_loot_template.sql
@@ -0,0 +1,191 @@
+-- -------------------------------
+-- -- The Antechamber of Ulduar --
+-- -------------------------------
+-- Creatures
+SET @Brundir10 :=32857;
+call `sp_get_npc_diffentry`(@Brundir10,1,@Brundir25); -- Get 25man id using procedure
+SET @Molgeim10 :=32927;
+call `sp_get_npc_diffentry`(@Molgeim10,1,@Molgeim25); -- Get 25man id using procedure
+SET @Steelbreaker10 :=32867;
+call `sp_get_npc_diffentry`(@Steelbreaker10,1,@Steelbreaker25); -- Get 25man id using procedure
+SET @Auriaya10 :=33515;
+call `sp_get_npc_diffentry`(@Auriaya10,1,@Auriaya25); -- Get 25man id using procedure
+-- Gameobjects
+SET @Kologarn10 := 195046; -- Cache of the Living Stone 10man
+CALL `sp_get_go_lootid`(@Kologarn10,@CacheLivingStone10); -- Get Lootid from data1 field using procedure
+SET @Kologarn25 := 195047; -- Cache of the Living Stone 25man
+CALL `sp_get_go_lootid`(@Kologarn25,@CacheLivingStone25); -- Get Lootid from data1 field using procedure
+-- bosses
+SET @Assembly10Ref := 34359;
+SET @Assembly25Ref := @Assembly10Ref+1;
+SET @Kologarn10Ref := @Assembly10Ref+2;
+SET @Kologarn25Ref := @Assembly10Ref+3;
+SET @Auriaya10Ref := @Assembly10Ref+4;
+SET @Auriaya25Ref := @Assembly10Ref+5;
+
+-- ------------------------------
+-- -- Reference Loot Templates --
+-- ------------------------------
+-- Delete previous templates if existing
+DELETE FROM `reference_loot_template` WHERE `entry` IN (12019,34122,34123,34124,34163,34216);
+-- Delete the current if existing & add
+DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @Assembly10Ref AND @Assembly10Ref+5;
+INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- Assembly Of Iron 10man
+(@Assembly10Ref,45322,0,1,1,1,1), -- Cloak of the Iron Council
+(@Assembly10Ref,45324,0,1,1,1,1), -- Leggings of Swift Reflexes
+(@Assembly10Ref,45329,0,1,1,1,1), -- Circlet of True Sight
+(@Assembly10Ref,45330,0,1,1,1,1), -- Greaves of Iron Intensity
+(@Assembly10Ref,45331,0,1,1,1,1), -- Rune-Etched Nightblade
+(@Assembly10Ref,45332,0,1,1,1,1), -- Stormtip
+(@Assembly10Ref,45333,0,1,1,1,1), -- Belt of the Iron Servant
+(@Assembly10Ref,45378,0,1,1,1,1), -- Boots of the Petrified Forest
+(@Assembly10Ref,45418,0,1,1,1,1), -- Lady Maye's Sapphire Ring
+(@Assembly10Ref,45423,0,1,1,1,1), -- Runetouch Wristwraps
+-- Assembly Of Iron 25man
+(@Assembly25Ref,45233,0,1,1,1,1), -- Stormrune Edge
+(@Assembly25Ref,45234,0,1,1,1,1), -- Rapture
+(@Assembly25Ref,45237,0,1,1,1,1), -- Phaelia's Vestments of the Sprouting Seed
+(@Assembly25Ref,45193,0,1,1,1,1), -- Insurmountable Fervor
+(@Assembly25Ref,45236,0,1,1,1,1), -- Unblinking Eye
+(@Assembly25Ref,45225,0,1,1,1,1), -- Steelbreaker's Embrace
+(@Assembly25Ref,45240,0,1,1,1,1), -- Raiments of the Iron Council
+(@Assembly25Ref,45226,0,1,1,1,1), -- Ancient Iron Heaume
+(@Assembly25Ref,45235,0,1,1,1,1), -- Radiant Seal
+(@Assembly25Ref,45227,0,1,1,1,1), -- Iron-studded Mantle
+(@Assembly25Ref,45239,0,1,1,1,1), -- Runeshaper's Gloves
+(@Assembly25Ref,45224,0,1,1,1,1), -- Drape of the Lithe
+(@Assembly25Ref,45232,0,1,1,1,1), -- Runed Ironhide Boots
+(@Assembly25Ref,45228,0,1,1,1,1), -- Handguards of the Enclave
+(@Assembly25Ref,45238,0,1,1,1,1), -- Overload Legwraps
+-- Cache of Living Stone 10man
+(@Kologarn10Ref,45701,0,1,1,1,1), -- Greaves of the Earthbinder
+(@Kologarn10Ref,45965,0,1,1,1,1), -- Spire of Withering Dreams
+(@Kologarn10Ref,45702,0,1,1,1,1), -- Emerald Signet Ring
+(@Kologarn10Ref,45696,0,1,1,1,1), -- Mark of the Unyielding
+(@Kologarn10Ref,45698,0,1,1,1,1), -- Sabatons of the Iron Watcher
+(@Kologarn10Ref,45697,0,1,1,1,1), -- Shoulderguards of the Solemn Watch
+(@Kologarn10Ref,45703,0,2,2,1,1), -- Spark of Hope
+(@Kologarn10Ref,45700,0,2,2,1,1), -- Stoneguard
+(@Kologarn10Ref,45699,0,2,2,1,1), -- Pendant of the Piercing Glare
+(@Kologarn10Ref,45704,0,2,2,1,1), -- Shawl of the Shattered Giant
+-- Cache of Living Stone 25man
+(@Kologarn25Ref,45261,0,1,1,1,1), -- Giant's Bane
+(@Kologarn25Ref,45266,0,1,1,1,1), -- Malice
+(@Kologarn25Ref,45274,0,1,1,1,1), -- Leggings of the Stoneweaver
+(@Kologarn25Ref,45269,0,1,1,1,1), -- Unfaltering Armguards
+(@Kologarn25Ref,45268,0,1,1,1,1), -- Gloves of the Pythonic Guardian
+(@Kologarn25Ref,45262,0,1,1,1,1), -- Necklace of Unerring Mettle
+(@Kologarn25Ref,45275,0,1,1,1,1), -- Bracers of Unleashed Magic
+(@Kologarn25Ref,45272,0,1,1,1,1), -- Robes of the Umbral Brute
+(@Kologarn25Ref,45267,0,1,1,1,1), -- Saronite Plated Legguards
+(@Kologarn25Ref,45263,0,1,1,1,1), -- Wrathstone
+(@Kologarn25Ref,45271,0,1,1,1,1), -- Ironmender
+(@Kologarn25Ref,45264,0,1,1,1,1), -- Decimator's Armguards
+(@Kologarn25Ref,45265,0,1,1,1,1), -- Shoulderpads of the Monolith
+(@Kologarn25Ref,45273,0,1,1,1,1), -- Handwraps of Plentiful Recovery
+(@Kologarn25Ref,45270,0,1,1,1,1), -- Idol of the Crying Wind
+-- Auriaya 10man
+(@Auriaya10Ref,45707,0,1,1,1,1), -- Shieldwall of the Breaker
+(@Auriaya10Ref,45708,0,1,1,1,1), -- Archaedas' Lost Legplates
+(@Auriaya10Ref,45709,0,1,1,1,1), -- Nimble Climber's Belt
+(@Auriaya10Ref,45711,0,1,1,1,1), -- Ironaya's Discarded Mantle
+(@Auriaya10Ref,45712,0,1,1,1,1), -- Chestplate of Titanic Fury
+(@Auriaya10Ref,45713,0,1,1,1,1), -- Nurturing Touch
+(@Auriaya10Ref,45832,0,1,1,1,1), -- Mantle of the Preserver
+(@Auriaya10Ref,45864,0,1,1,1,1), -- Cover of the Keepers
+(@Auriaya10Ref,45865,0,1,1,1,1), -- Raiments of the Corrupted
+(@Auriaya10Ref,45866,0,1,1,1,1), -- Elemental Focus Stone
+-- Auriaya 25man
+(@Auriaya25Ref,45327,0,1,1,1,1), -- Siren's Cry
+(@Auriaya25Ref,45437,0,1,1,1,1), -- Runescribed Blade
+(@Auriaya25Ref,45315,0,1,1,1,1), -- Stonerender
+(@Auriaya25Ref,45439,0,1,1,1,1), -- Unwavering Stare
+(@Auriaya25Ref,45326,0,1,1,1,1), -- Platinum Band of the Aesir
+(@Auriaya25Ref,45441,0,1,1,1,1), -- Sandals of the Ancient Keeper
+(@Auriaya25Ref,45435,0,1,1,1,1), -- Cowl of the Absolute
+(@Auriaya25Ref,45438,0,1,1,1,1), -- Ring of the Faithful Servant
+(@Auriaya25Ref,45434,0,1,1,1,1), -- Greaves of the Rockmender
+(@Auriaya25Ref,45320,0,1,1,1,1), -- Shoulderplates of the Eternal
+(@Auriaya25Ref,45325,0,1,1,1,1), -- Gloves of the Stonereaper
+(@Auriaya25Ref,45440,0,1,1,1,1), -- Amice of the Stoic Watch
+(@Auriaya25Ref,45334,0,1,1,1,1), -- Unbreakable Chestguard
+(@Auriaya25Ref,45319,0,1,1,1,1), -- Cloak of the Makers
+(@Auriaya25Ref,45436,0,1,1,1,1); -- Libram of the Resolute
+
+-- ---------------------------
+-- -- ASSIGN CREATURE LOOTS --
+-- ---------------------------
+UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (@Brundir10,@Molgeim10,@Steelbreaker10,@Brundir25,@Molgeim25,@Steelbreaker25,@Auriaya10,@Auriaya25);
+DELETE FROM `creature_loot_template` WHERE `entry` IN (@Brundir10,@Molgeim10,@Steelbreaker10,@Brundir25,@Molgeim25,@Steelbreaker25);
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- ASSEMBLY OF IRON 10-man
+-- Stormcaller Brundir killed last
+(@Brundir10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot
+(@Brundir10,47241,100,1,0,1,1), -- 1 Emblem of Triumph
+-- Runemaster Molgeim killed last
+(@Molgeim10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot
+(@Molgeim10,47241,100,1,0,2,2), -- 2 Emblem of Triumph
+(@Molgeim10,45506,100,2,0,1,1), -- Archivum Data Disc
+(@Molgeim10,45087,75,1,0,1,1), -- Runed Orb
+-- Steelbreaker killed last
+(@Steelbreaker10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot
+(@Steelbreaker10,47241,100,1,0,2,2), -- 2 Emblem of Triumph
+(@Steelbreaker10,45087,75,1,0,1,1), -- Runed Orb
+(@Steelbreaker10,45506,100,1,0,1,1), -- Archivum Data Disc for Quest
+(@Steelbreaker10,25455,0,1,1,1,1), -- Belt fo the Crystal Tree
+(@Steelbreaker10,45447,0,1,1,1,1), -- Watchful Eye of Fate
+(@Steelbreaker10,45456,0,1,1,1,1), -- Loop of the Agile
+(@Steelbreaker10,45449,0,1,1,1,1), -- The Masticator
+(@Steelbreaker10,45448,0,1,1,1,1), -- Perilous Bite
+-- ASSEMBLY OF IRON 25-man
+-- Stormcaller Brundir killed last
+(@Brundir25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot
+(@Brundir25,2,10,1,0,-34154,1), -- Chance on Recipe
+(@Brundir25,45038,8,1,0,1,1), -- Fragment of Val'anyr
+(@Brundir25,45087,75,1,0,1,1), -- Runed Orb
+(@Brundir25,47241,100,1,0,1,2), -- 2 Emblems of Triumph
+-- Runemaster Molgeim killed last
+(@Molgeim25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot
+(@Molgeim25,2,10,1,0,-34154,1), -- Chance on Recipe
+(@Molgeim25,45038,8,1,0,1,1), -- Fragment of Val'anyr
+(@Molgeim25,45087,75,1,0,1,1), -- Runed Orb
+(@Molgeim25,47241,100,1,0,2,2), -- 2 Emblems of Triumph
+(@Molgeim25,45506,100,1,0,1,1), -- Archivum Data Disc
+-- Steelbreaker killed last
+(@Steelbreaker25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot
+(@Steelbreaker25,2,10,1,0,-34154,1), -- Chance on Recipe
+(@Steelbreaker25,45038,18,1,0,1,1), -- Fragment of Val'anyr
+(@Steelbreaker25,45087,75,1,0,2,2), -- 2x Runed Orb
+(@Steelbreaker25,47241,100,1,0,2,2), -- 2 Emblems of Triumph
+(@Steelbreaker25,45506,100,1,0,1,1), -- Archivum Data Disc
+(@Steelbreaker25,45241,0,1,1,1,1), -- Belt of Colossal Rage
+(@Steelbreaker25,45242,0,1,1,1,1), -- Drape of Mortal Downfall
+(@Steelbreaker25,45607,0,1,1,1,1), -- Fang of Oblivion
+(@Steelbreaker25,45244,0,1,1,1,1), -- Greaves of Swift Vengeance
+(@Steelbreaker25,45243,0,1,1,1,1), -- Sapphire Amulet of Renewal
+(@Steelbreaker25,45245,0,1,1,1,1); -- Shoulderpads of the Intruder
+
+DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@CacheLivingStone10,@CacheLivingStone25);
+INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- KOLOGARN 10-man
+(@CacheLivingStone10,1,100,1,0,-@Kologarn10Ref,2), -- 2 items from reference loot
+(@CacheLivingStone10,47241,100,1,0,1,1), -- 1 Emblem of Triumph
+-- KOLOGARN 25-Man
+(@CacheLivingStone25,1,100,1,0,-@Kologarn25Ref,3), -- 3 items from reference loot
+(@CacheLivingStone25,2,10,1,0,-34154,1), -- Chance on Recipe
+(@CacheLivingStone25,45038,8,1,0,1,1), -- Fragment of Val'anyr
+(@CacheLivingStone25,45087,50,1,0,1,1), -- Runed Orb
+(@CacheLivingStone25,47241,100,1,0,1,2); -- 2 Emblems of Triumph
+
+DELETE FROM `creature_loot_template` WHERE `entry` IN (@Auriaya10,@Auriaya25);
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+-- AURIAYA 10-man
+(@Auriaya10,1,100,1,0,-@Auriaya10Ref,2), -- 2 items from reference loot
+(@Auriaya10,47241,100,1,0,1,1), -- 1 Emblem of Triumph
+-- AURIAYA 25-man
+(@Auriaya25,1,100,1,0,-@Auriaya25Ref,3), -- 3 items from reference loot
+(@Auriaya25,2,10,1,0,-34154,1), -- Chance on Recipe
+(@Auriaya25,45038,8,1,0,1,1), -- Fragment of Val'anyr
+(@Auriaya25,45087,75,1,0,1,1), -- Runed Orb
+(@Auriaya25,47241,100,1,0,1,2); -- 2 Emblems of Triumph
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
index f856156825d..d988b940809 100755
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -70,7 +70,7 @@ void RealmList::UpdateRealms(bool init)
{
sLog->outDetail("Updating Realm List...");
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
PreparedQueryResult result = LoginDatabase.Query(stmt);
// Circle through results and add them to the realm map
@@ -79,16 +79,16 @@ void RealmList::UpdateRealms(bool init)
do
{
Field* fields = result->Fetch();
- uint32 realmId = fields[0].GetUInt32();
- const std::string& name = fields[1].GetString();
+ uint32 realmId = fields[0].GetUInt32();
+ const std::string& name = fields[1].GetString();
const std::string& address = fields[2].GetString();
- uint16 port = fields[3].GetUInt16();
- uint8 icon = fields[4].GetUInt8();
- RealmFlags flag = RealmFlags(fields[5].GetUInt8());
- uint8 timezone = fields[6].GetUInt8();
+ uint16 port = fields[3].GetUInt16();
+ uint8 icon = fields[4].GetUInt8();
+ RealmFlags flag = RealmFlags(fields[5].GetUInt8());
+ uint8 timezone = fields[6].GetUInt8();
uint8 allowedSecurityLevel = fields[7].GetUInt8();
- float pop = fields[8].GetFloat();
- uint32 build = fields[9].GetUInt32();
+ float pop = fields[8].GetFloat();
+ uint32 build = fields[9].GetUInt32();
UpdateRealm(realmId, name, address, port, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist
index 86423d53e18..e9ed4bd752d 100644
--- a/src/server/authserver/authserver.conf.dist
+++ b/src/server/authserver/authserver.conf.dist
@@ -111,6 +111,14 @@ DebugLogMask = 64
SQLDriverLogFile = ""
#
+# SQLDriverQueryLogging
+# Description: Log SQL queries to the SQLDriverLogFile and console.
+# Default: 0 - (Disabled, Query errors only)
+# 1 - (Enabled, Full query logging - may have performance impact)
+
+SQLDriverQueryLogging = 0
+
+#
# LogTimestamp
# Description: Append timestamp to the server log file name.
# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index ab451a38fa8..1c24dfc061d 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -94,10 +94,10 @@ void ArenaTeamMgr::LoadArenaTeams()
// Clean out the trash before loading anything
CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); // One-time query
- // 0 1 2 3 4 5 6 7 8
- QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, "
- // 9 10 11 12 13 14
- "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arena_team.arenaTeamId ASC");
+ // 0 1 2 3 4 5 6 7 8
+ QueryResult result = CharacterDatabase.Query("SELECT arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, "
+ // 9 10 11 12 13 14
+ "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arenaTeamId ASC");
if (!result)
{
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index a88bf06898c..d3417705867 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -427,7 +427,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
result = CharacterDatabase.Query(stmt);
if (result)
- inv_count = (*result)[0].GetUInt32();
+ inv_count = (*result)[0].GetUInt64();
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY);
stmt->setUInt32(0, item_id);
@@ -476,7 +476,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
result = CharacterDatabase.Query(stmt);
if (result)
- mail_count = (*result)[0].GetUInt32();
+ mail_count = (*result)[0].GetUInt64();
if (count > 0)
{
@@ -523,7 +523,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
result = CharacterDatabase.Query(stmt);
if (result)
- auc_count = (*result)[0].GetUInt32();
+ auc_count = (*result)[0].GetUInt64();
if (count > 0)
{
@@ -560,7 +560,7 @@ bool ChatHandler::HandleListItemCommand(const char *args)
result = CharacterDatabase.Query(stmt);
if (result)
- guild_count = (*result)[0].GetUInt32();
+ guild_count = (*result)[0].GetUInt64();
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY);
stmt->setUInt32(0, item_id);
@@ -3302,7 +3302,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args)
bool ChatHandler::HandleBanListAccountCommand(const char *args)
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_BANS);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
LoginDatabase.Execute(stmt);
char* cFilter = strtok((char*)args, " ");
@@ -3410,7 +3410,7 @@ bool ChatHandler::HandleBanListHelper(PreparedQueryResult result)
bool ChatHandler::HandleBanListIPCommand(const char *args)
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_IP_BANS);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS);
LoginDatabase.Execute(stmt);
char* cFilter = strtok((char*)args, " ");
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index 187b12d5d2e..c30cbaa622e 100755
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -138,7 +138,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
if (result)
{
Field* fields = result->Fetch();
- mails_count = fields[0].GetUInt32();
+ mails_count = fields[0].GetUInt64();
}
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL);
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index 930bf0d3372..68e28014319 100755
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -65,6 +65,8 @@ GmTicket::~GmTicket() { }
bool GmTicket::LoadFromDB(Field* fields)
{
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed
uint8 index = 0;
_id = fields[ index].GetUInt32();
_playerGuid = MAKE_NEW_GUID(fields[++index].GetUInt32(), 0, HIGHGUID_PLAYER);
@@ -87,6 +89,8 @@ bool GmTicket::LoadFromDB(Field* fields)
void GmTicket::SaveToDB(SQLTransaction& trans) const
{
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed
uint8 index = 0;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET);
stmt->setUInt32( index, _id);
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
index 9d29aa6f9a9..22de70b993b 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
@@ -245,7 +245,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
// Account data
PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH)
- PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data(accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
+ PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data (accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_REP_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp
index df92c6fa77c..70d874be31d 100755
--- a/src/server/shared/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp
@@ -56,8 +56,6 @@ void LoginDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_DEL_OLD_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC);
- PREPARE_STATEMENT(LOGIN_DEL_OLD_IP_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC);
PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, string) VALUES (UNIX_TIMESTAMP(), ? , ?, ?)", CONNECTION_ASYNC);
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h
index 4ad9ac1a251..2b9d94cbceb 100755
--- a/src/server/shared/Database/Implementation/LoginDatabase.h
+++ b/src/server/shared/Database/Implementation/LoginDatabase.h
@@ -76,8 +76,6 @@ enum LoginDatabaseStatements
LOGIN_SEL_SUM_REALM_CHARACTERS,
LOGIN_INS_ACCOUNT,
LOGIN_INS_REALM_CHARACTERS_INIT,
- LOGIN_DEL_OLD_BANS,
- LOGIN_DEL_OLD_IP_BANS,
LOGIN_UPD_EXPANSION,
LOGIN_UPD_ACCOUNT_LOCK,
LOGIN_INS_LOG,
diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp
index dd1b85f70a6..db26dabaee7 100755
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -42,12 +42,20 @@ void PreparedStatement::BindParameters()
m_stmt->setBool(i, statement_data[i].data.boolean);
break;
case TYPE_UI8:
+ m_stmt->setUInt8(i, statement_data[i].data.ui8);
+ break;
case TYPE_UI16:
+ m_stmt->setUInt16(i, statement_data[i].data.ui16);
+ break;
case TYPE_UI32:
m_stmt->setUInt32(i, statement_data[i].data.ui32);
break;
case TYPE_I8:
+ m_stmt->setInt8(i, statement_data[i].data.i8);
+ break;
case TYPE_I16:
+ m_stmt->setInt16(i, statement_data[i].data.i16);
+ break;
case TYPE_I32:
m_stmt->setInt32(i, statement_data[i].data.i32);
break;
@@ -89,7 +97,7 @@ void PreparedStatement::setUInt8(const uint8 index, const uint8 value)
if (index >= statement_data.size())
statement_data.resize(index+1);
- statement_data[index].data.ui32 = value;
+ statement_data[index].data.ui8 = value;
statement_data[index].type = TYPE_UI8;
}
@@ -98,7 +106,7 @@ void PreparedStatement::setUInt16(const uint8 index, const uint16 value)
if (index >= statement_data.size())
statement_data.resize(index+1);
- statement_data[index].data.ui32 = value;
+ statement_data[index].data.ui16 = value;
statement_data[index].type = TYPE_UI16;
}
@@ -125,7 +133,7 @@ void PreparedStatement::setInt8(const uint8 index, const int8 value)
if (index >= statement_data.size())
statement_data.resize(index+1);
- statement_data[index].data.i32 = value;
+ statement_data[index].data.i8 = value;
statement_data[index].type = TYPE_I8;
}
@@ -134,7 +142,7 @@ void PreparedStatement::setInt16(const uint8 index, const int16 value)
if (index >= statement_data.size())
statement_data.resize(index+1);
- statement_data[index].data.i32 = value;
+ statement_data[index].data.i16 = value;
statement_data[index].type = TYPE_I16;
}
@@ -235,17 +243,23 @@ bool MySQLPreparedStatement::CheckValidIndex(uint8 index)
void MySQLPreparedStatement::setBool(const uint8 index, const bool value)
{
- setUInt32(index, value);
+ setUInt8(index, value ? 1 : 0);
}
void MySQLPreparedStatement::setUInt8(const uint8 index, const uint8 value)
{
- setUInt32(index, value);
+ CheckValidIndex(index);
+ m_paramsSet[index] = true;
+ MYSQL_BIND* param = &m_bind[index];
+ setValue(param, MYSQL_TYPE_TINY, &value, sizeof(uint8), true);
}
void MySQLPreparedStatement::setUInt16(const uint8 index, const uint16 value)
{
- setUInt32(index, value);
+ CheckValidIndex(index);
+ m_paramsSet[index] = true;
+ MYSQL_BIND* param = &m_bind[index];
+ setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(uint16), true);
}
void MySQLPreparedStatement::setUInt32(const uint8 index, const uint32 value)
@@ -266,12 +280,18 @@ void MySQLPreparedStatement::setUInt64(const uint8 index, const uint64 value)
void MySQLPreparedStatement::setInt8(const uint8 index, const int8 value)
{
- setInt32(index, value);
+ CheckValidIndex(index);
+ m_paramsSet[index] = true;
+ MYSQL_BIND* param = &m_bind[index];
+ setValue(param, MYSQL_TYPE_TINY, &value, sizeof(int8), false);
}
void MySQLPreparedStatement::setInt16(const uint8 index, const int16 value)
{
- setInt32(index, value);
+ CheckValidIndex(index);
+ m_paramsSet[index] = true;
+ MYSQL_BIND* param = &m_bind[index];
+ setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(int16), false);
}
void MySQLPreparedStatement::setInt32(const uint8 index, const int32 value)
@@ -353,12 +373,20 @@ std::string MySQLPreparedStatement::getQueryString(const char *query)
replace << (m_stmt->statement_data[i].data.boolean ? '1' : '0');
break;
case TYPE_UI8:
+ replace << uint16(m_stmt->statement_data[i].data.ui8); // stringstream will append a character with that code instead of numeric representation
+ break;
case TYPE_UI16:
+ replace << m_stmt->statement_data[i].data.ui16;
+ break;
case TYPE_UI32:
replace << m_stmt->statement_data[i].data.ui32;
break;
case TYPE_I8:
+ replace << int16(m_stmt->statement_data[i].data.i8); // stringstream will append a character with that code instead of numeric representation
+ break;
case TYPE_I16:
+ replace << m_stmt->statement_data[i].data.i16;
+ break;
case TYPE_I32:
replace << m_stmt->statement_data[i].data.i32;
break;
diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h
index 9ee9d83ad3f..296c13d86c9 100755
--- a/src/server/shared/Logging/Log.h
+++ b/src/server/shared/Logging/Log.h
@@ -31,7 +31,7 @@ enum DebugLogFilters
LOG_FILTER_PETS = 0x00000002,
LOG_FILTER_VEHICLES = 0x00000004,
LOG_FILTER_TSCR = 0x00000008, // C++ AI, instance scripts, etc.
- LOG_FILTER_DATABASE_AI = 0x08000010, // SmartAI, EventAI, CreatureAI
+ LOG_FILTER_DATABASE_AI = 0x00000010, // SmartAI, EventAI, CreatureAI
LOG_FILTER_MAPSCRIPTS = 0x00000020,
LOG_FILTER_NETWORKIO = 0x00000040, // Anything packet/netcode related
LOG_FILTER_SPELLS_AURAS = 0x00000080,