Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 121 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ sysinfo = { version = "=0.34.2", features = [ "serde" ] }
thiserror = { version = "2" }
whoami = { version = "=1.6.0" }
opener = { version = "=0.8.2" }
shadow-rs = { version = "1.4.0", default-features = false }

# macro
paste = { version = "1" }
Expand Down
17 changes: 0 additions & 17 deletions apps/oneclient/desktop/build.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
use std::process::Command;
use std::time::{SystemTime, UNIX_EPOCH};

fn main() {
let output = Command::new("git")
.args(&["rev-parse", "HEAD"])
.output()
.unwrap();
let git_hash = String::from_utf8(output.stdout).unwrap();
println!("cargo:rustc-env=GIT_HASH={}", git_hash);

let start = SystemTime::now();
let timestamp = start
.duration_since(UNIX_EPOCH)
.expect("Time went backwards")
.as_secs();
println!("cargo:rustc-env=BUILD_TIMESTAMP={}", timestamp);

tauri_build::build();
}
9 changes: 8 additions & 1 deletion apps/oneclient/desktop/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
"fs:allow-data-read-recursive",
"fs:allow-data-write-recursive",

"os:default"
"os:allow-arch",
"os:deny-exe-extension",
"os:allow-family",
"os:deny-hostname",
"os:allow-locale",
"os:allow-os-type",
"os:allow-platform",
"os:allow-version"
]
}
2 changes: 1 addition & 1 deletion apps/oneclient/desktop/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// === API ===
pub const CURSEFORGE_API_KEY: &'static str =
"$2a$10$6utA1UNSmFPrE/Lh7b7ndeeGmiOkjKNY8kpFB0fsmE/d42ZAfFgCe";
pub const DISCORD_CLIENT_ID: &'static str = "1274084193193955408";
pub const DISCORD_CLIENT_ID: &'static str = "1426999264633946334";

// === Meta ===
// Cannot contain trailing slash
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/desktop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async fn initialize_core() -> LauncherResult<()> {
launcher_name: "OneClient".to_string(),
launcher_version: env!("CARGO_PKG_VERSION").to_string(),
launcher_website: "https://polyfrost.org/".to_string(),
discord_client_id: None, //Some(constants::DISCORD_CLIENT_ID.to_string()), // disabled for now
discord_client_id: Some(constants::DISCORD_CLIENT_ID.to_string()),
fetch_attempts: 3,
logger_filter: Some(format!(
"{}={level},onelauncher_core={level}",
Expand Down
31 changes: 17 additions & 14 deletions apps/oneclient/frontend/src/bindings.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,22 +301,10 @@ export type VersionType =
*/
"old_beta"

const ARGS_MAP = { 'debug':'{"getFamily":[],"getPlatform":[],"getCommitHash":[],"getArch":[],"openDevTools":[],"getVersion":[],"isInDev":[],"getType":[],"getLocale":[],"getBuildTimestamp":[]}', 'oneclient':'{"getVersions":[],"getClustersGroupedByMajor":[],"getBundlesFor":["cluster_id"]}', 'core':'{"getPackageBody":["provider","body"],"createSettingsProfile":["name"],"getProfileOrDefault":["name"],"setDefaultUser":["uuid"],"getUsersFromAuthor":["provider","author"],"removeCluster":["id"],"writeSettings":["setting"],"getUser":["uuid"],"readSettings":[],"uploadSkinBytes":["access_token","skin_data","image_format","skin_variant"],"updateClusterProfile":["name","profile"],"convertUsernameUUID":["username_uuid"],"open":["input"],"getRunningProcesses":[],"installModpack":["modpack","cluster_id"],"searchPackages":["provider","query"],"changeSkin":["access_token","skin_url","skin_variant"],"launchCluster":["id","uuid"],"changeCape":["access_token","cape_uuid"],"getGlobalProfile":[],"getClusters":[],"getWorlds":["id"],"getMultiplePackages":["provider","slugs"],"removeUser":["uuid"],"removeCape":["access_token"],"getUsers":[],"getPackage":["provider","slug"],"downloadExternalPackage":["package","cluster_id","force","skip_compatibility"],"getRunningProcessesByClusterId":["cluster_id"],"fetchMinecraftProfile":["uuid"],"getClusterById":["id"],"getGameVersions":[],"getDefaultUser":["fallback"],"getLogs":["id"],"getLogByName":["id","name"],"downloadPackage":["provider","package_id","version_id","cluster_id","skip_compatibility"],"getLoadersForVersion":["mc_version"],"getPackageVersions":["provider","slug","mc_version","loader","offset","limit"],"fetchLoggedInProfile":["access_token"],"openMsaLogin":[],"getScreenshots":["id"],"isClusterRunning":["cluster_id"],"killProcess":["pid"],"createCluster":["options"],"updateClusterById":["id","request"]}', 'events':'{"process":["event"],"message":["event"],"ingress":["event"]}', 'folders':'{"openCluster":["folder_name"],"fromCluster":["folder_name"]}' }
const ARGS_MAP = { 'debug':'{"getType":[],"getGitCommitHash":[],"getBuildTimestamp":[],"getPlatform":[],"getOsVersion":[],"getArch":[],"getPackageVersion":[],"openDevTools":[],"getFamily":[],"isInDev":[],"getLocale":[]}', 'oneclient':'{"getClustersGroupedByMajor":[],"getVersions":[],"getBundlesFor":["cluster_id"]}', 'events':'{"message":["event"],"process":["event"],"ingress":["event"]}', 'core':'{"getScreenshots":["id"],"getPackageBody":["provider","body"],"convertUsernameUUID":["username_uuid"],"writeSettings":["setting"],"createCluster":["options"],"createSettingsProfile":["name"],"getMultiplePackages":["provider","slugs"],"updateClusterProfile":["name","profile"],"downloadExternalPackage":["package","cluster_id","force","skip_compatibility"],"openMsaLogin":[],"getClusters":[],"installModpack":["modpack","cluster_id"],"fetchMinecraftProfile":["uuid"],"killProcess":["pid"],"getUsers":[],"searchPackages":["provider","query"],"readSettings":[],"getLoadersForVersion":["mc_version"],"getRunningProcessesByClusterId":["cluster_id"],"getProfileOrDefault":["name"],"uploadSkinBytes":["access_token","skin_data","image_format","skin_variant"],"getUser":["uuid"],"getRunningProcesses":[],"fetchLoggedInProfile":["access_token"],"getLogs":["id"],"isClusterRunning":["cluster_id"],"getWorlds":["id"],"removeCape":["access_token"],"updateClusterById":["id","request"],"getGameVersions":[],"launchCluster":["id","uuid"],"removeCluster":["id"],"getPackageVersions":["provider","slug","mc_version","loader","offset","limit"],"getLinkedPackages":["cluster_id"],"getClusterById":["id"],"downloadPackage":["provider","package_id","version_id","cluster_id","skip_compatibility"],"removeUser":["uuid"],"changeSkin":["access_token","skin_url","skin_variant"],"getUsersFromAuthor":["provider","author"],"getGlobalProfile":[],"changeCape":["access_token","cape_uuid"],"getLogByName":["id","name"],"getDefaultUser":["fallback"],"setDiscordRPCMessage":["message"],"getPackage":["provider","slug"],"open":["input"],"setDefaultUser":["uuid"]}', 'folders':'{"openCluster":["folder_name"],"fromCluster":["folder_name"]}' }
export type Router = { 'events': { ingress: (event: IngressPayload) => Promise<void>,
message: (event: MessagePayload) => Promise<void>,
process: (event: ProcessPayload) => Promise<void> },
'folders': { fromCluster: (folderName: string) => Promise<string>,
openCluster: (folderName: string) => Promise<null> },
'debug': { openDevTools: () => Promise<void>,
isInDev: () => Promise<boolean>,
getPlatform: () => Promise<string>,
getArch: () => Promise<string>,
getFamily: () => Promise<string>,
getLocale: () => Promise<string | null>,
getType: () => Promise<string>,
getVersion: () => Promise<string>,
getCommitHash: () => Promise<string>,
getBuildTimestamp: () => Promise<string> },
'oneclient': { getClustersGroupedByMajor: () => Promise<Partial<{ [key in number]: ClusterModel[] }>>,
getBundlesFor: (clusterId: number) => Promise<ModpackArchive[]>,
getVersions: () => Promise<OnlineClusterManifest> },
Expand Down Expand Up @@ -356,6 +344,7 @@ getPackageVersions: (provider: Provider, slug: string, mcVersion: string | null,
downloadPackage: (provider: Provider, packageId: string, versionId: string, clusterId: number, skipCompatibility: boolean | null) => Promise<PackageModel>,
downloadExternalPackage: (package: ExternalPackage, clusterId: number, force: boolean | null, skipCompatibility: boolean | null) => Promise<PackageModel | null>,
getUsersFromAuthor: (provider: Provider, author: PackageAuthor) => Promise<ManagedUser[]>,
getLinkedPackages: (clusterId: number) => Promise<PackageModel[]>,
installModpack: (modpack: ModpackArchive, clusterId: number) => Promise<null>,
fetchMinecraftProfile: (uuid: string) => Promise<MojangPlayerProfile>,
fetchLoggedInProfile: (accessToken: string) => Promise<MojangFullPlayerProfile>,
Expand All @@ -364,7 +353,21 @@ changeSkin: (accessToken: string, skinUrl: string, skinVariant: SkinVariant) =>
changeCape: (accessToken: string, capeUuid: string) => Promise<MojangFullPlayerProfile>,
removeCape: (accessToken: string) => Promise<MojangFullPlayerProfile>,
convertUsernameUUID: (usernameUuid: string) => Promise<MowojangProfile>,
open: (input: string) => Promise<null> } };
setDiscordRPCMessage: (message: string) => Promise<null>,
open: (input: string) => Promise<null> },
'debug': { openDevTools: () => Promise<void>,
isInDev: () => Promise<boolean>,
getArch: () => Promise<string>,
getFamily: () => Promise<string>,
getLocale: () => Promise<string | null>,
getType: () => Promise<string>,
getPlatform: () => Promise<string>,
getOsVersion: () => Promise<string>,
getGitCommitHash: () => Promise<string>,
getBuildTimestamp: () => Promise<string>,
getPackageVersion: () => Promise<string> },
'folders': { fromCluster: (folderName: string) => Promise<string>,
openCluster: (folderName: string) => Promise<null> } };


export type { InferCommandOutput }
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/frontend/src/components/Bundle/Bundle.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ClusterModel, ModpackFile } from '@/bindings.gen';
import { ModCard, useModCardContext } from '@/components';
import { useSettings } from '@/hooks/useSettings';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
import { twMerge } from 'tailwind-merge';
import { ModCard, useModCardContext } from '.';

interface BundleProps {
files: Array<ModpackFile>;
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/frontend/src/components/Bundle/ModCard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ClusterModel, ModpackFile, ModpackFileKind } from '@/bindings.gen';
import MissingLogo from '@/assets/misc/missingLogo.svg';
import { DownloadModButton, ModTag } from '@/components';
import { useSettings } from '@/hooks/useSettings';
import { bindings } from '@/main';
import { createContext, useContext, useEffect, useState } from 'react';
import { twMerge } from 'tailwind-merge';
import { DownloadModButton, ModTag } from '.';

export interface ModInfo {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/frontend/src/components/Bundle/ModList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ClusterModel, ModpackArchive } from '@/bindings.gen';
import { Bundle, useModCardContext } from '@/components';
import { useSettings } from '@/hooks/useSettings';
import { Button, Tab, TabContent, TabList, TabPanel, Tabs } from '@onelauncher/common/components';
import { Bundle, useModCardContext } from '.';

function getBundleName(name: string): string {
return (name.match(/\[(.*?)\]/)?.[1]) ?? 'Loading...';
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/frontend/src/components/Bundle/ModTag.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClusterModel } from '@/bindings.gen';
import type { ModInfo } from '.';
import type { ModInfo } from '@/components';
import { useSettings } from '@/hooks/useSettings';
import { Link } from '@tanstack/react-router';
import { twMerge } from 'tailwind-merge';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import type { MinecraftCredentials } from '@/bindings.gen';
import { Overlay, RemoveAccountModal } from '@/components';
import { Button } from '@onelauncher/common/components';
import { Trash01Icon } from '@untitled-theme/icons-react';
import { DialogTrigger } from 'react-aria-components';
import { Overlay, RemoveAccountModal } from './overlay';

export function DeleteAccountButton({ profile, onPress }: { profile: MinecraftCredentials; onPress: () => void }) {
return (
<DialogTrigger>
<Overlay.Trigger>
<Button className="group w-8 h-8" color="ghost" size="icon">
<Trash01Icon className="group-hover:stroke-danger" />
</Button>

<Overlay>
<RemoveAccountModal onPress={onPress} profile={profile} />
</Overlay>
</DialogTrigger>
</Overlay.Trigger>
);
}
3 changes: 1 addition & 2 deletions apps/oneclient/frontend/src/components/DownloadMods.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import type { ExternalPackage, ManagedVersionDependency, ModpackFile, Provider } from '@/bindings.gen';
import { getModMetaDataName, Overlay } from '@/components';
import { useSettings } from '@/hooks/useSettings';
import { bindings } from '@/main';
import { useCommandMut } from '@onelauncher/common';
import { Button } from '@onelauncher/common/components';
import { useNavigate } from '@tanstack/react-router';
import { useEffect, useImperativeHandle, useState } from 'react';
import { DialogTrigger } from 'react-aria-components';
import { getModMetaDataName } from './Bundle';
import { Overlay } from './overlay';

export interface DownloadModsRef {
openDownloadDialog: (nextPath?: string) => void;
Expand Down Expand Up @@ -155,7 +154,7 @@
};

downloadAll();
}, [mods]);

Check warning on line 157 in apps/oneclient/frontend/src/components/DownloadMods.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

React Hook useEffect has missing dependencies: 'download' and 'useParallelModDownloading'. Either include them or remove the dependency array

useEffect(() => {
if (downloadedMods >= mods.length) {
Expand Down
Loading
Loading