Skip to content

Starts the implementation of retail fishing - #11902

Draft
Frankie-hz wants to merge 17 commits into
LandSandBoat:basefrom
Frankie-hz:fishing
Draft

Frankie-hz wants to merge 17 commits into
LandSandBoat:basefrom
Frankie-hz:fishing

Conversation

@Frankie-hz

Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Split into many many PRs so its actually reviewable.

All code is based off captures and retail data. This is how we understand the system to the best of our knowledge. Fishing is still disabled and will remained disabled until the system is fully finished.

Sheet with explanations: https://docs.google.com/document/d/1UWTWKHZZcnmk-z_R6kJ_3Fd6rOLkj9AM/edit?usp=drivesdk&ouid=103812223323366345202&rtpof=true&sd=true

Lots and lots and lots of captures: https://www.dropbox.com/scl/fi/y91su3vc6o90btlrlxc5u/Fishing.zip?rlkey=pi29o0gfxem515xifbr0hs3b8&st=dhg6hqmu&dl=0

Steps to test these changes

Fish.

I can write more detailed steps

@github-actions

Copy link
Copy Markdown

✨ Hello and thanks for the PR! ✨

🤖: This is a friendly automated reminder that the maintainers won't look at your PR until you've properly completed all of the checkboxes in the pre-filled template.

@zach2good zach2good left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

#DeleteFishing

Comment thread sql/fishing_group.sql Resolved
Comment thread src/map/lua/luautils.cpp Resolved
{
return PacketValidator(PChar)
.blockedBy({ BlockedState::InEvent, BlockedState::AbnormalStatus })
.blockedBy({ BlockedState::InEvent, BlockedState::AbnormalStatus, BlockedState::Fishing })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be one for @sruon , is there any reason we wouldn't/shouldn't treat fishing as "being in an event" and not having to specify a new type for it? That would already handle trading, equipping, etc.

Comment thread src/map/utils/fishingutils.cpp Resolved
Comment thread src/map/utils/fishingutils.cpp Resolved
for (auto fish : FishingGroups[groupId])
{
if (FishList[fish.first]->item)
auto* fishEntry = GetFish(fish.first);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If GetFish() returned Maybe<FishEntry> it would be a lot harder to use wrongly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is a TODO inside maybe.h saying it cant hold a reference type yet. Let me know how to proceed, I don't really understand how to fix that exactly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfortunately, Maybe = std::optional and T& support isn't coming until C++26, so what we should do instead is swap out that alias for Sy Brand's implementation: https://github.com/TartanLlama/optional

  1. Add a section in ext for it like this: https://github.com/LandSandBoat/server/blob/base/ext/CMakeLists.txt#L103
  2. Update the alias to use it here: https://github.com/LandSandBoat/server/blob/base/src/common/types/maybe.h
  3. Everything should "just work", and Maybe will get T& support

If you have any trouble with this let me know and I'll do it this weekend

Refs:
https://www.sandordargo.com/blog/2025/10/01/cpp26-optional-of-reference

Comment thread src/map/utils/fishingutils.cpp Resolved
Comment thread src/map/utils/fishingutils.cpp Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants