[DiscordArchive] Is ```player:GetQuest():GetName()``` correct, if I want to broadcast the player's current quest?
[DiscordArchive] Is ```player:GetQuest():GetName()``` correct, if I want to broadcast the player's current quest?
Archived author: Foe • Posted: 2023-02-07T21:03:14.264000+00:00
Original source
I didnt test it, so let me know if there's any errors
Archived author: adm • Posted: 2023-02-07T21:09:07.823000+00:00
Original source
yup, works like a charm
Archived author: adm • Posted: 2023-02-07T21:10:40.442000+00:00
Original source
is that better performance wise than simply making a single query in the same file, like:
``` local result = WorldDBQuery("SELECT LogTitle, QuestLevel FROM quest_template WHERE ID = " .. questId)```
Archived author: Foe • Posted: 2023-02-07T21:11:06.021000+00:00
Original source
Yes, because this runs the query once on startup, then caches the info for *all* quests
Archived author: Foe • Posted: 2023-02-07T21:11:16.021000+00:00
Original source
So every time you use GetInfo, you're just reading from memory
Archived author: Foe • Posted: 2023-02-07T21:11:18.203000+00:00
Original source
and not the database
Archived author: adm • Posted: 2023-02-07T21:11:29.412000+00:00
Original source
right
Archived author: adm • Posted: 2023-02-07T21:11:46.508000+00:00
Original source
will this cost a lot a memory, what do you think?
Archived author: Foe • Posted: 2023-02-07T21:11:55.793000+00:00
Original source
Not a lot, a negligible amount
Archived author: Foe • Posted: 2023-02-07T21:12:15.343000+00:00
Original source
It's much better for performance at least than querying the database every time