Skip to content

Commit

Permalink
fixed uuid on cracked not being set correctly
Browse files Browse the repository at this point in the history
also generate random uuid instead of dash if username does not exist
  • Loading branch information
1zun4 committed Dec 11, 2023
1 parent 28c2bee commit ff7686f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/app/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async fn run_client(build_id: u32, account_data: MinecraftAccount, options: Laun

let (account_name, uuid, token, user_type) = match account_data {
MinecraftAccount::MsaAccount { name, uuid, token, .. } => (name, uuid, token, "msa".to_string()),
MinecraftAccount::OfflineAccount { name, uuid } => (name, "-".to_string(), uuid, "legacy".to_string())
MinecraftAccount::OfflineAccount { name, uuid } => (name, uuid, "-".to_string(), "legacy".to_string())
};

let parameters = LaunchingParameter {
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/minecraft/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use tracing::debug;

use base64::{read::DecoderReader};
use byteorder::{ReadBytesExt, LE};
use uuid::Uuid;
use std::{fs, io::Read, string::String};

use crate::{LAUNCHER_DIRECTORY, HTTP_CLIENT};
Expand Down Expand Up @@ -69,7 +70,7 @@ impl MinecraftAccount {
pub async fn auth_offline(username: String) -> Self {
// Request UUID from Mojang's API
let uuid = uuid_of_username(&username).await
.unwrap_or_else(|_| "-".to_string());
.unwrap_or_else(|_| Uuid::new_v4().to_string());

// Return offline account
MinecraftAccount::OfflineAccount {
Expand Down

0 comments on commit ff7686f

Please sign in to comment.