From 614b5832ba96b4c5905ece5490a7b5d18c2f710b Mon Sep 17 00:00:00 2001 From: MitchesD Date: Wed, 26 Aug 2015 11:12:35 +0200 Subject: Core/Player: implemented Toybox * now you can use all the things in toybox - add new toys, set them as favorite and use them --- src/server/database/Database/Implementation/HotfixDatabase.cpp | 4 ++++ src/server/database/Database/Implementation/HotfixDatabase.h | 3 +++ src/server/database/Database/Implementation/LoginDatabase.cpp | 4 ++++ src/server/database/Database/Implementation/LoginDatabase.h | 3 +++ 4 files changed, 14 insertions(+) (limited to 'src/server/database/Database/Implementation') diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp index c037f1bce70..ff3f8e906c7 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.cpp +++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp @@ -417,6 +417,10 @@ void HotfixDatabaseConnection::DoPrepareStatements() PrepareStatement(HOTFIX_SEL_TOTEM_CATEGORY, "SELECT ID, Name, CategoryType, CategoryMask FROM totem_category ORDER BY ID DESC", CONNECTION_SYNCH); PREPARE_LOCALE_STMT(HOTFIX_SEL_TOTEM_CATEGORY, "SELECT ID, Name_lang FROM totem_category_locale WHERE locale = ?", CONNECTION_SYNCH); + // Toy.db2 + PrepareStatement(HOTFIX_SEL_TOY, "SELECT ID, ItemID, Flags, Description, CategoryFilter FROM toy ORDER BY ID DESC", CONNECTION_SYNCH); + PREPARE_LOCALE_STMT(HOTFIX_SEL_TOY, "SELECT ID, Description_lang FROM toy_locale WHERE locale = ?", CONNECTION_SYNCH); + // TransportAnimation.db2 PrepareStatement(HOTFIX_SEL_TRANSPORT_ANIMATION, "SELECT ID, TransportID, TimeIndex, PosX, PosY, PosZ, SequenceID FROM transport_animation" " ORDER BY ID DESC", CONNECTION_SYNCH); diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h index c92b7b23499..7740c78afc3 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.h +++ b/src/server/database/Database/Implementation/HotfixDatabase.h @@ -247,6 +247,9 @@ enum HotfixDatabaseStatements HOTFIX_SEL_TOTEM_CATEGORY, HOTFIX_SEL_TOTEM_CATEGORY_LOCALE, + HOTFIX_SEL_TOY, + HOTFIX_SEL_TOY_LOCALE, + HOTFIX_SEL_TRANSPORT_ANIMATION, HOTFIX_SEL_TRANSPORT_ROTATION, diff --git a/src/server/database/Database/Implementation/LoginDatabase.cpp b/src/server/database/Database/Implementation/LoginDatabase.cpp index a3d04e03c79..869dc617246 100644 --- a/src/server/database/Database/Implementation/LoginDatabase.cpp +++ b/src/server/database/Database/Implementation/LoginDatabase.cpp @@ -140,4 +140,8 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_SEL_LAST_CHAR_UNDELETE, "SELECT LastCharacterUndelete FROM battlenet_accounts WHERE Id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_LAST_CHAR_UNDELETE, "UPDATE battlenet_accounts SET LastCharacterUndelete = UNIX_TIMESTAMP() WHERE Id = ?", CONNECTION_ASYNC); + + // Account wide toys + PrepareStatement(LOGIN_SEL_ACCOUNT_TOYS, "SELECT itemId, isFavourite FROM battlenet_account_toys WHERE accountId = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_REP_ACCOUNT_TOYS, "REPLACE INTO battlenet_account_toys (accountId, itemId, isFavourite) VALUES (?, ?, ?)", CONNECTION_ASYNC); } diff --git a/src/server/database/Database/Implementation/LoginDatabase.h b/src/server/database/Database/Implementation/LoginDatabase.h index 06d13f29da3..efef4e6ee36 100644 --- a/src/server/database/Database/Implementation/LoginDatabase.h +++ b/src/server/database/Database/Implementation/LoginDatabase.h @@ -143,6 +143,9 @@ enum LoginDatabaseStatements LOGIN_SEL_LAST_CHAR_UNDELETE, LOGIN_UPD_LAST_CHAR_UNDELETE, + LOGIN_SEL_ACCOUNT_TOYS, + LOGIN_REP_ACCOUNT_TOYS, + MAX_LOGINDATABASE_STATEMENTS }; -- cgit v1.2.3