Skip to content

Conversation

@hwxqyworld
Copy link

No description provided.

Comment on lines 12 to 18
"scbackendsdk.connect": "\u8FDE\u63A5\u5230 [remaddr] \u670D\u52A1\u5668\u4E0A\u7684 [instname] \u5B9E\u4F8B",
"scbackendsdk.connectwait": "\u8FDE\u63A5\u5230 [remaddr] \u670D\u52A1\u5668\u7684 [instname] \u5B9E\u4F8B \u5E76\u7B49\u5F85\u8FDE\u63A5\u5B8C\u6210",
"scbackendsdk.disconnect": "\u65AD\u5F00\u8FDE\u63A5",
"scbackendsdk.isconnected": "\u5DF2\u8FDE\u63A5\uFF1F",
"scbackendsdk.send": "\u53D1\u9001\u6D88\u606F [msg]",
"scbackendsdk.whenmessage": "\u5F53\u6536\u5230\u6D88\u606F",
"scbackendsdk.getmsg": "\u6536\u5230\u7684\u6D88\u606F"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不建议unicode编码,不太便于检查

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsup打包出来就是这样的,你加入编辑器里就可以正常显示了

Comment on lines +36 to +43
const translate = function(key) {
const locale = globalThis.navigator.language.slice(0, 2);
if (l10n_default[locale] && l10n_default[locale][key]) {
return l10n_default[locale][key];
} else {
return l10n_default["en"][key] || key;
}
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有runtime.getFormatMessage不用?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这玩意我真不知道我去改改

Comment on lines 161 to 162
async connectwait(args, util) {
await new Promise((resolve, reject) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接return这个promise呗

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对吼

Comment on lines 118 to 121
blockMenu: {
acceptReporters: true,
items: [{ text: translate("scbackendsdk.connect.wait"), value: true }, { text: translate("scbackendsdk.connect.dontwait"), value: false }]
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啥玩意,都没用上

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

忘了删了

Copy link

@BenPaoDeXiaoZhi BenPaoDeXiaoZhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你几乎无法在这个文件里找到任何一个驼峰命名的变量或属性


// src/index.js
(function(Scratch2) {
if (Scratch2.extensions.unsandboxed === false) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议直接感叹号

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsup自动打包成这样的

},
{
blockType: Scratch2.BlockType.COMMAND,
opcode: "connectwait",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

驼峰命名法这么难吗

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我记得opcode不能大写字母

if (reject) reject(event);
};
this.ws.onerror = (error) => {
if (reject) reject(error);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议添加兜底的console error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kukemc
Copy link
Contributor

kukemc commented Nov 4, 2025

与其说什么Scbackend,不如直接改成websocket扩展 还能更通用更实用一些。

@hwxqyworld
Copy link
Author

与其说什么Scbackend,不如直接改成websocket扩展 还能更通用更实用一些。

某些人说WebSocket危险,上来给我打了个危险标签,我那还敢搞,Scbackend可控一点,至于WebSocket我可不敢得罪人了

@kukemc
Copy link
Contributor

kukemc commented Nov 4, 2025

与其说什么Scbackend,不如直接改成websocket扩展 还能更通用更实用一些。

某些人说WebSocket危险,上来给我打了个危险标签,我那还敢搞,Scbackend可控一点,至于WebSocket我可不敢得罪人了

不管是ws还是你这个都过不了审,因为官方扩展是不允许这种能从网络获取信息的扩展的。

@hwxqyworld
Copy link
Author

与其说什么Scbackend,不如直接改成websocket扩展 还能更通用更实用一些。

某些人说WebSocket危险,上来给我打了个危险标签,我那还敢搞,Scbackend可控一点,至于WebSocket我可不敢得罪人了

不管是ws还是你这个都过不了审,因为官方扩展是不允许这种能从网络获取信息的扩展的。

?为啥啊,mmo不也从网络获取信息
如果我给捐一个后端大家一起用,是不是可以

@kukemc
Copy link
Contributor

kukemc commented Nov 4, 2025

与其说什么Scbackend,不如直接改成websocket扩展 还能更通用更实用一些。

某些人说WebSocket危险,上来给我打了个危险标签,我那还敢搞,Scbackend可控一点,至于WebSocket我可不敢得罪人了

不管是ws还是你这个都过不了审,因为官方扩展是不允许这种能从网络获取信息的扩展的。

?为啥啊,mmo不也从网络获取信息 如果我给捐一个后端大家一起用,是不是可以

第三方的后端第一不能保证服务的稳定性,第二是不能保证传输的内容一定是安全的,第三用户可以自由改后端 写个获取什么不是轻轻松松的事情

@hwxqyworld
Copy link
Author

与其说什么Scbackend,不如直接改成websocket扩展 还能更通用更实用一些。

某些人说WebSocket危险,上来给我打了个危险标签,我那还敢搞,Scbackend可控一点,至于WebSocket我可不敢得罪人了

不管是ws还是你这个都过不了审,因为官方扩展是不允许这种能从网络获取信息的扩展的。

?为啥啊,mmo不也从网络获取信息 如果我给捐一个后端大家一起用,是不是可以

第三方的后端第一不能保证服务的稳定性,第二是不能保证传输的内容一定是安全的,第三用户可以自由改后端 写个获取什么不是轻轻松松的事情

那,怎么办,现在社区里外挂大哥作妖就不管了吗

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants