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

[proposal] 自定义验证服务器图标 - Customized authentication server icon #110

Open
yushijinhun opened this issue Mar 6, 2021 · 11 comments

Comments

@yushijinhun
Copy link
Owner

技术细节

该提案在验证服务器元数据的 meta 中增加了一个 icon 字段,其值是指向验证服务器图标的一个 URL。

启动器可以在验证服务器名称前显示该图标。

对图标的要求:

  • PNG 格式
  • 长宽等高

例子

验证服务器元数据:

{
    "meta": {
        "icon": "https://example.com/authserver-icon.png",
        ...
    },
    ...
}

English translation

Technical details

This proposal adds a icon property to the meta object in the authentication server metadata. The value of icon property is a URL pointing to the icon of the authentication server.

Launchers can display the icon alongside the name of the authentication server.

Requirements for icons:

  • Must be in PNG format
  • Width and height must be equal

Examples

Authentication server metadata:

{
    "meta": {
        "icon": "https://example.com/authserver-icon.png",
        ...
    },
    ...
}

/cc @huanghongxun @g-plane @erickskrauch

@qwq233
Copy link

qwq233 commented Mar 6, 2021

你要考虑五花八门的图片格式和诡异的路径 还有恶意链接 最好的方式就是直接提供base64的图片

@erickskrauch
Copy link

Overall, looks good to me. But you really need to add the ability to embed an icon in the meta-information for preached meta info format.

@yushijinhun
Copy link
Owner Author

yushijinhun commented Mar 6, 2021

Overall, looks good to me. But you really need to add the ability to embed an icon in the meta-information for preached meta info format.

If you want to embed the icon in the metadata, we can use Base64 data URLs. But I'm afraid that an embedded icon will make the metadata too long. The metadata will be Base64-encoded again and passed to the game as an argument, which will definitely exceed the Windows max command line length (32767 characters).

Maybe authlib-injector has to use a different parameter passing mechanism to bypass the limit.

@g-plane
Copy link

g-plane commented Mar 6, 2021

只能 PNG 格式是启动器的限制吗?

@erickskrauch
Copy link

In general, I would say that this is not our problem :) The point is to mention in the documentation that the icon field might contain the base64-encoded contents so that integrators take into account the possibility of finding such value.

@qwq233
Copy link

qwq233 commented Mar 6, 2021

Overall, looks good to me. But you really need to add the ability to embed an icon in the meta-information for preached meta info format.

If you want to embed the icon in the metadata, we can use Base64 data URLs. But I'm afraid that an embedded icon will make the metadata too long. The metadata will be Base64-encoded again and passed to the game as an argument, which will definitely exceed the Windows max command line length (32767 characters).

Maybe authlib-injector has to use a different parameter passing mechanism to bypass the limit.

my idea is to provide a boolean value, if it is true, the base64 of the picture will be retrieved from an address of the api(for example: /getfavicon ). If it is false, default or none.

@yushijinhun
Copy link
Owner Author

只能 PNG 格式是启动器的限制吗?

@g-plane It means if you use formats other than PNG, the behavior is undefined.

@yushijinhun
Copy link
Owner Author

In general, I would say that this is not our problem :) The point is to mention in the documentation that the icon field might contain the base64-encoded contents so that integrators take into account the possibility of finding such value.

Currently, we require launchers to add a JVM argument that encodes the metadata, so authlib-injector doesn't need to fetch the metadata again. (-Dauthlibinjector.yggdrasil.prefetched={Base64-encoded metadata})

If the metadata is too long, the game will be unable to start.

@g-plane
Copy link

g-plane commented Mar 6, 2021

Is this icon used in launchers only?

@yushijinhun
Copy link
Owner Author

Is this icon used in launchers only?

So far, yes.

@mochaaP
Copy link

mochaaP commented Jul 27, 2021

我觉得可以单独加一个 manifest.json 指定不同 size 的 URL,如下

{
  "icons": {
    "32": "https://example.com/icon/32x32.png",
    "64": "https://example.com/icon/64x64.png",
    "512": "https://example.com/icon/512x512.png"
  }
}

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

No branches or pull requests

5 participants