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

UserConnectEvent cannot be cancelled #239

Closed
2 tasks done
GoldenGamerLP opened this issue Jun 8, 2023 · 4 comments
Closed
2 tasks done

UserConnectEvent cannot be cancelled #239

GoldenGamerLP opened this issue Jun 8, 2023 · 4 comments
Labels
status: stale This issue or pull request has not been updated in a while type: bug: unconfirmed An unconfirmed bug report

Comments

@GoldenGamerLP
Copy link

Confirmation

  • I have checked for similar issues.
  • I using the latest version of Chameleon.

Describe the bug

When canceling the UserConnectEvent, with orn without a reason, the user is not being kicked.

(Also i saw that the implementation of minestom, the events, are using EventBuilder#ignoredIfCancelled(false);, which devers the purpose of the EventSubscriber#acceptCancelled(true) )

Expected behaviour

Kicked/Denied the connection/player with a reason.

Reproduction steps

public class PlayerLoginEvent implements EventSubscriber<UserConnectEvent> {

   public PlayerLoginEvent(ChameleonPlugin pl) {
      pl.getChameleon().getEventbus().subscribe(this);
   }

   public void on(UserConnectEvent event) throws Exception {
       event.cancel(true);
   }

   @Override
   public boolean acceptCancelled() {
    //Gets ingored in the Minestom Impl
    return true;
   }
}

Exception

There is no exception.

Environment

Operating System: Windows 11 & Windows 10
Platform(s): Minestom (Latest Release)

Additional information

None

@GoldenGamerLP GoldenGamerLP added status: triage This issue is awaiting review type: bug: unconfirmed An unconfirmed bug report labels Jun 8, 2023
@joshuasing
Copy link
Member

(Also i saw that the implementation of minestom, the events, are using EventBuilder#ignoredIfCancelled(false);, which devers the purpose of the EventSubscriber#acceptCancelled(true) )

I thought EventBuilder#ignoredIfCancelled(false) meant that it should not ignore cancelled events 🤔

@GoldenGamerLP
Copy link
Author

Okay, despite it, the boolean in the EvenSubscriber doesn't get used at all.

@joshuasing
Copy link
Member

Okay, despite it, the boolean in the EvenSubscriber doesn't get used at all.

The acceptsCancelled boolean is used here: https://github.com/ChameleonFramework/Chameleon/blob/556d96ac8acdca29c092ce065dc0e7a53da5b448/api/src/main/java/dev/hypera/chameleon/event/EventBusImpl.java#LL71C31-L71C31

@joshuasing joshuasing added contributor: wanted status: investigating and removed status: triage This issue is awaiting review labels Aug 9, 2023
@joshuasing joshuasing added status: stale This issue or pull request has not been updated in a while and removed contributor: wanted status: investigating labels Aug 31, 2023
@joshuasing
Copy link
Member

Support for Minestom in Chameleon has been discontinued - #268
Sorry for any inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: stale This issue or pull request has not been updated in a while type: bug: unconfirmed An unconfirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants