Skip to content

Conversation

@FussballAndy
Copy link
Contributor

Bug fixes

Status

  • Ready
  • Development
  • Hold

Description

  • Fixed it that one profile could login multiple times
  • Fixed the server crashing when spammed with clients/Made it so that chunk updates check if the player is still there
  • Fixed Link to pull_request_template.md in CONTRIBUTING.md
  • Fixed clippy errors for 1.53

Related issues

#411 #418 #435

Checklist

  • Ran cargo fmt, cargo clippy, cargo build --release and cargo test and fixed any generated errors!
  • Removed unnecessary commented out code
  • Used specific traces (if you trace actions please specify the cause i.e. the player)

let mut clients = Vec::new();
for player in self.new_players.clone().try_iter() {
if let Some(cl) = self.clients.iter().find(|x| x.uuid() == player.uuid) {
cl.disconnect("Logged in from another location!");
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we need to return here, or else the new client gets added anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are not removing the new client but instead the old one. Thus returning would probably just break everything.

position,
&mut server.waiting_chunks,
)?;
// As each iteration takes a while, it can happen that a player
Copy link
Member

Choose a reason for hiding this comment

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

The cause of the problem isn't actually clients being removed while the loop is running, since the client list is only accessible by one thread. It happens because players in the ECS aren't removed for one extra tick after they disconnect (so plugins can handle disconnect events), and as a result, the query finds dead clients.

The solution here still works, but the comment should be changed.

Copy link
Member

@caelunshun caelunshun left a comment

Choose a reason for hiding this comment

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

Thank you!

@caelunshun caelunshun merged commit 04e0a73 into feather-rs:main Jul 1, 2021
@FussballAndy FussballAndy deleted the patch-5 branch August 10, 2021 16:44
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