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

Improve SDK exceptions #383

Merged
merged 6 commits into from
Feb 25, 2021
Merged

Improve SDK exceptions #383

merged 6 commits into from
Feb 25, 2021

Conversation

xeruf
Copy link
Member

@xeruf xeruf commented Feb 10, 2021

Was mir allerdings noch ein Rätsel ist: ein Client stoppt bei einer RescuableClientException sofort - wozu ist sie dann Rescuable? Bei nem falschen Reservierungscode oder so kann der Client doch weiterhin verbunden bleiben?

FYI some visualizations:
image
image

@xeruf xeruf added this to the 21.4.0 milestone Feb 10, 2021
Copy link
Contributor

@SKoschnicke SKoschnicke left a comment

Choose a reason for hiding this comment

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

Looks good.

The sense behind the exception hierarchy is lost, I'm afraid (I didn't program that).

Maybe we should add comments to the new exceptions describing what they are for and how the expected behavior of the server and client should be if such an exception happens? To make sure that the sense is not lost again.

sdk/src/server-api/sc/framework/plugins/AbstractGame.kt Outdated Show resolved Hide resolved
try {
ReservationManager.redeemReservationCode(source, packet.reservationCode)
} catch(e: RescuableClientException) {
source.send(ProtocolErrorMessage(packet, e.message))
Copy link
Contributor

Choose a reason for hiding this comment

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

So the exceptions are now sent here to the client instead having the handleInvalidMove method for that, right?

Copy link
Member Author

@xeruf xeruf Feb 11, 2021

Choose a reason for hiding this comment

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

no, this change has nothing to do with moves. Please look into the individual commits for coherence.

@xeruf xeruf merged commit ad8813d into master Feb 25, 2021
@xeruf xeruf deleted the sdk/exceptions branch February 25, 2021 10:21
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