Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Command/unstuck) use command with offline players #18855

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
945726f
chore(Command/unstuck) use command with offline players
pangolp May 2, 2024
17fbea2
Replace queries with prepared statement
pangolp May 2, 2024
92983c4
Remove apostrophes
pangolp May 2, 2024
d34f64a
fix(Core/Misc): Correct typo when loading reference loot templates (#…
jasonmokk May 9, 2024
51202f8
fix(DB/Creature): Zul'Aman prisoner loot (#18869)
heyitsbench May 9, 2024
8d685ac
chore(DB): import pending files
github-actions[bot] May 9, 2024
9c363bd
fix(AQ40/SmartGameObjectAI): remove locked status from scarab coffer …
sogladev May 11, 2024
0e7b1f3
chore(DB): import pending files
github-actions[bot] May 11, 2024
cd63cc0
fix(Conf): align LeaveGroupOnLogout default in core with worldserver.…
sudlud May 11, 2024
c30cafe
fix(DB/spell_target_position): Mara Portal tp location (#18876)
sogladev May 11, 2024
016dcfa
chore(DB): import pending files
github-actions[bot] May 11, 2024
45ad5ac
fix(db/sai) Some contents of the restoration of creature (27210 and 2…
fangshun2004 May 11, 2024
ac203da
fix(Core/Unit): SPELLMOD_RESIST_MISS_CHANCE should decrease miss cha…
sogladev May 11, 2024
9af66df
chore(DB): import pending files
github-actions[bot] May 11, 2024
2c77139
fix(Scripts/Naxxramas): Maexxna more blizzlike web wrap (#18843)
sogladev May 11, 2024
6edf515
chore(DB): import pending files
github-actions[bot] May 11, 2024
d44c899
fix(Scripts/Spell): Fix Void Zone damage calcs for Netherspite, Blaum…
sogladev May 11, 2024
864ea7f
chore(DB): import pending files
github-actions[bot] May 11, 2024
31096df
fix(Scripts/TheEye): correct first phoenix in p5 (#18802)
balleny May 11, 2024
6b5ad72
fix(DB/Creature): Correct spells order for Broken-down Shredder (iss…
xubpwg May 12, 2024
daf7842
fix(DB/asi)Added some small events to the creature "Shen'dralar Ancie…
fangshun2004 May 12, 2024
bf930bb
chore(DB): import pending files
github-actions[bot] May 12, 2024
dd3f4a5
fix(Scripts/Zones/Creature): Infra-Green Bomber (#18752)
Knindzagxg May 12, 2024
c95594e
fix(DB/updates): fix downquery to match up (#18888)
elthehablo May 12, 2024
0f82c8e
fix(Core/Events) Implement Fireworks Spectacular (#18860)
sudlud May 12, 2024
8552d4f
chore(DB): import pending files
github-actions[bot] May 12, 2024
85e9671
fix(Scripts/Naxxramas): Re enable Portal Hub teleport requirement (#…
sogladev May 12, 2024
d709080
fix(Karazhan/Nightbane): no longer killable during flight (#18890)
sogladev May 12, 2024
5668e47
fix(DB/Hyjal): Archimonde aggro range (#18884)
elthehablo May 12, 2024
e4b4686
chore(DB): import pending files
github-actions[bot] May 12, 2024
b42ca49
fix(Karazhan/Nightbane): Rain of Bones cast on one random player/pet,…
sogladev May 13, 2024
3a4d321
fix(DB/gameobject):Remove the Church of the Holy Light with flowers a…
fangshun2004 May 13, 2024
15e46de
chore(DB): import pending files
github-actions[bot] May 13, 2024
7889a99
fix(DB/Hyjal): allow Giant Infernal to use Flame Buffet (#18885)
elthehablo May 14, 2024
8ad1744
chore(DB): import pending files
github-actions[bot] May 14, 2024
6594255
fix(DB/Loot): Near complete loot rework of Vanilla overworld zones (#…
Gultask May 14, 2024
e06f2b2
chore(DB): import pending files
github-actions[bot] May 14, 2024
fd7c8a0
fix(DB/Gameobject): Rebuild all Eastern Kingdoms gathering nodes usin…
Gultask May 14, 2024
ef6db03
chore(DB): import pending files
github-actions[bot] May 14, 2024
e2029c3
fix(Core/BattlegroundAV): spawn generic gameobjects in Alterac Valley…
sudlud May 15, 2024
6874d5e
chore(DB): import pending files
github-actions[bot] May 15, 2024
3b4639a
fix(Scripts/ShadowmoonValley): minor fixes to Enslaved Netherwing Dra…
elthehablo May 17, 2024
dfc9abb
fix(CI): revert ubuntu-22.04 to gcc12 (#18905)
sudlud May 17, 2024
7b23439
feat(CI): add CI for ubuntu-24.04 (#18909)
sudlud May 17, 2024
4ae69cf
fix(DB/creature_text): localize Arcanist Braedin txt line about WG (#…
chaosua May 18, 2024
6d6c7be
chore(DB): import pending files
github-actions[bot] May 18, 2024
3988e95
feat(core): add hooks for applying item mods (#18760)
silviu20092 May 18, 2024
1cd8cf0
Merge branch 'unstuck' of https://github.com/pangolp/azerothcore-wotl…
pangolp May 18, 2024
0ebe8e2
Update src/server/scripts/Commands/cs_misc.cpp
pangolp May 18, 2024
7f4c8a7
Merge branch 'unstuck' of https://github.com/pangolp/azerothcore-wotl…
pangolp May 18, 2024
ddd3778
cache
pangolp May 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_MAIL_SERVER_CHARACTER, "SELECT mailId from mail_server_character WHERE guid = ? and mailId = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_REP_MAIL_SERVER_CHARACTER, "REPLACE INTO mail_server_character (guid, mailId) values (?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_SOCIALLIST, "SELECT friend, flags, note FROM character_social JOIN characters ON characters.guid = character_social.friend WHERE character_social.guid = ? AND deleteinfos_name IS NULL LIMIT 255", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ, posO FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_HOMEBIND, "SELECT `mapId`, `zoneId`, `posX`, `posY`, `posZ`, `posO` FROM `character_homebind` WHERE `guid` = ?", CONNECTION_BOTH);
pangolp marked this conversation as resolved.
Show resolved Hide resolved
PrepareStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, category, item, time, needSend FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC);
Expand Down
26 changes: 25 additions & 1 deletion src/server/scripts/Commands/cs_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,31 @@ class misc_commandscript : public CommandScript

if (!target || !target->IsConnected())
{
return false;
if (handler->HasLowerSecurity(nullptr, target->GetGUID()))
return false;

ObjectGuid::LowType guid = sCharacterCache->GetCharacterGuidByName(target->GetName()).GetCounter();
Copy link
Member

@Nyeriah Nyeriah May 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to access the cache at all here, you already got the guid info

                CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);
                stmt->SetData(0, target->GetGUID().GetCounter());
                PreparedQueryResult resultDB = CharacterDatabase.Query(stmt);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll check it out. Thank you.


CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_HOMEBIND);
stmt->SetData(0, guid);

PreparedQueryResult result = CharacterDatabase.Query(stmt);

if (result)
{
uint32 mapId = (*result)[0].Get<uint32>();
uint32 zoneId = (*result)[1].Get<uint32>();
float posX = (*result)[2].Get<float>();
float posY = (*result)[3].Get<float>();
float posZ = (*result)[4].Get<float>();
float posO = (*result)[5].Get<float>();

Player::SavePositionInDB(mapId, posX, posY, posZ, posO, zoneId, target->GetGUID());
pangolp marked this conversation as resolved.
Show resolved Hide resolved

handler->PSendSysMessage(LANG_SUMMONING, target->GetName(), handler->GetAcoreString(LANG_OFFLINE));
}

return true;
}

Player* player = target->GetConnectedPlayer();
Expand Down