- 
                Notifications
    
You must be signed in to change notification settings  - Fork 146
 
Bug fixes #440
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
Bug fixes #440
Conversation
        
          
                feather/server/src/lib.rs
              
                Outdated
          
        
      | 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!"); | 
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
        
          
                feather/server/src/systems/view.rs
              
                Outdated
          
        
      | position, | ||
| &mut server.waiting_chunks, | ||
| )?; | ||
| // As each iteration takes a while, it can happen that a player | 
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Bug fixes
Status
Description
pull_request_template.mdinCONTRIBUTING.mdRelated issues
#411 #418 #435
Checklist
cargo fmt,cargo clippy,cargo build --releaseandcargo testand fixed any generated errors!