Skip to content

Commit

Permalink
Merge pull request azerothcore#3 from qudzy/upstream/refactor-instanc…
Browse files Browse the repository at this point in the history
…e-suggestions

Refactor instance suggestions
  • Loading branch information
ZhengPeiRu21 committed May 10, 2022
2 parents 0053ac6 + 44e4cd8 commit e05bc38
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -57,6 +57,8 @@ CMakeLists.txt.user
#
/.settings/
/.externalToolBuilders/*
/.vs
/out
# exclude in all levels
nbproject/
.sync.ffs_db
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
@@ -1,3 +1,6 @@
[submodule "deps/git-subrepo"]
path = deps/git-subrepo
url = https://github.com/ingydotnet/git-subrepo.git
[submodule "modules/mod-playerbots"]
path = modules/mod-playerbots
url = https://github.com/ZhengPeiRu21/mod-playerbots.git
1 change: 1 addition & 0 deletions modules/mod-playerbots
Submodule mod-playerbots added at 16ef20
1 change: 1 addition & 0 deletions src/common/Utilities/Util.h
Expand Up @@ -351,6 +351,7 @@ inline wchar_t wcharToLower(wchar_t wchar)

void wstrToUpper(std::wstring& str);
void wstrToLower(std::wstring& str);
void strToLower(std::string& str);

std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension);

Expand Down
18 changes: 18 additions & 0 deletions src/server/database/Database/Implementation/PlayerbotsDatabase.cpp
Expand Up @@ -85,6 +85,24 @@ void PlayerbotsDatabaseConnection::DoPrepareStatements()
PrepareStatement(PLAYERBOTS_DEL_TRAVELNODE_PATH, "DELETE FROM playerbots_travelnode_path", CONNECTION_ASYNC);

PrepareStatement(PLAYERBOTS_SEL_TEXT, "SELECT `key`,`text` FROM playerbots_text", CONNECTION_SYNCH);
PrepareStatement(
PLAYERBOTS_SEL_DUNGEON_SUGGESTION,
"SELECT"
" d.`name`, "
" d.`difficulty`, "
" d.`min_level`, "
" d.`max_level`, "
" a.`abbrevation`, "
" s.`strategy` "
"FROM playerbots_dungeon_suggestion_definition d "
"LEFT OUTER JOIN playerbots_dungeon_suggestion_abbrevation a "
" ON d.slug = a.definition_slug "
"LEFT OUTER JOIN playerbots_dungeon_suggestion_strategy s "
" ON d.slug = s.definition_slug "
" AND d.difficulty = s.difficulty "
"WHERE d.expansion <= ?;",
CONNECTION_SYNCH
);

PrepareStatement(PLAYERBOTS_SEL_WEIGHTSCALES, "SELECT id, name, class FROM playerbots_weightscales", CONNECTION_SYNCH);
PrepareStatement(PLAYERBOTS_SEL_WEIGHTSCALE_DATA, "SELECT id, field, val FROM playerbots_weightscale_data", CONNECTION_SYNCH);
Expand Down
Expand Up @@ -78,6 +78,7 @@ enum PlayerbotsDatabaseStatements : uint32
PLAYERBOTS_INS_TELE_CACHE,

PLAYERBOTS_SEL_TEXT,
PLAYERBOTS_SEL_DUNGEON_SUGGESTION,

PLAYERBOTS_SEL_TRAVELNODE,
PLAYERBOTS_INS_TRAVELNODE,
Expand Down

0 comments on commit e05bc38

Please sign in to comment.