Skip to content

[Bug]: 使用 setBossBar 时仍然有几率遇到“服务端发送了破损的数据包”的情况 #50

@TRDSCSH

Description

@TRDSCSH

Describe the bug

使用 setBossBar 时仍然存在问题:当内容为一些字符串时,玩家客户端将会显示 “服务端发送了破损的数据包”。

相关评论:#49 (comment)

To Reproduce

我测试并找到了一些导致异常的字符串:[出现异常的文本。] str:这是一句中文! Bing 搜索引擎?

可以使用以下 JS 插件复现 Bug:

let onlinePlayers = new Array;

setInterval(() => {
    for (let i = 0; i < onlinePlayers.length; i++) {
        const pl = onlinePlayers[i];
        pl.setBossBar(10000/*uid*/, "Bing 搜索引擎?"/*content*/, 100/*percent*/, 0/*colour*/);
        // [出现异常的文本。]
        // str:这是一句中文!
        // Bing 搜索引擎?
    }
}, 1000);

mc.listen("onJoin", (pl) => {
    setTimeout(() => {
        onlinePlayers = mc.getOnlinePlayers();
        pl.tell("Test");
    }, 2000);
});

mc.listen("onLeft", (pl) => {
    onlinePlayers = mc.getOnlinePlayers();
});

Expected behavior

setBossBar 的内容参数可以是任意的字符串而不会导致客户端显示“服务端发送了破损的数据包”。

Screenshots

No response

Platform

Windows Server 2022 Datacenter

BDS Version

1.20.62.02

LeviLamina Version

0.9.0

LegacyScriptEngine Version

0.4.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions