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

Fix: Small fixes 11/22 #642

Merged
merged 9 commits into from
Nov 29, 2024

Conversation

RyanYappert
Copy link
Collaborator

  • Re-fix the channel list and player tracking bugs (current channel reports 0 players, other channels off by a weird amount?)
  • Possibly prevent the HP = 0 bug from occurring in its most common cause (backing out of channel select at the character select screen).
  • Fix NullReferenceException in FriendApplyFriendHandler due to a missing constructor.
  • Fix NullReferenceException in QuestGetMainQuestListHandler due to invalid scheduleIds.
  • Fix NullReferenceException in ProfileGetCharacterProfileHandler due to invalid characterIds.
  • Fix NullReferenceException in InstanceEnemyKillHandler, maybe???
  • Tweak logging and exception handling for RequestPacketHandler and ResponseErrorException
    • Exceptions thrown during ExecuteInTransaction no longer mangle their stack trace.
    • ResponseErrorExceptions thrown during ExecuteInTransaction properly propagate and will send the error response packet to the client.
    • ResponseErrorExceptions thrown from RequestPacketHandlers log the first line of their stack trace, in case we want to track it down later.
  • Make clan quest tracking communication between channels a little bit more verbose, so it'll correct if a packet is missed for whatever reason.

Checklist:

  • The project compiles
  • The PR targets develop branch

{
transaction.Rollback();
connection.Close();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we need to close the connection here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because it's closed in the finally, which will execute automatically when you leave the scope of the try-catch.

@@ -950,7 +950,7 @@ public PacketQueue HandleEnemyHuntRequests(Enemy enemy, DbConnection? connection

S2CQuestQuestProgressWorkSaveNtc ntc = new()
{
QuestScheduleId = quest.Key,
QuestScheduleId = questScheduleId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oops

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just a syntax change to make the iteration more explicit, not a functional one.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Key and schedule id are two different values. I could never figure out what key value was based on and it is left as zero generally.

Copy link
Collaborator Author

@RyanYappert RyanYappert Nov 29, 2024

Choose a reason for hiding this comment

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

No, in this case, quest is/was the KeyValuePair<uint, QuestState> that's returned by iterating over ActiveQuests, and that uint is actually the QuestScheduleId (see line 205). So quest.Key is not the Key field of a Quest object, but the Key field of a KeyValuePair<uint, QuestState>.

@RyanYappert RyanYappert merged commit a0236d2 into sebastian-heinz:develop Nov 29, 2024
1 check passed
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.

2 participants