Skip to content

[Bug]: 玩家进服被立刻断开时,监听进服事件的函数无法获取玩家信息 #337

Description

@dlcnx

Describe the bug

当在进服事件onPreJoin或onJoin中立刻断开玩家连接时,
其他监听进服事件的函数无法正常获取玩家的信息(例如xuid、坐标信息)。

测试代码:

mc.listen("onJoin", (player) => {
    player.disconnect("test");
})
mc.listen("onJoin", (player) => {
    logger.log(player)
    logger.log(player.xuid);
    logger.log(player.pos);
})

打印结果:

22:56:18.976 INFO [BugTest] <Player>
22:56:18.976 INFO [BugTest] <Null>
22:56:18.976 INFO [BugTest] <Null>

虽然玩家对象仍然存在,但玩家的属性均为空

To Reproduce

同上

Expected behavior

正常返回玩家对象的各项信息

Screenshots

No response

Platform

No response

BDS Version

1.21.124

LeviLamina Version

1.7.7

LegacyScriptEngine Version

0.16.1

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions