Refactor API and schema paths, fix key usage and profile data
Renamed 'mojangapi' directories to 'api' for both routes and schemas to standardize API structure. Updated serverService to use the correct public key (profilePropertyKeys) for server metadata. Fixed sessionsService to return full skin and cape data arrays instead of just the first element.
This commit is contained in:
parent
36a9a0b193
commit
da8ab9d488
@ -164,4 +164,4 @@ app.use((err, req, res, next) => {
|
||||
|
||||
app.listen(process.env.WEB_PORT || 3000, () => {
|
||||
logger.log(`Server listening at port : ${process.env.WEB_PORT.bold || 3000}`, ["WEB", "yellow"])
|
||||
})
|
||||
})
|
||||
|
||||
@ -4,14 +4,14 @@ const package = require("../package.json")
|
||||
|
||||
function getServerMetadata(hostname) {
|
||||
const keys = certs.getKeys()
|
||||
const publicKeyPEM = keys.playerCertificateKeys.public
|
||||
const publicKeyPEM = keys.profilePropertyKeys.public
|
||||
|
||||
const serverMeta = {
|
||||
meta: {
|
||||
serverName: process.env.SERVER_NAME || "Yggdrasil Server",
|
||||
implementationName: package.name,
|
||||
implementationVersion: package.version,
|
||||
|
||||
|
||||
"feature.legacy_skin_api": utils.isTrueFromDotEnv("SUPPORT_LEGACY_SKIN_API"),
|
||||
"feature.no_mojang_namespace": utils.isTrueFromDotEnv("SUPPORT_MOJANG_FALLBACK"),
|
||||
"feature.enable_mojang_anti_features": utils.isTrueFromDotEnv("SUPPORT_MOJANG_TELEMETRY_BLOCKER"),
|
||||
@ -36,4 +36,4 @@ function getServerMetadata(hostname) {
|
||||
|
||||
module.exports = {
|
||||
getServerMetadata
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,8 @@ async function getProfile({ uuid, unsigned = false }) {
|
||||
sessionRepository.getProfileActionsList(dbUser.uuid).catch(() => ({ data: [] }))
|
||||
])
|
||||
|
||||
const activeSkin = skinResult.data[0]
|
||||
const activeCape = capeResult.data[0]
|
||||
const activeSkin = skinResult.data
|
||||
const activeCape = capeResult.data
|
||||
const profileActions = actionsResult.data || []
|
||||
|
||||
const isSkinBanned = profileActions.includes("USING_BANNED_SKIN")
|
||||
@ -203,4 +203,4 @@ module.exports = {
|
||||
getBlockedServers,
|
||||
registerLegacySession,
|
||||
validateLegacySession,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user