diff --git a/main.go b/main.go index 8b0e8e8..7c3c27c 100644 --- a/main.go +++ b/main.go @@ -151,6 +151,7 @@ func main() { serverMeta.Meta.ImplementationVersion = meta.ImplementationVersion serverMeta.Meta.FeatureNoMojangNamespace = true serverMeta.Meta.FeatureEnableProfileKey = true + serverMeta.Meta.FeatureEnableMojangAntiFeatures = true serverMeta.Meta.Links.Homepage = meta.SkinRootUrl + "/profile/" serverMeta.Meta.Links.Register = meta.SkinRootUrl + "/profile/" serverMeta.SkinDomains = meta.SkinDomains diff --git a/router/home_router.go b/router/home_router.go index fbf06d6..599d40d 100644 --- a/router/home_router.go +++ b/router/home_router.go @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023. Gardel and contributors + * Copyright (C) 2022-2025. Gardel and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -33,10 +33,11 @@ type MetaInfo struct { Homepage string `json:"homepage,omitempty"` Register string `json:"register,omitempty"` } `json:"links"` - FeatureNonEmailLogin bool `json:"feature.non_email_login,omitempty"` - FeatureLegacySkinApi bool `json:"feature.legacy_skin_api,omitempty"` - FeatureNoMojangNamespace bool `json:"feature.no_mojang_namespace,omitempty"` - FeatureEnableProfileKey bool `json:"feature.enable_profile_key,omitempty"` + FeatureNonEmailLogin bool `json:"feature.non_email_login,omitempty"` + FeatureLegacySkinApi bool `json:"feature.legacy_skin_api,omitempty"` + FeatureNoMojangNamespace bool `json:"feature.no_mojang_namespace,omitempty"` + FeatureEnableProfileKey bool `json:"feature.enable_profile_key,omitempty"` + FeatureEnableMojangAntiFeatures bool `json:"feature.enable_mojang_anti_features,omitempty"` } type ServerMeta struct { diff --git a/router/init.go b/router/init.go index aad87d9..03fa149 100644 --- a/router/init.go +++ b/router/init.go @@ -79,6 +79,7 @@ func InitRouters(router *gin.Engine, db *gorm.DB, meta *ServerMeta, smtpCfg *ser } minecraftservices := router.Group("/minecraftservices") { + minecraftservices.GET("/player/attributes", userRouter.PlayerAttributes) minecraftservices.POST("/player/certificates", userRouter.ProfileKey) minecraftservices.GET("/publickeys", homeRouter.PublicKeys) minecraftservices.GET("/minecraft/profile/lookup/:uuid", userRouter.UUIDToUUID) diff --git a/router/user_router.go b/router/user_router.go index a2840a8..c244da2 100644 --- a/router/user_router.go +++ b/router/user_router.go @@ -38,6 +38,7 @@ type UserRouter interface { UUIDToUUID(c *gin.Context) QueryUUIDs(c *gin.Context) QueryProfile(c *gin.Context) + PlayerAttributes(c *gin.Context) ProfileKey(c *gin.Context) SendEmail(c *gin.Context) VerifyEmail(c *gin.Context) @@ -299,6 +300,21 @@ func (u *userRouterImpl) QueryProfile(c *gin.Context) { c.JSON(http.StatusOK, response) } +func (u *userRouterImpl) PlayerAttributes(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{ + "privileges": gin.H{ + "onlineChat": true, + "multiplayerServer": true, + "multiplayerRealms": false, + "telemetry": false, + "optionalTelemetry": false, + }, + "profanityFilterPreferences": gin.H{ + "profanityFilterOn": false, + }, + }) +} + func (u *userRouterImpl) ProfileKey(c *gin.Context) { bearerToken := c.GetHeader("Authorization") if len(bearerToken) < 8 {