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

不兼容 Java 9+ 编译的代码 #130

Closed
developer-ken opened this issue Jul 8, 2021 · 6 comments
Closed

不兼容 Java 9+ 编译的代码 #130

developer-ken opened this issue Jul 8, 2021 · 6 comments

Comments

@developer-ken
Copy link

使用authlib服务器登录时出现错误,日志后附;不更改任何服务端设置的情况下客户端正版登录可以连接,看起来就像AuthlibInjector没有工作一样。但启动时确实出现了Authlibinjector的日志(后附)。
之前正常使用的,今天刚升级了最新版MC,然后就出现了这个问题

环境:

> version
[00:55:32 INFO]: Checking version, please wait...
[00:55:33 INFO]: This server is running Paper version git-Paper-90 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: bb44da8)
You are running the latest version
root@debian:~# java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)

启动日志:

minecraft@debian:/storage/mc$ ./start.sh
[authlib-injector] [INFO] Logging file: /storage/mc/authlib-injector.log
[authlib-injector] [INFO] Version: 1.1.38
[authlib-injector] [INFO] Authentication server: https://auth.api.microstorm.tech/
[authlib-injector] [DEBUG] Metadata: {"meta":{"serverName":"\u9e21\u86cb\u7684Minecraft\u9274\u6743\u670d\u52a1\u5668","implementationName":"mcpc-authserver","implementationVersion":"1.1"},"skinDomains":[".microstorm.tech",".postimg.cc",".wenhairu.com"],"signaturePublickey":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxulQKd8aLySR9LUlSl54DpqV3NP8ZvpHGcDRCq0CcDSBpfZlVswvcfbHW6UlstlPN9\/9rqqP7ft8\/HIJVkosWgBZ2P+4jl7RzTvDGl3tl5PubLCrnBIXHplK+O1jQhy42ww9+4hwhruLmfOr6I4VLP5deyX6euKWikvs3p95QW7gVw0Tar2ArEi0n6o+pNJcYRBbKSjOK8LZ4UfiD1jKelDD0fyP8utk2Q\/yZFEpkZaQVVuNyRZThOkhkcp46HHXGxE+wlJGDNiKVj2RlbdsBCNDk7EtpCXFBlV\/HoPrCog2nVQGpWuiIxoDG2rHOZ8kc7aZvEcJucQhtUiSL6CSdIQANUuq6jhvQ5nRLxpeS2QnemZt7J18fVymTIaV\/AAiDx3uROtfd3PWQKaSF5oCA5TzvQcgBeAmX1A\/SBfxAj\/i7BvfxGhfS3GysJnXwzdDG0pt8LP0gjvhCy8R9fCAk+\/pMN49VLfM7hRjA4SR6jKkgOm0yEDlFhLrH1bnglYktcPiH00UxwHbx0bzewoqHBTyBhQpBIo3aNn4vvUxKriv6iSuY2NEgumZ3WrthoYCrkhDqWi+cGvPlEZiXWY6JVIHp3oN+Bu0YxofwEmYHuTw0Ph2N+6Ld3cMml84oDWphW+US005Yuq4QqfFpPRU0CVG+4SYrXYjbH0O059bBdUCAwEAAQ==\n-----END PUBLIC KEY-----"}
[authlib-injector] [DEBUG] Parsed metadata: APIMetadata [apiRoot=https://auth.api.microstorm.tech/, skinDomains=[.microstorm.tech, .postimg.cc, .wenhairu.com], decodedPublickey=Optional[Sun RSA public key, 4096 bits
  params: null
  modulus: 811487629230244266786368400501019739087227225611307327323526242937569651918008777102456484212123916584297597137641358880756445197247927885326839900639315799050802750835259685766052376590166870876413079586710842755318939723237877475544241334588555781515063283824364957174420673565549435442625590517743589616463577075221777923595874061169017130424659135986922602837324777268987231544200626511013829369436925776681020562333179055911567266151656065202981417285580177998307073577357243183530152529058044086138884669452879651190081571415083527303215204557886018650140451872819876076262531657321301922468719937759491012900531514843497370496747649715116577549905514988880796703074145232711034940392450136608895894372347513818267397903187553136492548693023654484082381600742540508242825814354441493247125606721371650206203722851699458604260048648815043058472229719506238801543327585459568837196613751556748923976754942431450776800430773941139676245527337506030965357519389477281726442633789643132915103922138172282372775849847540779844622861565479167777644417115327258016146462373068390275802688598084588148512125431452630629527397896890316400391491588435957775902536016351641556909015760705368634949081400393930063257759253207892625999988181
  public exponent: 65537], meta={implementationName=mcpc-authserver, implementationVersion=1.1, serverName=鸡蛋的Minecraft鉴权服务器}]
[authlib-injector] [INFO] Polyfill privileges API
System Info: Java 16 (OpenJDK 64-Bit Server VM 16.0.1+9) Host: Linux 4.19.0-17-amd64 (amd64)
Loading libraries, please wait...
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService] with [Authlib Log Interceptor]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService] with [Callback Metafactory Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [Authlib Log Interceptor]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [ConcatenateURL Workaround]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [Callback Metafactory Transformer]
[authlib-injector] [INFO] Registered log handler on jdk.internal.loader.ClassLoaders$AppClassLoader@7a69b07
[authlib-injector] [DEBUG] Transformed url [https://authserver.mojang.com] to [https://auth.api.microstorm.tech/authserver]
[authlib-injector] [INFO] Httpd is running on port 33189
[authlib-injector] [DEBUG] Transformed url [https://api.mojang.com] to [http://127.0.0.1:33189/https/api.mojang.com]
[authlib-injector] [DEBUG] Transformed url [https://sessionserver.mojang.com] to [http://127.0.0.1:33189/https/sessionserver.mojang.com]
[authlib-injector] [DEBUG] Transformed url [https://api.minecraftservices.com] to [http://127.0.0.1:33189/https/api.minecraftservices.com]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilEnvironment] with [Constant URL Transformer]
Environment: authHost='https://auth.api.microstorm.tech/authserver', accountsHost='http://127.0.0.1:33189/https/api.mojang.com', sessionHost='http://127.0.0.1:33189/https/sessionserver.mojang.com', servicesHost='http://127.0.0.1:33189/https/api.minecraftservices.com', name='PROD'
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Texture Whitelist Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Yggdrasil Public Key Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Callback Metafactory Transformer]

错误日志:

[00:52:45 INFO]: Disconnecting protocolsupport.protocol.utils.authlib.LoginProfile(name: D_Ken, originalName: D_Ken, uuid: null, originalUUID: null, onlinemode: true) (/127.0.0.1:58786): Authentication servers are down. Please try again later, sorry!
[00:52:45 ERROR]: Couldn't verify username because servers are unavailable
[00:52:45 INFO]: protocolsupport.protocol.utils.authlib.LoginProfile(name: D_Ken, originalName: D_Ken, uuid: null, originalUUID: null, onlinemode: true) (/127.0.0.1:58786) lost connection:

@yushijinhun
Copy link
Owner

我使用 Paper 1.17.1 Build 104 + LittleSkin 进行了测试,没有遇到问题。你可以使用 LittleSkin 测试一下,看看是否是验证服务器的问题。

@developer-ken
Copy link
Author

服务器版本:
[14:59:45] [Server thread/INFO]: This server is running Paper version git-Paper-90 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: bb44da8)
使用LittleSkin问题依旧

Logging started at 2021-08-11T06:59:39.624891900Z
[authlib-injector] [INFO] Version: 1.1.38
[authlib-injector] [INFO] Authentication server: https://mcskin.littleservice.cn/api/yggdrasil
[authlib-injector] [DEBUG] Metadata: {"meta":{"serverName":"LittleSkin","implementationName":"Yggdrasil API for Blessing Skin","implementationVersion":"5.1.1","links":{"homepage":"https:\/\/mcskin.littleservice.cn","register":"https:\/\/mcskin.littleservice.cn\/auth\/register"},"feature.non_email_login":true},"skinDomains":["skin.prinzeugen.net","mcskin.littleservice.cn"],"signaturePublickey":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEArGcNOOFIqLJSqoE3u0hj\ntOEnOcET3wj9Drss1BE6sBqgPo0bMulOULhqjkc\/uH\/wyosYnzw3xaazJt87jTHh\nJ8BPMxCeQMoyEdRoS3Jnj1G0Kezj4A2b61PJJM1DpvDAcqQBYsrSdpBJ+52MjoGS\nvJoeQO5XUlJVQm21\/HmJnqsPhzcA6HgY71RHYE5xnhpWJiPxLKUPtmt6CNYUQQoS\no2v36XWgMmLBZhAbNOPxYX+1ioxKamjhLO29UhwtgY9U6PWEO7\/SBfXzyRPTzhPV\n2nHq7KJqd8IIrltslv6i\/4FEM81ivS\/mm+PN3hYlIYK6z6Ymii1nrQAplsJ67OGq\nYHtWKOvpfTzOollugsRihkAG4OB6hM0Pr45jjC3TIc7eO7kOgIcGUGUQGuuugDEz\nJ1N9FFWnN\/H6P9ukFeg5SmGC5+wmUPZZCtNBLr8o8sI5H7QhK7NgwCaGFoYuiAGL\ngz3k\/3YwJ40BbwQayQ2gIqenz+XOFIAlajv+\/nyfcDvZH9vGNKP9lVcHXUT5YRnS\nZSHo5lwvVrYUrqEAbh\/zDz8QMEyiujWvUkPhZs9fh6fimUGxtm8mFIPCtPJVXjeY\nwD3Lvt3aIB1JHdUTJR3eEc4eIaTKMwMPyJRzVn5zKsitaZz3nn\/cOA\/wZC9oqyEU\nmc9h6ZMRTRUEE4TtaJyg9lMCAwEAAQ==\n-----END PUBLIC KEY-----\n"}
[authlib-injector] [DEBUG] Parsed metadata: APIMetadata [apiRoot=https://mcskin.littleservice.cn/api/yggdrasil/, skinDomains=[skin.prinzeugen.net, mcskin.littleservice.cn], decodedPublickey=Optional[Sun RSA public key, 4096 bits
  params: null
  modulus: 703341022079292672117834809642813454947205717819976869691035011464340374097341561815075061295962821503821889017258163013620890297485949824623916013282058406852194654293439731660792131036308629114119124459143637499075489459133834794403760902722873864730869395374447208180372410566177382060435857514800531148552669895567333226514747355395918437087351552262836651754891577513159115382925848834960993678968391764437354905499178002435808649343278626139444918705443484507545277921290646887561763748226632249892574393500817627650895849935805669017367301687662877178312666081658003279041130457578181680356055336737679573633480666755827426816980151192968247349094517909780497449870136684389239039674344986483095024781094033783584282626219714339631257243849078404899462229285284234043421774732664960471577013988299575513108247972103507432168151372910822057616619553445780075738045598935382401765772383054689377659488114992477103520067017636712507571569740532485325978133145594333469046331412253404487791063896345147405356027020225125718717261513963338552874121624247178105595670436007039896254375208854326124970383415346446423049556309036542192435009880564911270490508210189063923984309567408249048378259856386300946061535781204509742640199251
  public exponent: 65537], meta={feature.non_email_login=true, implementationName=Yggdrasil API for Blessing Skin, implementationVersion=5.1.1, links={"homepage":"https:\/\/mcskin.littleservice.cn","register":"https:\/\/mcskin.littleservice.cn\/auth\/register"}, serverName=LittleSkin}]
[authlib-injector] [INFO] Polyfill privileges API
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService] with [Authlib Log Interceptor]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService] with [Callback Metafactory Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [Authlib Log Interceptor]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [ConcatenateURL Workaround]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [Callback Metafactory Transformer]
[authlib-injector] [INFO] Registered log handler on jdk.internal.loader.ClassLoaders$AppClassLoader@63947c6b
[authlib-injector] [DEBUG] Transformed url [https://authserver.mojang.com] to [https://mcskin.littleservice.cn/api/yggdrasil/authserver]
[authlib-injector] [INFO] Httpd is running on port 55486
[authlib-injector] [DEBUG] Transformed url [https://api.mojang.com] to [http://127.0.0.1:55486/https/api.mojang.com]
[authlib-injector] [DEBUG] Transformed url [https://sessionserver.mojang.com] to [http://127.0.0.1:55486/https/sessionserver.mojang.com]
[authlib-injector] [DEBUG] Transformed url [https://api.minecraftservices.com] to [http://127.0.0.1:55486/https/api.minecraftservices.com]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilEnvironment] with [Constant URL Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Texture Whitelist Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Yggdrasil Public Key Transformer]
[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Callback Metafactory Transformer]
[authlib-injector] [DEBUG] Transformed url [https://sessionserver.mojang.com/session/minecraft/profile/] to [http://127.0.0.1:55486/https/sessionserver.mojang.com/session/minecraft/profile/]
[authlib-injector] [INFO] Transformed [net.citizensnpcs.Settings$Setting] with [Constant URL Transformer]
[authlib-injector] [INFO] Transformed [net.citizensnpcs.Settings$Setting] with [Citizens2 Support]

@developer-ken
Copy link
Author

developer-ken commented Aug 11, 2021

另经Postman调试,我之前那个验证服务器能够按照Yddrasil协议正确处理服务器验证客户端请求的,而且使用远古版本authlibinjector时没有出现这个问题。
但是远古版本在1.17上用不了了

我服务器上使用了protocolsupport,该插件无法跨版本使用所以没法换回老的做排除法,怀疑有可能也和它有一定的关系

@yushijinhun
Copy link
Owner

我服务器上使用了protocolsupport,该插件无法跨版本使用所以没法换回老的做排除法,怀疑有可能也和它有一定的关系

@developer-ken 如果移除 ProtocolSupport 插件还会有问题吗?

@yushijinhun
Copy link
Owner

确认与 ProtocolSupport 插件存在兼容性问题。

@yushijinhun yushijinhun changed the title Couldn't verify username because servers are unavailable 不兼容 ProtocolSupport 插件 Aug 20, 2021
@yushijinhun
Copy link
Owner

这是因为 ProtocolSupport 1.17.1 插件使用 Java 16 编译。自 Java 9 起,Java 字符串连接使用 invokedynamic 完成(JEP 280),authlib-injector 并没有对此做处理。

@yushijinhun yushijinhun changed the title 不兼容 ProtocolSupport 插件 不兼容 Java 9+ 编译的代码 Aug 20, 2021
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

2 participants