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

upd: kick notification on client side & fix: no kick option for local user #822

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

somanshurath
Copy link
Contributor

@somanshurath somanshurath commented Dec 9, 2024

fix: dont show kick for local user

@somanshurath
Copy link
Contributor Author

somanshurath commented Dec 9, 2024

Preview:
Screenshot from 2024-12-09 17-10-42

src/network.zig Outdated Show resolved Hide resolved
src/network.zig Outdated Show resolved Hide resolved
src/network.zig Outdated Show resolved Hide resolved
@somanshurath
Copy link
Contributor Author

somanshurath commented Dec 9, 2024

@IntegratedQuantum as of now we have three possible "disconnect" reasons right?

  • kick
  • exit
  • connectionTimeout

@somanshurath somanshurath changed the title fix: dont show kick for local user upd: kick notification on client side & fix: no kick option for local user Dec 9, 2024
@IntegratedQuantum
Copy link
Member

Yes. We could have more in the future though.

shouldExitToMenu.store(true, .monotonic);
exitNotification.store(exitData, .monotonic);
Copy link
Member

Choose a reason for hiding this comment

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

Having two atomics like this is a problem.
The main thread could see the new value of shouldExitToMenu, but still see the old value of exitNotification, which causes a small chances of seeing an incorrect exit value.

Could you maybe just use one attomic of ?network.DisconnectType to cover both in one?

@@ -21,6 +21,26 @@ const Vec3f = vec.Vec3f;
const Vec3i = vec.Vec3i;
const NeverFailingAllocator = main.utils.NeverFailingAllocator;

pub const DisconnectType = enum(u8) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't particularly like that this is just declared randomly at the beginning of the file.
Wouldn't it make more sense to move it into the disconnect protocol?

src/network.zig Show resolved Hide resolved
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