mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-10-22 19:22:04 +00:00
The old Windows64 port had no real player identity — it used hardcoded fake XUIDs, so anyone could impersonate anyone. This replaces that with proper auth supporting Mojang, Ely.by, and offline accounts. MCAuth library (new, MCAuth/): Mojang auth via MSA device code flow (XBL, SISU, MC services), Ely.by via Yggdrasil with 2FA, offline UUID generation matching Java Edition (MD5 v3 from "OfflinePlayer:<name>"). Multi-account manager with background token refresh, per-slot sessions, and on-disk token persistence. Server-side session verification via Mojang/Ely.by hasJoined API. Skin fetching and PNG validation from texture servers. Network protocol (version bumped to 80): Three new packets (AuthScheme, AuthResponse, AuthResult) implement a server-driven auth handshake before login completes. Player identity migrated from 64-bit XUID to 128-bit GameUUID backed by two uint64 fields (hi/lo). readPlayerUID/writePlayerUID now serialize 16 bytes on the wire. Old and new clients cannot connect to each other — version mismatch is rejected at PreLogin. Save migration: Map data mappings auto-migrate from old format: the old 64-bit XUID is placed in hi, lo is set to 0 as a sentinel. On first access by the real player, the sentinel entry is upgraded in-place to the full 128-bit UUID. Format detection is by file size (2080, 2112, or 4160 bytes). Player .dat filenames inside saveData.ms change from decimal XUID to dashed UUID — old saves need manual entry renaming in the archive. UI: NativeUIRenderer: immediate-mode drawing system (quads, text, 9-slice panels, scrollbars, focus lists) for rendering auth screens without Flash/Scaleform. UIScene_MSAuth handles device code display, Ely.by credential input with 2FA, per-account skin head preview, and multi-account add/remove/switch. Server: online-mode and auth-provider (mojang/elyby) in server.properties. Whitelist and ban checks validate against the server-verified UUID. Incompatible auth scheme logs which provider the server expects vs what the client is using. Also fixes a pre-existing exploit where any client could send a DebugOptionsPacket to grant themselves CraftAnything and other debug privileges on any server — now requires OP status server-side.
102 lines
3.2 KiB
CMake
102 lines
3.2 KiB
CMake
function(setup_asset_folder_copy TARGET_NAME ASSET_FOLDER_PAIRS)
|
|
set(COPY_FOLDER_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CopyFolderScript.cmake")
|
|
|
|
# Global exclusions applied to every folder copy
|
|
set(ASSET_EXCLUDE_FILES
|
|
"*.cpp" "*.h"
|
|
"*.xml" "*.lang"
|
|
"*.bat" "*.cmd"
|
|
"*.msscmp" "*.binka" # Old audio formats
|
|
"*.swf" # These are built into the .arc
|
|
"*.resx" "*.loc"
|
|
"*.wav" # Unsupported audio format
|
|
"*.xui"
|
|
)
|
|
|
|
# Global folder exclusions applied to every folder copy
|
|
# Graphics/ must not be excluded — NativeUI loads PNGs from disk
|
|
set(ASSET_EXCLUDE_FOLDERS
|
|
)
|
|
|
|
# Exclude platform-specific arc media files
|
|
set(PLATFORM_MEDIA_FILES
|
|
"MediaWindows64.arc"
|
|
"MediaDurango.arc"
|
|
"MediaOrbis.arc"
|
|
"MediaPS3.arc"
|
|
"MediaPSVita.arc"
|
|
"MediaXbox.arc" # Seems to be missing?
|
|
)
|
|
|
|
# Exclude all platform media files except the one for the current platform
|
|
foreach(media_file IN LISTS PLATFORM_MEDIA_FILES)
|
|
if(NOT media_file MATCHES "Media${PLATFORM_NAME}\\.arc")
|
|
list(APPEND ASSET_EXCLUDE_FILES "${media_file}")
|
|
endif()
|
|
endforeach()
|
|
|
|
# Join the exclusion patterns into a single string for passing to the copy script
|
|
list(JOIN ASSET_EXCLUDE_FILES "|" ASSET_EXCLUDE_FILES_STR)
|
|
list(JOIN ASSET_EXCLUDE_FOLDERS "|" ASSET_EXCLUDE_FOLDERS_STR)
|
|
|
|
set(copy_commands "")
|
|
list(LENGTH ASSET_FOLDER_PAIRS pair_count)
|
|
math(EXPR last "${pair_count} - 1")
|
|
|
|
# Loop through the source;dest pairs and create a copy command for each
|
|
foreach(i RANGE 0 ${last} 2)
|
|
math(EXPR j "${i} + 1")
|
|
list(GET ASSET_FOLDER_PAIRS ${i} src)
|
|
list(GET ASSET_FOLDER_PAIRS ${j} dest)
|
|
|
|
list(APPEND copy_commands
|
|
COMMAND ${CMAKE_COMMAND}
|
|
"-DCOPY_SOURCE=${src}"
|
|
"-DCOPY_DEST=$<TARGET_FILE_DIR:${TARGET_NAME}>/${dest}"
|
|
"-DEXCLUDE_FILES=${ASSET_EXCLUDE_FILES_STR}"
|
|
"-DEXCLUDE_FOLDERS=${ASSET_EXCLUDE_FOLDERS_STR}"
|
|
-P "${COPY_FOLDER_SCRIPT}"
|
|
)
|
|
endforeach()
|
|
|
|
add_custom_target(AssetFolderCopy_${TARGET_NAME} ALL
|
|
${copy_commands}
|
|
COMMENT "Copying assets (folders) for ${TARGET_NAME}..."
|
|
VERBATIM
|
|
)
|
|
|
|
add_dependencies(${TARGET_NAME} AssetFolderCopy_${TARGET_NAME})
|
|
set_property(TARGET AssetFolderCopy_${TARGET_NAME} PROPERTY FOLDER "Build")
|
|
endfunction()
|
|
|
|
function(setup_asset_file_copy TARGET_NAME ASSET_FILE_PAIRS)
|
|
set(COPY_FILE_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CopyFileScript.cmake")
|
|
|
|
set(copy_commands "")
|
|
list(LENGTH ASSET_FILE_PAIRS pair_count)
|
|
math(EXPR last "${pair_count} - 1")
|
|
|
|
# Loop through the source;dest pairs and create a copy command for each
|
|
foreach(i RANGE 0 ${last} 2)
|
|
math(EXPR j "${i} + 1")
|
|
list(GET ASSET_FILE_PAIRS ${i} src)
|
|
list(GET ASSET_FILE_PAIRS ${j} dest)
|
|
|
|
list(APPEND copy_commands
|
|
COMMAND ${CMAKE_COMMAND}
|
|
"-DCOPY_SOURCE=${src}"
|
|
"-DCOPY_DEST=$<TARGET_FILE_DIR:${TARGET_NAME}>/${dest}"
|
|
-P "${COPY_FILE_SCRIPT}"
|
|
)
|
|
endforeach()
|
|
|
|
add_custom_target(AssetFileCopy_${TARGET_NAME} ALL
|
|
${copy_commands}
|
|
COMMENT "Copying assets (files) for ${TARGET_NAME}..."
|
|
VERBATIM
|
|
)
|
|
|
|
add_dependencies(${TARGET_NAME} AssetFileCopy_${TARGET_NAME})
|
|
set_property(TARGET AssetFileCopy_${TARGET_NAME} PROPERTY FOLDER "Build")
|
|
endfunction()
|