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

SendAreaTriggerMessage not fmt formatted #20006

Closed
sogladev opened this issue Sep 20, 2024 · 8 comments · Fixed by #20926
Closed

SendAreaTriggerMessage not fmt formatted #20006

sogladev opened this issue Sep 20, 2024 · 8 comments · Fixed by #20926
Labels
Confirmed CORE Related to the core

Comments

@sogladev
Copy link
Member

Current Behaviour

wrong format error message when trying to enter an instance "You must be at least level {} to enter."

area_trigger

Expected Blizzlike Behaviour

{} should be 70 in this case

Source

void WorldSession::SendAreaTriggerMessage(const char* Text, ...)

likely this as well

void WorldSession::SendAreaTriggerMessage(uint32 entry, ...)

Steps to reproduce the problem

level <70

  1. .go xyz 3088 1375 185 530 4.6
  2. try to enter

Extra Notes

No response

AC rev. hash/commit

a196f7f

Operating system

ubuntu 24.04

Custom changes or Modules

No response

@TheSCREWEDSoftware

This comment has been minimized.

@Kitzunu
Copy link
Member

Kitzunu commented Sep 21, 2024

Easy fix. I can add it to my todo list of things for when I have time to fix it. Otherwise, just look at any of my previous commits

@Kitzunu Kitzunu changed the title AreaTrigger formatting "You must be at least level {} to enter." SendAreaTriggerMessage not fmt formatted Sep 21, 2024
@kissingers
Copy link
Contributor

Also there is many incomplete hpylink message at server.log, same as this, after the message change pr

2024-09-22 12:22:45 Player Horse GUID Full: 0x0000000000003f98 Type: Player Low: 16280 sent a message with an invalid link:
%.*s
2024-09-22 12:22:45 Player Harper GUID Full: 0x0000000000003fb3 Type: Player Low: 16307 sent a message with an invalid link:
%.*s
2024-09-22 12:22:45 Player Have GUID Full: 0x0000000000003f8f Type: Player Low: 16271 sent a message with an invalid link:
%.*s
2024-09-22 12:22:45 Player Hopeful GUID Full: 0x0000000000003fa1 Type: Player Low: 16289 sent a message with an invalid link:
%.*s

which at WorldSession.cpp 767 line

bool WorldSession::ValidateHyperlinksAndMaybeKick(std::string_view str)
{
if (Acore::Hyperlinks::CheckAllLinks(str))
return true;

LOG_ERROR("network", "Player {} {} sent a message with an invalid link:\n%.*s", GetPlayer()->GetName(),
    GetPlayer()->GetGUID().ToString(), STRING_VIEW_FMT_ARG(str));

if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
    KickPlayer("WorldSession::ValidateHyperlinksAndMaybeKick Invalid chat link");

return false;

}

@TheSCREWEDSoftware
Copy link
Contributor

Fixed in: azerothcore/mod-npc-talent-template#50

@sogladev
Copy link
Member Author

Fixed in: azerothcore/mod-npc-talent-template#50

The module PR did not fix this issue, it only referenced the issue because of the same formatting error shows in the module

@sogladev sogladev reopened this Nov 27, 2024
@TheSCREWEDSoftware TheSCREWEDSoftware added Confirmed CORE Related to the core labels Nov 27, 2024
@Kitzunu
Copy link
Member

Kitzunu commented Nov 28, 2024

Must be fixed in core. But I am too swamped at work to have time to do it atm

@Exitare
Copy link
Member

Exitare commented Dec 15, 2024

@Kitzunu,
I tried to solve it on my own.
I got it working by changing the {} with %s in the database. But as you mentioned this is not how you would fix it.
Could you pinpoint me in the right direction in regards to how you would fix it ?

Thank you

@Kitzunu
Copy link
Member

Kitzunu commented Dec 15, 2024

We dont want to change anything in the DB as we want to use the fmt format

Here are some implementations I've done for it.

#19491
#19490
#19449
#19489
#19718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed CORE Related to the core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants