[DiscordArchive] why is there a thread handling mail expirations?
[DiscordArchive] why is there a thread handling mail expirations?
Archived author: walkline • Posted: 2024-11-11T12:07:30.310000+00:00
Original source
Since I'm not a maintainer, I can't stop you from making any PRs.
But if I were a maintainer, I would first ask you to provide more details about exactly what you plan to refactor and how, to avoid potentially wasting your time.
hared_ptr in auctionhousemgr and player classes, if only single item reference is used in code block, i will use std::move to avoid non necessary counter increments. At base i will keep raw pointers of items only in areas where i'm sure that shared_ptr pointer lifetime stays intact, for example, in ScriptMgr related hooks
Archived author: andriuspel • Posted: 2024-11-11T12:15:26.273000+00:00
Original source
at base, i'm going to update mItems storage to use std:
hared_ptr in auctionhousemgr and player classes, if only single item reference is used in code block, i will use std::move to avoid non necessary counter increments. At base i will keep raw pointers of items only in areas where i'm sure that shared_ptr pointer lifetime stays intact, for example, in ScriptMgr related hooks
Archived author: andriuspel • Posted: 2024-11-11T12:16:11.415000+00:00
Original source
base functions where shared_ptr could be guaranteed to last, i will keep raw pointer
Archived author: andriuspel • Posted: 2024-11-11T12:16:35.789000+00:00
Original source
i'm not planning to use weak_ptr for now
Archived author: andriuspel • Posted: 2024-11-11T12:17:55.722000+00:00
Original source
i will make detailed explanation later but just where shared pointer lifetime is guaranteed, i will keep raw pointer (in functions params)
Archived author: andriuspel • Posted: 2024-11-11T12:18:13.565000+00:00
Original source
lets say
hared_ptr<Item> item = std::make_shared<Item>():Archived author: andriuspel • Posted: 2024-11-11T12:19:27.571000+00:00
Original source
```c
std:
hared_ptr<Item> item = std::make_shared<Item>():
someFunction(item.get());```
Archived author: andriuspel • Posted: 2024-11-11T12:19:57.833000+00:00
Original source
or
Archived author: andriuspel • Posted: 2024-11-11T12:20:43.586000+00:00
Original source
```c
if (auto item = plr->GetItem(0/*slot*/))
someFunction(item.get());```
Archived author: andriuspel • Posted: 2024-11-11T12:21:07.821000+00:00
Original source
because due shared_ptr, item lifetime is guaranteed to remain till code block end