feat(yggdrasil): 实现 MC 1.21.7 单用户名查 UUID 接口
对应官方 api.minecraftservices.com/minecraft/profile/lookup/name/{name},
1.21.7 的 /whitelist add 等命令会请求该接口(authlib-injector issue #277)。
authlib-injector 把 api.minecraftservices.com override 到 {apiRoot}/minecraftservices,
故路由注册在 mcServices 组下:
GET /api/yggdrasil/minecraftservices/minecraft/profile/lookup/name/:name
复用 ProfileSearchByNameSingle,返回 {id,name},未找到返回 404。
go build ./... && go test ./... 全部通过。
This commit is contained in:
@@ -186,6 +186,8 @@ func registerYggdrasilRoutesWithDI(v1 *gin.RouterGroup, h *Handlers) {
|
||||
mcServices.POST("/player/attributes", h.Friends.UpdateAttributes)
|
||||
mcServices.POST("/presence", h.Friends.UpdatePresence)
|
||||
mcServices.GET("/privacy/blocklist", h.Friends.GetBlocklist)
|
||||
// MC 1.21.7 /whitelist add 查询单用户名 UUID(authlib-injector issue #277)
|
||||
mcServices.GET("/minecraft/profile/lookup/name/:name", h.Yggdrasil.LookupProfileByName)
|
||||
}
|
||||
|
||||
authserver := ygg.Group("/authserver")
|
||||
|
||||
Reference in New Issue
Block a user