You've already forked AstralRinth
forked from xxxOFFxxx/AstralRinth
refactor: update comments to reflect modifications by AstralRinth
This commit is contained in:
@@ -95,7 +95,7 @@ import { generateSkinPreviews } from './helpers/rendering/batch-skin-renderer'
|
||||
import { get_available_capes, get_available_skins } from './helpers/skins'
|
||||
import { AppNotificationManager } from './providers/app-notifications'
|
||||
|
||||
// [AR] Imports
|
||||
// This code is modified by AstralRinth
|
||||
import { get, set } from '@/helpers/settings.ts'
|
||||
import { getRemote, updateState } from '@/helpers/update.js'
|
||||
|
||||
@@ -164,9 +164,10 @@ const authUnreachable = computed(() => {
|
||||
return false
|
||||
})
|
||||
|
||||
// This code is modified by AstralRinth
|
||||
onMounted(async () => {
|
||||
await useCheckDisableMouseover()
|
||||
await getRemote(false) // [AR] Check for updates
|
||||
await getRemote(false)
|
||||
|
||||
document.querySelector('body').addEventListener('click', handleClick)
|
||||
document.querySelector('body').addEventListener('auxclick', handleAuxClick)
|
||||
@@ -210,8 +211,8 @@ const messages = defineMessages({
|
||||
},
|
||||
})
|
||||
|
||||
// This code is modified by AstralRinth
|
||||
async function setupApp() {
|
||||
// [AR] Patched
|
||||
const settings = await get()
|
||||
settings.personalized_ads = false
|
||||
settings.telemetry = false
|
||||
@@ -258,7 +259,7 @@ async function setupApp() {
|
||||
isMaximized.value = await getCurrentWindow().isMaximized()
|
||||
})
|
||||
|
||||
// [AR] Patched
|
||||
// This code is modified by AstralRinth
|
||||
if (!telemetry) {
|
||||
console.info("[AR] • Telemetry disabled by default (Hard patched).")
|
||||
optOutAnalytics()
|
||||
@@ -286,7 +287,7 @@ async function setupApp() {
|
||||
}),
|
||||
)
|
||||
|
||||
// [AR] Info listener
|
||||
// This code is modified by AstralRinth
|
||||
await info_listener((e) =>
|
||||
addNotification({
|
||||
title: 'Info',
|
||||
|
||||
@@ -286,7 +286,7 @@ const microsoftLoginDisabled = ref(false)
|
||||
const elyByLoginDisabled = ref(false)
|
||||
const defaultUser = ref()
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
const clientToken = 'astralrinth'
|
||||
const addOfflineModal = ref(null)
|
||||
const addElyByModal = ref(null)
|
||||
@@ -304,7 +304,7 @@ const maxOfflinePlayerNameLength = 20
|
||||
const nameExp = 'a-zA-Z0-9_'
|
||||
const nameRegex = new RegExp(`^[${nameExp}]+$`)
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function getAccountType(account) {
|
||||
switch (account.account_type) {
|
||||
case 'microsoft':
|
||||
@@ -316,24 +316,24 @@ function getAccountType(account) {
|
||||
}
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function showOfflineLoginModal() {
|
||||
addOfflineModal.value?.show()
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function showElyByLoginModal() {
|
||||
addElyByModal.value?.show()
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function retryAddOfflineProfile() {
|
||||
inputOfflineErrorModal.value?.hide()
|
||||
clearOfflineFields()
|
||||
showOfflineLoginModal()
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function retryAddElyByProfile() {
|
||||
authenticationElyByErrorModal.value?.hide()
|
||||
inputElyByErrorModal.value?.hide()
|
||||
@@ -342,19 +342,19 @@ function retryAddElyByProfile() {
|
||||
showElyByLoginModal()
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function clearElyByFields() {
|
||||
elyByLogin.value = ''
|
||||
elyByPassword.value = ''
|
||||
elyByTwoFactorCode.value = ''
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function clearOfflineFields() {
|
||||
offlinePlayerName.value = ''
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
async function addOfflineProfile() {
|
||||
const name = offlinePlayerName.value.trim()
|
||||
const isValidName =
|
||||
@@ -388,7 +388,7 @@ async function addOfflineProfile() {
|
||||
}
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
async function addElyByProfile() {
|
||||
elyByLoginDisabled.value = true
|
||||
if (!elyByLogin.value || !elyByPassword.value) {
|
||||
@@ -450,7 +450,7 @@ async function addElyByProfile() {
|
||||
}
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
function convertRawStringToUUIDv4(rawId) {
|
||||
if (rawId.length !== 32) {
|
||||
console.warn('Invalid UUID string:', rawId)
|
||||
|
||||
@@ -19,7 +19,7 @@ import { install } from '@/helpers/profile.js'
|
||||
import { cancel_directory_change } from '@/helpers/settings.ts'
|
||||
import { handleSevereError } from '@/store/error.js'
|
||||
|
||||
// [AR] Imports
|
||||
// This code is modified by AstralRinth
|
||||
import { applyMigrationFix } from '@/helpers/utils.js'
|
||||
import { restartApp } from '@/helpers/utils.js'
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import PrivacySettings from '@/components/ui/settings/PrivacySettings.vue'
|
||||
import ResourceManagementSettings from '@/components/ui/settings/ResourceManagementSettings.vue'
|
||||
import { get, set } from '@/helpers/settings.ts'
|
||||
|
||||
// [AR] Imports
|
||||
// This code is modified by AstralRinth
|
||||
import { installState, getRemote, updateState } from '@/helpers/update.js'
|
||||
|
||||
const updateModalView = ref(null)
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function offline_login(name) {
|
||||
return await invoke('plugin:auth|offline_login', { name: name })
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
export async function elyby_login(uuid, login, accessToken) {
|
||||
return await invoke('plugin:auth|elyby_login', {
|
||||
uuid,
|
||||
@@ -26,7 +26,7 @@ export async function elyby_login(uuid, login, accessToken) {
|
||||
})
|
||||
}
|
||||
|
||||
// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
export async function elyby_auth_authenticate(login, password, clientToken) {
|
||||
return await invoke('plugin:auth|elyby_auth_authenticate', {
|
||||
login,
|
||||
|
||||
@@ -98,7 +98,7 @@ export async function friend_listener(callback) {
|
||||
return await listen('friend', (event) => callback(event.payload))
|
||||
}
|
||||
|
||||
// [AR] Payload for the 'info' event
|
||||
// This code is modified by AstralRinth
|
||||
export async function info_listener(callback) {
|
||||
return await listen('info', (event) => callback(event.payload))
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ export async function getOS() {
|
||||
return await invoke('plugin:utils|get_os')
|
||||
}
|
||||
|
||||
// [AR] Feature. Updater
|
||||
// This code is modified by AstralRinth
|
||||
export async function initUpdateLauncher(downloadUrl, filename, osType, autoUpdateSupported) {
|
||||
console.log('Downloading build', downloadUrl, filename, osType, autoUpdateSupported)
|
||||
return await invoke('plugin:utils|init_update_launcher', { downloadUrl, filename, osType, autoUpdateSupported })
|
||||
}
|
||||
|
||||
// [AR] Migration. Patch
|
||||
// This code is modified by AstralRinth
|
||||
export async function applyMigrationFix(eol) {
|
||||
return await invoke('plugin:utils|apply_migration_fix', { eol })
|
||||
}
|
||||
|
||||
// [AR] Feature. Ely.by
|
||||
// This code is modified by AstralRinth
|
||||
export async function initAuthlibPatching(minecraftVersion, isMojang) {
|
||||
return await invoke('plugin:utils|init_authlib_patching', { minecraftVersion, isMojang })
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ pub fn init<R: Runtime>() -> tauri::plugin::TauriPlugin<R> {
|
||||
.build()
|
||||
}
|
||||
|
||||
/// [AR] Feature. Ely.by
|
||||
// This code is modified by AstralRinth
|
||||
#[tauri::command]
|
||||
pub async fn init_authlib_patching(
|
||||
minecraft_version: &str,
|
||||
@@ -42,14 +42,14 @@ pub async fn init_authlib_patching(
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// [AR] Migration. Patch
|
||||
// This code is modified by AstralRinth
|
||||
#[tauri::command]
|
||||
pub async fn apply_migration_fix(eol: &str) -> Result<bool> {
|
||||
let result = utils::apply_migration_fix(eol).await?;
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// [AR] Feature. Updater
|
||||
// This code is modified by AstralRinth
|
||||
#[tauri::command]
|
||||
pub async fn init_update_launcher(
|
||||
download_url: &str,
|
||||
|
||||
@@ -13,7 +13,7 @@ pub mod process;
|
||||
pub mod profile;
|
||||
pub mod server_address;
|
||||
pub mod settings;
|
||||
pub mod update; // [AR] Feature
|
||||
pub mod update; // This code is modified by AstralRinth
|
||||
pub mod tags;
|
||||
pub mod worlds;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use chrono::Utc;
|
||||
use daedalus as d;
|
||||
use daedalus::minecraft::{LoggingSide, RuleAction, VersionInfo};
|
||||
use daedalus::modded::LoaderVersion;
|
||||
use rand::seq::SliceRandom; // [AR] Feature
|
||||
use rand::seq::SliceRandom; // This code is modified by AstralRinth
|
||||
use regex::Regex;
|
||||
use serde::Deserialize;
|
||||
use st::Profile;
|
||||
@@ -796,7 +796,7 @@ pub async fn launch_minecraft(
|
||||
}
|
||||
}
|
||||
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
let selected_phrase = ACTIVE_STATE.choose(&mut rand::thread_rng()).unwrap();
|
||||
let _ = state
|
||||
.discord_rpc
|
||||
|
||||
@@ -8,7 +8,7 @@ and launching Modrinth mod packs
|
||||
#![deny(unused_must_use)]
|
||||
|
||||
#[macro_use]
|
||||
pub mod util; // [AR] Refactor
|
||||
pub mod util; // This code is modified by AstralRinth
|
||||
|
||||
mod api;
|
||||
mod error;
|
||||
|
||||
@@ -23,7 +23,8 @@ pub(crate) async fn connect() -> crate::Result<Pool<Sqlite>> {
|
||||
Ok(pool)
|
||||
}
|
||||
|
||||
// [AR] Feature. Implement SQLite3 connection without SQLx migrations.
|
||||
// This code is modified by AstralRinth
|
||||
// Implement SQLite3 connection without SQLx migrations.
|
||||
async fn connect_without_migrate() -> crate::Result<Pool<Sqlite>> {
|
||||
let settings_dir = DirectoryInfo::get_initial_settings_dir().ok_or(
|
||||
ErrorKind::FSError("Could not find valid config dir".to_string()),
|
||||
@@ -72,7 +73,7 @@ async fn stale_data_cleanup(pool: &Pool<Sqlite>) -> crate::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
/*
|
||||
// [AR] Patch fix
|
||||
// This code is modified by AstralRinth
|
||||
Problem files, view detailed information in .gitattributes:
|
||||
/packages/app-lib/migrations/20240711194701_init.sql !eol
|
||||
CRLF -> 4c47e326f16f2b1efca548076ce638d4c90dd610172fe48c47d6de9bc46ef1c5abeadfdea05041ddd72c3819fa10c040
|
||||
|
||||
@@ -22,7 +22,7 @@ pub struct DirectoryInfo {
|
||||
impl DirectoryInfo {
|
||||
// Get the settings directory
|
||||
// init() is not needed for this function
|
||||
// [AR] Patch fix. From PR.
|
||||
// This code is modified by AstralRinth
|
||||
pub fn get_initial_settings_dir() -> Option<PathBuf> {
|
||||
Self::env_path("THESEUS_CONFIG_DIR").or_else(|| {
|
||||
if std::env::current_dir().ok()?.join("portable.txt").exists() {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
use std::{
|
||||
sync::{atomic::AtomicBool, Arc},
|
||||
time::{SystemTime, UNIX_EPOCH},
|
||||
};
|
||||
|
||||
use discord_rich_presence::{
|
||||
activity::{Activity, Assets, Timestamps}, // [AR] Feature
|
||||
activity::{Activity, Assets, Timestamps}, // This code is modified by AstralRinth
|
||||
DiscordIpc, DiscordIpcClient,
|
||||
};
|
||||
use rand::seq::SliceRandom; // [AR] Feature
|
||||
use rand::seq::SliceRandom; // This code is modified by AstralRinth
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use crate::util::utils; // [AR] Feature
|
||||
use crate::util::utils; // This code is modified by AstralRinth
|
||||
use crate::State;
|
||||
|
||||
pub struct DiscordGuard {
|
||||
|
||||
@@ -179,7 +179,7 @@ pub async fn login_finish(
|
||||
Ok(credentials)
|
||||
}
|
||||
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
#[tracing::instrument]
|
||||
pub async fn offline_auth(
|
||||
name: &str,
|
||||
@@ -209,7 +209,7 @@ pub async fn offline_auth(
|
||||
Ok(credentials)
|
||||
}
|
||||
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
#[tracing::instrument]
|
||||
pub async fn elyby_auth(
|
||||
uuid: Uuid,
|
||||
@@ -237,7 +237,7 @@ pub async fn elyby_auth(
|
||||
Ok(credentials)
|
||||
}
|
||||
|
||||
/// [AR] • Feature
|
||||
// This code is modified by AstralRinth
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub enum AccountType {
|
||||
Unknown,
|
||||
|
||||
@@ -4,7 +4,7 @@ pub mod io;
|
||||
pub mod jre;
|
||||
pub mod network;
|
||||
pub mod platform;
|
||||
pub mod utils; // [AR] Feature
|
||||
pub mod utils; // This code is modified by AstralRinth
|
||||
pub mod protocol_version;
|
||||
pub mod rpc;
|
||||
pub mod server_ping;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::api::update;
|
||||
use crate::state::db;
|
||||
///
|
||||
/// [AR] Feature Utils
|
||||
///
|
||||
/// This code is modified by AstralRinth
|
||||
///
|
||||
/// Version: 0.1.1
|
||||
///
|
||||
use crate::{Result, State};
|
||||
@@ -84,7 +84,7 @@ pub async fn get_or_download_elyby_injector() -> Result<PathBuf> {
|
||||
Err(err) => {
|
||||
if let Some((local_path, _)) = local_authlib_injectors
|
||||
.iter()
|
||||
.max_by(|a, b| a.1.cmp(&b.1))
|
||||
.max_by(|a, b| a.1.cmp(&b.1))
|
||||
{
|
||||
tracing::info!("[AR] • Found local AuthLib Injector(s):");
|
||||
for (path, time) in &local_authlib_injectors {
|
||||
|
||||
@@ -117,7 +117,7 @@ export const USDCColorIcon = _USDCColorIcon
|
||||
export const VisaIcon = _VisaIcon
|
||||
export const MinecraftServerIcon = _MinecraftServerIcon
|
||||
|
||||
// [AR] Styles
|
||||
// This code is modified by AstralRinth
|
||||
import _AstralRinthLogo from './icons/astralrinth-logo.svg?component'
|
||||
import _ElyByIcon from './icons/elyby-icon.svg?component'
|
||||
import _MicrosoftIcon from './icons/microsoft.svg?component'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
.neon-button.neon :deep(:is(button, a, .button-like)),
|
||||
.neon-button.neon :slotted(:is(button, a, .button-like)),
|
||||
.neon-button.neon :slotted(*) :is(button, a, .button-like) {
|
||||
@@ -36,4 +36,4 @@
|
||||
text-shadow:
|
||||
0 0 2px rgba(16, 250, 229, 0.4),
|
||||
0 0 4px rgba(16, 250, 229, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
.neon-icon {
|
||||
background-color: transparent;
|
||||
color: #3e8cde;
|
||||
@@ -34,4 +34,4 @@
|
||||
50% {
|
||||
filter: drop-shadow(0 0 12px #10fae5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// [AR] Feature
|
||||
// This code is modified by AstralRinth
|
||||
.neon-text {
|
||||
background-color: transparent;
|
||||
color: #3e8cde;
|
||||
|
||||
Reference in New Issue
Block a user