SOF3 / await-std

Virion for writing PocketMine plugins in await style
Apache License 2.0
29 stars 7 forks source link

Player disposable doesn't work #7

Closed Endermanbugzjfc closed 2 years ago

Endermanbugzjfc commented 2 years ago
Await::f2c(function () {
    while (true) {
        var_dump("cor 1");
        try {
            $event = yield Quest::getInstance()->getStd()->awaitEvent(
                PlayerInteractEvent::class,
                fn(PlayerInteractEvent $event) => $event->getPlayer() === $this->getPlayer(),
                false,
                EventPriority::MONITOR,
                false,
                $this->getPlayer()
            );
        } catch (DisposeException) {
            var_dump("cor 2");
string(5) "cor 1"
[18:18:15.074] [Server thread/DEBUG]: [Quest] Queuing mode-3 query: SELECT quest_identifier, task_data, dialog_data, completed, version\n FROM player_quest_progress\n WHERE uuid = 'dbd5485b425c333697fea3f5c947e6e0'; | Args: []
[18:18:15.075] [Server thread/INFO]: BoxierChimera37[/0.0.0.0:19132] logged in with entity id 1 at (world, 256, 65, 256)
^R
[18:18:15.609] [Server thread/DEBUG]: [NetworkSession: 0.0.0.0 19132] Waiting for chunk radius request
[18:18:15.618] [Server thread/DEBUG]: [NetworkSession: 0.0.0.0 19132] Waiting for chunk radius request
[18:18:15.618] [Server thread/DEBUG]: [Player: BoxierChimera37] Setting view distance to 2 (requested 4)
[18:18:15.623] [Server thread/DEBUG]: Created new chunk packet cache (world#23553, compressor#25)
pl
[18:18:16.126] [Server thread/INFO]: Plugins (4): DEVirion v1.2.8, DevTools v1.15.0, FakePlayer v0.0.1, Quest v1.0.0

[18:18:17.551] [Server thread/WARNING]: [Update Checker] Your version of PocketMine-MP is out of date. Version 4.0.8 was released on Tue Jan 25 11:33:53 2022
[18:18:17.551] [Server thread/WARNING]: [Update Checker] Details: https://github.com/pmmp/PocketMine-MP/releases/tag/4.0.8
[18:18:17.551] [Server thread/WARNING]: [Update Checker] Download: https://github.com/pmmp/PocketMine-MP/releases/download/4.0.8/PocketMine-MP.phar
[18:18:18.145] [Server thread/DEBUG]: [NetworkSession: 0.0.0.0 19132] Sending spawn notification, waiting for spawn response
kick b
[18:18:19.032] [Server thread/INFO]: [NetworkSession: 0.0.0.0 19132] Session closed due to Kicked by admin.
[18:18:19.037] [Server thread/INFO]: [CONSOLE: Kicked BoxierChimera37 from the game]
Endermanbugzjfc commented 2 years ago

So the problem is here...

https://github.com/SOF3/await-std/blob/88202ef86e18f415231b5c16e12b173c4c908f90/src/SOFe/AwaitStd/EventAwaiter.php#L37-L44 image

kick b
[04:03:08.164] [Server thread/INFO]: [NetworkSession: 0.0.0.0 19132] Session closed due to Kicked by admin.
string(1) "3"
string(1) "4"
string(1) "5"
string(1) "6"
[04:03:08.169] [Server thread/INFO]: BoxierChimera37 left the game