Compare commits
318 Commits
7e524debb9
...
3.2.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 21710d0e02 | |||
| b478e7ba95 | |||
| bd368adfe5 | |||
| 85ea4167ab | |||
| adf7e487b9 | |||
|
22d97a0068
|
|||
| 992127ecb6 | |||
| 0f53057897 | |||
| 03b326e142 | |||
| 2ec8b08983 | |||
| 344f15b8da | |||
| 554f07412b | |||
| f8f53c4236 | |||
| 64f76d95a6 | |||
| 02fecd237c | |||
| eaffc35288 | |||
| 78c7fdb756 | |||
| ec7ce53016 | |||
| 0610d4beef | |||
|
416067f2ea
|
|||
|
e58be09bdb
|
|||
| ccb0c467f2 | |||
|
67bc968497
|
|||
|
dc06b53089
|
|||
|
d5e5fd4c43
|
|||
|
29359c9242
|
|||
|
71bd64a2cf
|
|||
|
7fa83d6d0a
|
|||
|
f2e795e2c9
|
|||
|
cece28dd46
|
|||
| 474f1f0c33 | |||
| 871c40922e | |||
| 20e8389409 | |||
|
051a86943e
|
|||
|
7d0147edb9
|
|||
|
7e2404753b
|
|||
|
9952e164c5
|
|||
|
df8ee34e73
|
|||
|
3a27646da8
|
|||
|
ace3320632
|
|||
| 2ba094f07e | |||
| fcf9e46a8f | |||
| 3768ab1064 | |||
| e5e09505a0 | |||
| 94f78f281d | |||
| d2ecc5210f | |||
| 6f8036e9d4 | |||
| 73256f32c4 | |||
| cfb4c8a611 | |||
| f2d8056cfd | |||
| 2eb95cd802 | |||
| a28d56e283 | |||
| f88a33c2aa | |||
| 8a964d0a6a | |||
| cc4697efbc | |||
|
5b1e32d4eb
|
|||
|
d0b0011910
|
|||
|
1467d3e296
|
|||
|
2ded0d4b94
|
|||
|
9d80811e83
|
|||
| 730a27b397 | |||
| e84feb292b | |||
| 485cb3acf7 | |||
|
44ad025d3d
|
|||
|
ec80b13de3
|
|||
|
6a279de728
|
|||
|
4e33ec3451
|
|||
|
6fdb2376a1
|
|||
|
afdd74175a
|
|||
|
6f8043d2d0
|
|||
| f7fff7748a | |||
| d5286263b9 | |||
| 1cc1a4a0c3 | |||
| d2ae9e939f | |||
| bde922ab9f | |||
| a1f96a7de3 | |||
| 3b2c902264 | |||
| 40a32d7a60 | |||
| 52c60acf37 | |||
| 2788cd6e8b | |||
| 2d1941db33 | |||
| 00958d5238 | |||
| b8a0b448c7 | |||
| 09487e945e | |||
| 2532ab0059 | |||
| 16fe91b3a5 | |||
| eca08f16c5 | |||
| e76d67f3a8 | |||
| 9811b36e58 | |||
|
0f10beb3b4
|
|||
|
4326199a56
|
|||
|
7f65384b1c
|
|||
|
aacd0d1d91
|
|||
|
079a076f99
|
|||
| 6d88c39ce2 | |||
| 56608a64fc | |||
| eaf6f5976d | |||
| 93f1f380ec | |||
| c47ea1f976 | |||
| 09af78f1aa | |||
| 3900b5c6cf | |||
| adf607e24c | |||
| 1128b51778 | |||
| d435f0c09a | |||
| b188e2dee8 | |||
| 8fd56ae749 | |||
| b2e7d22d28 | |||
| d871e06172 | |||
| 6a1c5441c3 | |||
| ef36f49a6f | |||
| 7e40536ec8 | |||
| 694d403aeb | |||
| 9515892b2f | |||
| 0a58f0f63b | |||
| 60e3ef4131 | |||
| 7375cccc05 | |||
| 251bf8177c | |||
| bf4ce18671 | |||
| 4dc83c882d | |||
| e20f11be64 | |||
| 407996269e | |||
| 95c6db6a1d | |||
| a87a4bcc54 | |||
| 97f072f4ce | |||
| 1aa3070ea1 | |||
| d3c3e4e771 | |||
| 921dbd716c | |||
| 34e82f89e8 | |||
| 901fbefd1b | |||
| a795978827 | |||
| a9152cc376 | |||
| 8d790c7da3 | |||
| f5a2c4365b | |||
| a925548ae9 | |||
| a6495ea353 | |||
| 24802b5132 | |||
| f09405ed58 | |||
| eeda85f48f | |||
| 9770e81d6f | |||
| 31b7d17b09 | |||
| 1fc0391113 | |||
| 62f03cf7c0 | |||
| 94f6e850cf | |||
| d6fdb2a152 | |||
| 9cd990cf96 | |||
| 2e0ef81bcb | |||
| 96680ff8b5 | |||
| 0b9d6373bf | |||
| 295c1424c9 | |||
| 0e12a801d2 | |||
| cf86dba5c4 | |||
| 540c653399 | |||
| c9b8d9f599 | |||
| 49665d94bc | |||
| 1a19c19399 | |||
| cbfe5ec868 | |||
| c5b18dacbb | |||
| ef01984875 | |||
| 46ee36ce81 | |||
| c4658ae4cc | |||
| ca15ff566f | |||
| a6fdda4487 | |||
| a30946eb60 | |||
| 9106ad89b3 | |||
| 194709df0c | |||
| 20f625be60 | |||
| 66a5fd84ae | |||
| 44d7401947 | |||
| f973e48561 | |||
| de186b7ff9 | |||
| 244d526933 | |||
| c7a990e3fe | |||
| ed1f741a9e | |||
| b6616a37f4 | |||
| 63433ac626 | |||
| 149b4715d7 | |||
| ae3443d0b9 | |||
| abc7b9d9d9 | |||
| d9dd21d3be | |||
| 0df31178f4 | |||
| 6825f9e99b | |||
| 08a8e34781 | |||
| 1aa973f6bb | |||
| 0999832985 | |||
| 11798318f4 | |||
| f1b909e248 | |||
| 1f845f1282 | |||
| f9b38ec9eb | |||
| 623559cf8e | |||
| 80bd096834 | |||
| e1c6e35f95 | |||
| 57158bab15 | |||
| 58837053c7 | |||
| 458a2cca36 | |||
| cb66df6082 | |||
| 1d1904e995 | |||
| c07e390b65 | |||
| bae0fad19b | |||
| 993eb167fc | |||
| ea2e348ccc | |||
| 2855880c18 | |||
| dcb57c5452 | |||
| c9def2c46b | |||
| b8ebcf5509 | |||
| a338df6a36 | |||
| d67d58824b | |||
| ad090ce38c | |||
| 3d57524a16 | |||
| d6bf3ccb3c | |||
| a548dc875e | |||
| 3029cc66fb | |||
| adf40b70cb | |||
| ff00b27330 | |||
| 95a5591c70 | |||
| cdc3c78ffe | |||
| 509aa36379 | |||
| 20e5961b7c | |||
| 9b816e1e5c | |||
| ada83b32dc | |||
| cbf85753a8 | |||
| eb1ef06c07 | |||
| a64655ec5d | |||
| 45b902cfb6 | |||
| f53aba9a7b | |||
| f7c2dc689a | |||
| b778a5a369 | |||
| 084e006f06 | |||
| 9b3cb0bd26 | |||
| c5649c3f8a | |||
| fac54f3e59 | |||
| b6f7f84955 | |||
| aa52ff3b8c | |||
| d72d2731d9 | |||
| f3ac7cc684 | |||
| b1b3de295c | |||
| e76affaea1 | |||
| 700274d7d8 | |||
| 53b6c2e174 | |||
| 93ecea9083 | |||
| 2549b18e8c | |||
| fd4d911075 | |||
| 5edd53eead | |||
| ea6db9afd1 | |||
| d56b375953 | |||
| ec25d5d2bb | |||
| 13b90092b7 | |||
| f214aa454e | |||
| 9d2599dd2f | |||
| eddaaaaa2f | |||
| a21abe86bb | |||
| d685114bd7 | |||
| 4e4998671a | |||
| 5cae8bc63a | |||
| 409c8b0b04 | |||
| c395662134 | |||
| 89d1bcbd86 | |||
| c3c13b0e07 | |||
| 4e1f76a713 | |||
| 4fb2ab7bed | |||
| bb90e28d92 | |||
| a554c53f89 | |||
| 307e0c9747 | |||
| 86033e2d6a | |||
| 1a563e64d5 | |||
| 5aec2d8245 | |||
| 87742b66b7 | |||
| df3bd69141 | |||
| 12feed96e9 | |||
| b530dbf72f | |||
| 174616f07b | |||
| d2a0e09e75 | |||
| a91fff1f59 | |||
| 376ee1e648 | |||
| d6623891bb | |||
| 9f62332334 | |||
| f051253abb | |||
| 57a95b4759 | |||
| f5831b377c | |||
| 33bd75eeee | |||
| 3b3447c42c | |||
| 2162ba15fe | |||
| 1ab19957ba | |||
| 2082beb387 | |||
| 4fbce4cd0a | |||
| 2ef108da2b | |||
| 7d32e663d0 | |||
| 4845eaeed2 | |||
| 3e63d7527e | |||
| 3dc62a060e | |||
| 6d2d5de6d2 | |||
| b376737dba | |||
| 88e5b1b47d | |||
| a18aed6642 | |||
| 4a41eba57e | |||
| 79795190f0 | |||
| 9f75a32502 | |||
| 047ef0b049 | |||
| 55555f2a03 | |||
| 15eb9424d4 | |||
| 43160800ce | |||
| 2d1b86b668 | |||
| 8f7269ba1b | |||
| 13b1d075f1 | |||
| 831056360a | |||
| ddf7232424 | |||
| 13c82d2316 | |||
| 5b600017d5 | |||
| b0d3651888 | |||
| 8dec4a9dce | |||
| 1d3448cbf5 | |||
| d058b24ba2 | |||
| fc20137d55 | |||
| 0debff62fe | |||
| 67352bfe37 | |||
| 4dd4aecdb1 | |||
| 66d0fd3dbc | |||
| 804378e404 | |||
| c63b42cae3 |
@@ -0,0 +1,12 @@
|
|||||||
|
# Package Managers
|
||||||
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
|
yarn.lock
|
||||||
|
bun.lock
|
||||||
|
bun.lockb
|
||||||
|
|
||||||
|
# Miscellaneous
|
||||||
|
/static/
|
||||||
|
|
||||||
|
# Tauri
|
||||||
|
/src-tauri/
|
||||||
@@ -9,8 +9,7 @@
|
|||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"useTabs": false,
|
"useTabs": false,
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"svelteBracketNewLine": true,
|
"plugins": ["prettier-plugin-svelte", "@trivago/prettier-plugin-sort-imports"],
|
||||||
"plugins": ["prettier-plugin-svelte"],
|
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "*.svelte",
|
"files": "*.svelte",
|
||||||
@@ -27,4 +26,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
"recommendations": [
|
"recommendations": [
|
||||||
"svelte.svelte-vscode",
|
"svelte.svelte-vscode",
|
||||||
"tauri-apps.tauri-vscode",
|
"tauri-apps.tauri-vscode",
|
||||||
"rust-lang.rust-analyzer"
|
"rust-lang.rust-analyzer",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"fill-labs.dependi",
|
||||||
|
"mylesmurphy.prettify-ts",
|
||||||
|
"edwinhuish.better-comments-next",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"bradlc.vscode-tailwindcss"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
{
|
{
|
||||||
"svelte.enable-ts-plugin": true
|
"svelte.enable-ts-plugin": true,
|
||||||
|
"git.enableCommitSigning": true,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnSaveMode": "file",
|
||||||
|
"[rust]": {
|
||||||
|
"editor.defaultFormatter": "rust-lang.rust-analyzer"
|
||||||
|
},
|
||||||
|
"json.schemaDownload.trustedDomains": {
|
||||||
|
"https://schemastore.azurewebsites.net/": true,
|
||||||
|
"https://raw.githubusercontent.com/": true,
|
||||||
|
"https://www.schemastore.org/": true,
|
||||||
|
"https://json.schemastore.org/": true,
|
||||||
|
"https://json-schema.org/": true,
|
||||||
|
"https://schema.tauri.app/": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,673 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
Copyright (C) 2025 HorizonCode
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
EZPPLauncher Copyright (C) 2025 HorizonCode
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
@@ -1,3 +1,83 @@
|
|||||||
# EZPPLauncher Tauri
|
# EZPPLauncher
|
||||||
|
|
||||||
Trying to recode this shit with tauri, kms
|
**EZPPLauncher** is a custom launcher for the private osu! server [EZPPFarm](https://ez-pp.farm), built with **Rust** and **Svelte** using the [Tauri](https://tauri.app) framework.
|
||||||
|
It enhances the osu! experience with quality-of-life features and integration specifically designed for the EZPPFarm community.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🖼️ Preview
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Features
|
||||||
|
|
||||||
|
- [x] Automatically updates osu! before launching
|
||||||
|
- [x] Automatically start/stop the OpenTabletDriver Daemon
|
||||||
|
- [x] Automatic ingame login
|
||||||
|
- [x] Patches the osu! client to show misses in Relax and Autopilot
|
||||||
|
- [x] Displays your EZPPFarm stats in the launcher
|
||||||
|
- [x] Shows the number of imported beatmapsets
|
||||||
|
- [x] Shows the number of imported skins
|
||||||
|
- [x] Displays ping to the EZPPFarm server
|
||||||
|
- [x] Discord Rich Presence
|
||||||
|
- [x] Performance Display Overlay (currently in experimental patcher release stream)
|
||||||
|
- [x] Launcher Theming
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💻 Supported Platforms
|
||||||
|
|
||||||
|
| Platform | Status |
|
||||||
|
| -------- | ---------------------------------------- |
|
||||||
|
| Windows | ✅ Supported |
|
||||||
|
| macOS | ❌ Not supported |
|
||||||
|
| Linux | 🕧 Partially supported (via osu-winello) |
|
||||||
|
|
||||||
|
> Currently, only **Windows** is fully supported. Support for other platforms may be considered in the future.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠 Build From Source
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
- **Rust** (installed via [rustup](https://rustup.rs/) – recommended for Windows)
|
||||||
|
- **Cargo** (comes with rustup)
|
||||||
|
- **[CMake](https://cmake.org/download/)**
|
||||||
|
- **[Bun](https://bun.sh/)** (JavaScript runtime)
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install all dependencies
|
||||||
|
bun i
|
||||||
|
|
||||||
|
# Build the project
|
||||||
|
bun run build
|
||||||
|
```
|
||||||
|
|
||||||
|
After building, the launcher executable will be located at:
|
||||||
|
|
||||||
|
```
|
||||||
|
src-tauri/target/release/ezpplauncher.exe
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📁 Project Structure (Simplified)
|
||||||
|
|
||||||
|
```
|
||||||
|
├── src/ # Frontend (Svelte)
|
||||||
|
├── src-tauri/ # Backend (Rust)
|
||||||
|
│ ├── tauri.conf.json # Tauri configuration
|
||||||
|
├── package.json # Bun project config
|
||||||
|
└── README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎨 Launcher Themes
|
||||||
|
|
||||||
|
By default, the launcher includes several downloadable themes. If you want to create your own custom theme, please use the [create-ezpplauncher-theme](https://git.ez-pp.farm/EZPPFarm/create-ezpplauncher-theme) repository for a template and instructions.
|
||||||
|
|||||||
|
After Width: | Height: | Size: 157 KiB |
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://next.shadcn-svelte.com/schema.json",
|
"$schema": "https://shadcn-svelte.com/schema.json",
|
||||||
"tailwind": {
|
"tailwind": {
|
||||||
"css": "src\\app.css",
|
"css": "src\\app.css",
|
||||||
"baseColor": "gray"
|
"baseColor": "gray"
|
||||||
},
|
},
|
||||||
"aliases": {
|
"aliases": {
|
||||||
"components": "$lib/components",
|
"components": "$lib/components",
|
||||||
"utils": "$lib/utils",
|
"utils": "$lib/utils",
|
||||||
"ui": "$lib/components/ui",
|
"ui": "$lib/components/ui",
|
||||||
"hooks": "$lib/hooks",
|
"hooks": "$lib/hooks",
|
||||||
"lib": "$lib"
|
"lib": "$lib"
|
||||||
},
|
},
|
||||||
"typescript": true,
|
"typescript": true,
|
||||||
"registry": "https://tw3.shadcn-svelte.com/registry/default"
|
"registry": "https://shadcn-svelte.com/registry"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import svelteConfig from './svelte.config.js';
|
||||||
|
import { includeIgnoreFile } from '@eslint/compat';
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import prettier from 'eslint-config-prettier';
|
||||||
|
import svelte from 'eslint-plugin-svelte';
|
||||||
|
import globals from 'globals';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import ts from 'typescript-eslint';
|
||||||
|
|
||||||
|
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
|
||||||
|
|
||||||
|
export default ts.config(
|
||||||
|
includeIgnoreFile(gitignorePath),
|
||||||
|
js.configs.recommended,
|
||||||
|
...ts.configs.recommended,
|
||||||
|
...svelte.configs.recommended,
|
||||||
|
prettier,
|
||||||
|
...svelte.configs.prettier,
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: { ...globals.browser, ...globals.node },
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
|
||||||
|
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
||||||
|
'no-undef': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
projectService: true,
|
||||||
|
extraFileExtensions: ['.svelte'],
|
||||||
|
parser: ts.parser,
|
||||||
|
svelteConfig,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'no-empty': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'error',
|
||||||
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^\\$\\$(Props|Events|Slots|Generic)$' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -1,64 +1,82 @@
|
|||||||
{
|
{
|
||||||
"name": "ezpplauncher",
|
"name": "ezpplauncher",
|
||||||
"version": "3.0.0",
|
"version": "3.2.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"debug": "bun run tauri dev",
|
"debug": "bun run tauri dev",
|
||||||
"dev": "vite dev",
|
"build": "bun ./scripts/build.ts",
|
||||||
"build": "vite build",
|
"vite:dev": "vite dev",
|
||||||
|
"vite:build": "vite build && exit 0",
|
||||||
"tauri:build": "tauri build",
|
"tauri:build": "tauri build",
|
||||||
"preview": "vite preview",
|
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"update-logo": "bun run tauri icon ./static/logo.png"
|
"tauri:update-logo": "bun run tauri icon ./static/logo.png",
|
||||||
|
"format": "prettier --write .",
|
||||||
|
"lint": "prettier --check . && eslint ."
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@better-fetch/fetch": "^1.1.18",
|
"@better-fetch/fetch": "^1.1.21",
|
||||||
"@elron/svelte-audio-store": "1.0.0",
|
"@fontsource-variable/sora": "^5.2.8",
|
||||||
"@number-flow/svelte": "^0.3.9",
|
"@fontsource/space-mono": "^5.2.9",
|
||||||
"@tailwindcss/typography": "0.5.16",
|
"@number-flow/svelte": "^0.4.0",
|
||||||
"@tauri-apps/api": "2.6.0",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"@tauri-apps/plugin-dialog": "2.3.0",
|
"@tailwindcss/vite": "^4.3.0",
|
||||||
"@tauri-apps/plugin-fs": "2.4.0",
|
"@tauri-apps/api": "^2.11.0",
|
||||||
"@tauri-apps/plugin-shell": "2.3.0",
|
"@tauri-apps/plugin-dialog": "^2.7.1",
|
||||||
"@tauri-apps/plugin-sql": "2.3.0",
|
"@tauri-apps/plugin-fs": "^2.5.1",
|
||||||
"animejs": "^4.0.2",
|
"@tauri-apps/plugin-shell": "^2.3.5",
|
||||||
|
"@types/node": "^25.9.1",
|
||||||
|
"animejs": "^4.4.1",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"crypto": "^1.0.1",
|
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"lucide-svelte": "0.523.0",
|
"jszip": "^3.10.1",
|
||||||
"osu-classes": "3.1.0",
|
"react": "^19.2.6",
|
||||||
"osu-parsers": "4.1.7",
|
"react-dom": "^19.2.6",
|
||||||
"radix-icons-svelte": "1.2.1",
|
"react-to-webcomponent": "^2.0.1",
|
||||||
"svelte-confetti": "^2.0.0"
|
"semver": "^7.8.1",
|
||||||
|
"sileo": "^0.1.5",
|
||||||
|
"svelte-confetti": "^2.3.2",
|
||||||
|
"tw-animate-css": "^1.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lucide/svelte": "^0.482.0",
|
"@eslint/compat": "^2.1.0",
|
||||||
"@sveltejs/adapter-static": "3.0.8",
|
"@eslint/js": "^10.0.1",
|
||||||
"@sveltejs/kit": "2.22.2",
|
"@iarna/toml": "2.2.5",
|
||||||
"@sveltejs/vite-plugin-svelte": "5.1.0",
|
"@lucide/svelte": "^1.16.0",
|
||||||
"@tauri-apps/cli": "2.6.1",
|
"@sveltejs/adapter-static": "^3.0.10",
|
||||||
|
"@sveltejs/kit": "^2.61.1",
|
||||||
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||||
|
"@tauri-apps/cli": "^2.11.2",
|
||||||
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
||||||
|
"@types/bun": "^1.3.14",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"autoprefixer": "10.4.21",
|
"@types/react-dom": "^19.2.3",
|
||||||
"bits-ui": "^1.4.7",
|
"@types/semver": "^7.7.1",
|
||||||
"clsx": "2.1.1",
|
"autoprefixer": "10.5.0",
|
||||||
"mode-watcher": "^1.0.6",
|
"bits-ui": "^2.18.1",
|
||||||
"prettier": "^3.6.1",
|
"clsx": "^2.1.1",
|
||||||
"prettier-plugin-svelte": "^3.4.0",
|
"eslint": "^10.4.0",
|
||||||
"sass-embedded": "1.89.2",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"svelte": "5.34.8",
|
"eslint-plugin-svelte": "^3.17.1",
|
||||||
"svelte-check": "4.2.2",
|
"globals": "^17.6.0",
|
||||||
"svelte-sonner": "^0.3.25",
|
"mode-watcher": "^1.1.0",
|
||||||
"tailwind-merge": "2.5.5",
|
"prettier": "^3.8.3",
|
||||||
"tailwind-variants": "0.3.1",
|
"prettier-plugin-svelte": "^4.0.1",
|
||||||
"tailwindcss": "3.4.17",
|
"sass-embedded": "^1.100.0",
|
||||||
"tailwindcss-animate": "1.0.7",
|
"svelte": "^5.55.9",
|
||||||
"tslib": "2.8.1",
|
"svelte-check": "^4.4.8",
|
||||||
"typescript": "5.8.3",
|
"svelte-sonner": "^1.1.1",
|
||||||
"vite": "7.0.0",
|
"tailwind-merge": "^3.6.0",
|
||||||
"vite-plugin-devtools-json": "^0.2.0"
|
"tailwind-variants": "^3.2.2",
|
||||||
|
"tailwindcss": "^4.3.0",
|
||||||
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"tslib": "^2.8.1",
|
||||||
|
"typescript": "^6.0.3",
|
||||||
|
"typescript-eslint": "^8.60.0",
|
||||||
|
"vite": "^8.0.14",
|
||||||
|
"vite-plugin-devtools-json": "^1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import { spawn } from 'child_process';
|
||||||
|
|
||||||
|
function runVite(): Promise<void> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const proc = spawn('bunx', ['--bun', 'vite', 'build'], { stdio: ['inherit', 'pipe', 'pipe'] });
|
||||||
|
|
||||||
|
proc.stdout?.on('data', (data: Buffer) => {
|
||||||
|
process.stdout.write(data);
|
||||||
|
if (data.toString().includes('✔ done')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
proc.kill();
|
||||||
|
resolve();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
proc.stderr?.on('data', (data: Buffer) => process.stderr.write(data));
|
||||||
|
proc.on('close', (code) => {
|
||||||
|
if (code === 0 || code === null) resolve();
|
||||||
|
else reject(new Error(`vite build exited with code ${code}`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function run(cmd: string, args: string[]): Promise<void> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const proc = spawn(cmd, args, { stdio: 'inherit' });
|
||||||
|
proc.on('close', (code) => {
|
||||||
|
if (code === 0) resolve();
|
||||||
|
else reject(new Error(`${cmd} exited with code ${code}`));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await run('bun', ['./scripts/sync-version.ts']);
|
||||||
|
await runVite();
|
||||||
|
|
||||||
|
//set NO_STRIP=1 in env for linux to prevent stripping of debug symbols in tauri builds, which causes issues with source maps
|
||||||
|
if (process.platform === 'linux') process.env.NO_STRIP = '1';
|
||||||
|
await run('bunx', ['tauri', 'build']);
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import * as toml from '@iarna/toml';
|
||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import { cwd } from 'process';
|
||||||
|
|
||||||
|
const packageJsonPath = path.join(cwd(), 'package.json');
|
||||||
|
const cargoTomlPath = path.join(cwd(), 'src-tauri', 'Cargo.toml');
|
||||||
|
const tauriConfPath = path.join(cwd(), 'src-tauri', 'tauri.conf.json');
|
||||||
|
|
||||||
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||||
|
const version = packageJson.version;
|
||||||
|
if (!version) throw new Error('Could not find version in package.json');
|
||||||
|
|
||||||
|
let cargoTomlContent = fs.readFileSync(cargoTomlPath, 'utf8');
|
||||||
|
const cargo = toml.parse(cargoTomlContent) as { package: { version: string } };
|
||||||
|
|
||||||
|
if (cargo.package.version !== version) {
|
||||||
|
cargoTomlContent = cargoTomlContent.replace(/version = ".*?"/, `version = "${version}"`);
|
||||||
|
fs.writeFileSync(cargoTomlPath, cargoTomlContent);
|
||||||
|
console.log(`✅ Synced Cargo.toml version to ${version}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const tauriConf = JSON.parse(fs.readFileSync(tauriConfPath, 'utf8'));
|
||||||
|
if (tauriConf.version !== version) {
|
||||||
|
tauriConf.version = version;
|
||||||
|
fs.writeFileSync(tauriConfPath, JSON.stringify(tauriConf, null, 2));
|
||||||
|
console.log(`✅ Synced tauri.conf.json version to ${version}`);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"types": ["@types/bun", "@types/node"]
|
||||||
|
},
|
||||||
|
"include": ["*.ts"]
|
||||||
|
}
|
||||||
@@ -1,12 +1,22 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ezpplauncher"
|
name = "ezpplauncher"
|
||||||
version = "0.1.0"
|
version = "3.2.5"
|
||||||
description = "A Tauri App"
|
description = "EZPPLauncher redefined."
|
||||||
authors = ["you"]
|
authors = ["HorizonCode"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
incremental = true # Compile your binary in smaller steps.
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
codegen-units = 1 # Allows LLVM to perform better optimization.
|
||||||
|
lto = true # Enables link-time-optimizations.
|
||||||
|
opt-level = "s" # Prioritizes small binary size. Use `3` if you prefer speed.
|
||||||
|
panic = "abort" # Higher performance by disabling panic handlers.
|
||||||
|
strip = true # Ensures debug symbols are removed.
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
# The `_lib` suffix may seem redundant but it is necessary
|
# The `_lib` suffix may seem redundant but it is necessary
|
||||||
# to make the lib name unique and wouldn't conflict with the bin name.
|
# to make the lib name unique and wouldn't conflict with the bin name.
|
||||||
@@ -15,26 +25,44 @@ name = "ezpplauncher_lib"
|
|||||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2.3.0", features = [] }
|
tauri-build = { version = "2.6.2", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri = { version = "2.6.2", features = [] }
|
tauri = { version = "2.11.2", features = ["protocol-asset"] }
|
||||||
tauri-plugin-shell = "2.3.0"
|
tauri-plugin-shell = "2.3.5"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
serde_json = "1.0.140"
|
serde_json = "1.0.150"
|
||||||
serde_repr = "0.1.20"
|
serde_repr = "0.1.20"
|
||||||
tauri-plugin-sql = "2.3.0"
|
tauri-plugin-dialog = "2.7.1"
|
||||||
tauri-plugin-dialog = "2.3.0"
|
tauri-plugin-fs = "2.5.1"
|
||||||
tauri-plugin-fs = "2.4.0"
|
|
||||||
hardware-id = "0.3.0"
|
hardware-id = "0.3.0"
|
||||||
winreg = "0.55.0"
|
tauri-plugin-cors-fetch = "5.0.0"
|
||||||
tauri-plugin-cors-fetch = "4.1.0"
|
sysinfo = "0.39.2"
|
||||||
sysinfo = "0.35.2"
|
reqwest = { version = "0.13.4", features = ["json", "stream", "query"] }
|
||||||
winapi = { version = "0.3", features = ["winuser"] }
|
|
||||||
reqwest = { version = "0.12.22", features = ["json", "stream"] }
|
|
||||||
md5 = "0.8.0"
|
md5 = "0.8.0"
|
||||||
tokio = { version = "1.46.0", features = ["full"] }
|
tokio = { version = "1.52.3", features = ["full"] }
|
||||||
|
open = "5.3.5"
|
||||||
|
presenceforge = { version = "0.2.1", features = ["tokio-runtime"] }
|
||||||
|
once_cell = "1.21.4"
|
||||||
|
futures-util = "0.3.32"
|
||||||
|
byteorder = "1.5.0"
|
||||||
|
anyhow = "1.0.102"
|
||||||
|
url = "2.5.8"
|
||||||
|
zip = "8.6.0"
|
||||||
|
sha1 = "0.11.0"
|
||||||
|
hex = "0.4.3"
|
||||||
|
rusqlite = { version = "0.40.0", features = ["bundled"] }
|
||||||
|
aes-gcm = "0.10.3"
|
||||||
|
base64 = "0.22.1"
|
||||||
|
sha2 = "0.11.0"
|
||||||
|
thiserror = "2.0.18"
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
winreg = "0.56.0"
|
||||||
|
winapi = { version = "0.3.9", features = ["winuser", "wincrypt", "memoryapi", "winbase", "dpapi"] }
|
||||||
|
widestring = "1.2.1"
|
||||||
|
windows-sys = "0.61.2"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
tauri-plugin-single-instance = "2.3.0"
|
tauri-plugin-single-instance = "2.4.2"
|
||||||
|
|
||||||
|
|||||||
@@ -19,18 +19,30 @@
|
|||||||
"core:window:allow-show",
|
"core:window:allow-show",
|
||||||
"fs:default",
|
"fs:default",
|
||||||
{
|
{
|
||||||
"identifier": "fs:allow-write",
|
"identifier": "fs:allow-read",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"identifier": "fs:allow-read",
|
"identifier": "fs:allow-write",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -38,15 +50,13 @@
|
|||||||
"identifier": "fs:allow-exists",
|
"identifier": "fs:allow-exists",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher"
|
||||||
}
|
},
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"identifier": "fs:allow-write-file",
|
|
||||||
"allow": [
|
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -54,7 +64,27 @@
|
|||||||
"identifier": "fs:allow-read-file",
|
"identifier": "fs:allow-read-file",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identifier": "fs:allow-write-file",
|
||||||
|
"allow": [
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -62,7 +92,13 @@
|
|||||||
"identifier": "fs:allow-read-text-file",
|
"identifier": "fs:allow-read-text-file",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -70,7 +106,41 @@
|
|||||||
"identifier": "fs:allow-mkdir",
|
"identifier": "fs:allow-mkdir",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"path": "$HOME/**/*"
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identifier": "fs:allow-read-dir",
|
||||||
|
"allow": [
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identifier": "fs:allow-remove",
|
||||||
|
"allow": [
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "$HOME/.ezpplauncher/**/*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
</adaptive-icon>
|
||||||
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 29 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#fff</color>
|
||||||
|
</resources>
|
||||||
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 357 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,21 @@
|
|||||||
|
!macro NSIS_HOOK_POSTINSTALL
|
||||||
|
${If} $PassiveMode = 1
|
||||||
|
${OrIf} ${Silent}
|
||||||
|
Exec '"$INSTDIR\${MAINBINARYNAME}.exe"'
|
||||||
|
${EndIf}
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro NSIS_HOOK_PREUNINSTALL
|
||||||
|
${If} $DeleteAppDataCheckboxState = 1
|
||||||
|
MessageBox MB_YESNO "Do you want to remove all EZPPLauncher data and themes?" IDYES do_delete IDNO skip_delete
|
||||||
|
do_delete:
|
||||||
|
StrCpy $R9 1
|
||||||
|
skip_delete:
|
||||||
|
${EndIf}
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro NSIS_HOOK_POSTUNINSTALL
|
||||||
|
${If} $R9 = 1
|
||||||
|
RMDir /r "$PROFILE\.ezpplauncher"
|
||||||
|
${EndIf}
|
||||||
|
!macroend
|
||||||
@@ -0,0 +1,219 @@
|
|||||||
|
use aes_gcm::aead::rand_core::RngCore;
|
||||||
|
use aes_gcm::{
|
||||||
|
Aes256Gcm, Key, Nonce,
|
||||||
|
aead::{Aead, KeyInit, OsRng},
|
||||||
|
};
|
||||||
|
use base64::{Engine, engine::general_purpose::STANDARD as BASE64};
|
||||||
|
use rusqlite::{Connection, OptionalExtension, params};
|
||||||
|
use serde_json::Value;
|
||||||
|
use sha2::{Digest, Sha256};
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Error, Debug)]
|
||||||
|
pub enum ConfigError {
|
||||||
|
#[error("SQLite error: {0}")]
|
||||||
|
Sqlite(#[from] rusqlite::Error),
|
||||||
|
#[error("Encryption error: {0}")]
|
||||||
|
Encryption(String),
|
||||||
|
#[error("JSON error: {0}")]
|
||||||
|
Json(#[from] serde_json::Error),
|
||||||
|
#[error("Base64 error: {0}")]
|
||||||
|
Base64(#[from] base64::DecodeError),
|
||||||
|
#[error("Config not initialized")]
|
||||||
|
NotInitialized,
|
||||||
|
#[error("IO error: {0}")]
|
||||||
|
Io(#[from] std::io::Error),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl serde::Serialize for ConfigError {
|
||||||
|
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
|
||||||
|
s.serialize_str(&self.to_string())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Config {
|
||||||
|
db_path: PathBuf,
|
||||||
|
conn: Option<Connection>,
|
||||||
|
hwid_key: Option<[u8; 32]>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Config {
|
||||||
|
pub fn new(db_path: impl Into<PathBuf>) -> Self {
|
||||||
|
Self {
|
||||||
|
db_path: db_path.into(),
|
||||||
|
conn: None,
|
||||||
|
hwid_key: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn init(&mut self, hwid: &str) -> Result<bool, ConfigError> {
|
||||||
|
let mut hasher = Sha256::new();
|
||||||
|
hasher.update(hwid.as_bytes());
|
||||||
|
let key_bytes: [u8; 32] = hasher.finalize().into();
|
||||||
|
self.hwid_key = Some(key_bytes);
|
||||||
|
|
||||||
|
let is_new = !self.db_path.exists();
|
||||||
|
|
||||||
|
if let Some(parent) = self.db_path.parent() {
|
||||||
|
std::fs::create_dir_all(parent)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let conn = Connection::open(&self.db_path)?;
|
||||||
|
|
||||||
|
conn.execute_batch(
|
||||||
|
"
|
||||||
|
PRAGMA journal_mode=WAL;
|
||||||
|
CREATE TABLE IF NOT EXISTS config (
|
||||||
|
key TEXT PRIMARY KEY,
|
||||||
|
value TEXT NOT NULL,
|
||||||
|
encrypted INTEGER NOT NULL DEFAULT 0
|
||||||
|
);
|
||||||
|
",
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.conn = Some(conn);
|
||||||
|
Ok(is_new)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get(&self, key: &str) -> Result<Option<Value>, ConfigError> {
|
||||||
|
let conn = self.conn.as_ref().ok_or(ConfigError::NotInitialized)?;
|
||||||
|
|
||||||
|
let mut stmt = conn.prepare("SELECT value, encrypted FROM config WHERE key = ?1")?;
|
||||||
|
|
||||||
|
let row: Option<(String, bool)> = stmt
|
||||||
|
.query_row(params![key], |r| Ok((r.get(0)?, r.get(1)?)))
|
||||||
|
.optional()?;
|
||||||
|
|
||||||
|
match row {
|
||||||
|
None => Ok(None),
|
||||||
|
Some((raw, false)) => Ok(Some(serde_json::from_str::<Value>(&raw)?)),
|
||||||
|
Some((raw, true)) => {
|
||||||
|
let plaintext = self
|
||||||
|
.decrypt_value(&raw)
|
||||||
|
.map_err(|_| ConfigError::Encryption(format!("failed to decrypt '{}'", key)))?;
|
||||||
|
|
||||||
|
serde_json::from_str::<Value>(&plaintext)
|
||||||
|
.map(Some)
|
||||||
|
.map_err(|_| {
|
||||||
|
ConfigError::Encryption(format!("decrypted '{}' is not valid JSON", key))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn exists(&self, key: &str) -> Result<bool, ConfigError> {
|
||||||
|
let conn = self.conn.as_ref().ok_or(ConfigError::NotInitialized)?;
|
||||||
|
let count: i64 = conn.query_row(
|
||||||
|
"SELECT COUNT(*) FROM config WHERE key = ?1",
|
||||||
|
params![key],
|
||||||
|
|r| r.get(0),
|
||||||
|
)?;
|
||||||
|
Ok(count > 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Return all key/value pairs (decrypting encrypted ones).
|
||||||
|
pub fn all(&self) -> Result<Vec<(String, Value)>, ConfigError> {
|
||||||
|
let conn = self.conn.as_ref().ok_or(ConfigError::NotInitialized)?;
|
||||||
|
let mut stmt = conn.prepare("SELECT key, value, encrypted FROM config")?;
|
||||||
|
|
||||||
|
let rows = stmt.query_map([], |r| {
|
||||||
|
Ok((
|
||||||
|
r.get::<_, String>(0)?,
|
||||||
|
r.get::<_, String>(1)?,
|
||||||
|
r.get::<_, bool>(2)?,
|
||||||
|
))
|
||||||
|
})?;
|
||||||
|
|
||||||
|
let mut out = Vec::new();
|
||||||
|
for row in rows {
|
||||||
|
let (k, raw, enc) = row?;
|
||||||
|
let v: Value = if enc {
|
||||||
|
let pt = self.decrypt_value(&raw)?;
|
||||||
|
serde_json::from_str(&pt)?
|
||||||
|
} else {
|
||||||
|
serde_json::from_str(&raw)?
|
||||||
|
};
|
||||||
|
out.push((k, v));
|
||||||
|
}
|
||||||
|
Ok(out)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set<T: serde::Serialize>(
|
||||||
|
&self,
|
||||||
|
key: &str,
|
||||||
|
value: T,
|
||||||
|
encrypt: bool,
|
||||||
|
) -> Result<(), ConfigError> {
|
||||||
|
let json = serde_json::to_string(&value)?;
|
||||||
|
if encrypt {
|
||||||
|
let blob = self.encrypt_value(&json)?;
|
||||||
|
self.upsert(key, &blob, true)
|
||||||
|
} else {
|
||||||
|
self.upsert(key, &json, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn delete(&self, key: &str) -> Result<(), ConfigError> {
|
||||||
|
let conn = self.conn.as_ref().ok_or(ConfigError::NotInitialized)?;
|
||||||
|
conn.execute("DELETE FROM config WHERE key = ?1", params![key])?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear(&self) -> Result<(), ConfigError> {
|
||||||
|
let conn = self.conn.as_ref().ok_or(ConfigError::NotInitialized)?;
|
||||||
|
conn.execute("DELETE FROM config", [])?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn upsert(&self, key: &str, raw: &str, encrypted: bool) -> Result<(), ConfigError> {
|
||||||
|
let conn = self.conn.as_ref().ok_or(ConfigError::NotInitialized)?;
|
||||||
|
conn.execute(
|
||||||
|
"INSERT INTO config (key, value, encrypted)
|
||||||
|
VALUES (?1, ?2, ?3)
|
||||||
|
ON CONFLICT(key) DO UPDATE SET value = excluded.value,
|
||||||
|
encrypted = excluded.encrypted",
|
||||||
|
params![key, raw, encrypted as i32],
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn cipher(&self) -> Result<Aes256Gcm, ConfigError> {
|
||||||
|
let key_bytes = self.hwid_key.ok_or(ConfigError::NotInitialized)?;
|
||||||
|
let key = Key::<Aes256Gcm>::from_slice(&key_bytes);
|
||||||
|
Ok(Aes256Gcm::new(key))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn encrypt_value(&self, plaintext: &str) -> Result<String, ConfigError> {
|
||||||
|
let cipher = self.cipher()?;
|
||||||
|
let mut nonce_bytes = [0u8; 12];
|
||||||
|
OsRng.fill_bytes(&mut nonce_bytes);
|
||||||
|
let nonce = Nonce::from_slice(&nonce_bytes);
|
||||||
|
|
||||||
|
let ciphertext = cipher
|
||||||
|
.encrypt(nonce, plaintext.as_bytes())
|
||||||
|
.map_err(|e| ConfigError::Encryption(e.to_string()))?;
|
||||||
|
|
||||||
|
let mut combined = nonce_bytes.to_vec();
|
||||||
|
combined.extend_from_slice(&ciphertext);
|
||||||
|
Ok(BASE64.encode(&combined))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn decrypt_value(&self, blob: &str) -> Result<String, ConfigError> {
|
||||||
|
let cipher = self.cipher()?;
|
||||||
|
let combined = BASE64.decode(blob)?;
|
||||||
|
|
||||||
|
if combined.len() < 12 {
|
||||||
|
return Err(ConfigError::Encryption("blob too short".into()));
|
||||||
|
}
|
||||||
|
|
||||||
|
let (nonce_bytes, ciphertext) = combined.split_at(12);
|
||||||
|
let nonce = Nonce::from_slice(nonce_bytes);
|
||||||
|
|
||||||
|
let plaintext = cipher
|
||||||
|
.decrypt(nonce, ciphertext)
|
||||||
|
.map_err(|e| ConfigError::Encryption(e.to_string()))?;
|
||||||
|
|
||||||
|
String::from_utf8(plaintext).map_err(|e| ConfigError::Encryption(e.to_string()))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +1,113 @@
|
|||||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||||
|
use hardware_id::get_id;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::sync::Mutex;
|
||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
|
use tauri_plugin_fs::FsExt;
|
||||||
|
|
||||||
pub mod commands;
|
pub mod commands;
|
||||||
|
pub mod config;
|
||||||
|
pub mod osudb;
|
||||||
|
pub mod presence;
|
||||||
|
pub mod state;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
use crate::commands::{
|
use crate::{
|
||||||
download_ezpp_launcher_update_files, find_osu_installation, get_beatmapsets_count,
|
commands::{
|
||||||
get_ezpp_launcher_update_files, get_hwid, get_osu_release_stream, get_osu_skin,
|
check_for_corruption, config_all, config_clear, config_delete, config_exists, config_get,
|
||||||
get_osu_version, get_skins_count, replace_ui_files, run_osu, run_osu_updater,
|
config_set, download_and_extract_theme, download_ezpp_launcher_update,
|
||||||
set_osu_config_values, set_osu_user_config_values, valid_osu_folder, is_osu_running
|
download_ezpp_launcher_update_files, encrypt_string, exit, extract_theme,
|
||||||
|
find_osu_installation, get_beatmapsets_count, get_ezpp_launcher_update_files, get_hwid,
|
||||||
|
get_launcher_version, get_osu_release_stream, get_osu_skin, get_osu_version, get_platform,
|
||||||
|
get_skins, get_skins_count, has_net8, has_osuwinello, has_wmctrl,
|
||||||
|
install_ezpp_launcher_update, is_open_tablet_driver_path_valid,
|
||||||
|
is_open_tablet_driver_running, is_osu_running, open_url_in_browser, opened_urls,
|
||||||
|
presence_connect, presence_disconnect, presence_is_connected, presence_update_button,
|
||||||
|
presence_update_status, presence_update_user, read_theme_info, replace_ui_files,
|
||||||
|
run_open_tablet_driver, run_osu, run_osu_updater, set_osu_config_values,
|
||||||
|
set_osu_user_config_values, stop_open_tablet_driver, valid_osu_folder,
|
||||||
|
},
|
||||||
|
state::AppState,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
unsafe {
|
||||||
|
// std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
|
||||||
|
}
|
||||||
|
|
||||||
let mut builder = tauri::Builder::default();
|
let mut builder = tauri::Builder::default();
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
{
|
{
|
||||||
builder = builder.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
|
builder = builder.plugin(tauri_plugin_single_instance::init(|app, args, _cwd| {
|
||||||
let app_window = app.get_webview_window("main").expect("no main window");
|
let app_window = app.get_webview_window("main").expect("no main window");
|
||||||
app_window
|
|
||||||
.set_always_on_top(true)
|
|
||||||
.expect("failed to set always on top");
|
|
||||||
app_window.set_focus().expect("failed to focus");
|
app_window.set_focus().expect("failed to focus");
|
||||||
|
if args.len() > 1 {
|
||||||
|
use tauri::Emitter;
|
||||||
|
|
||||||
|
let mut files = Vec::new();
|
||||||
|
|
||||||
|
for maybe_file in args.iter().skip(1) {
|
||||||
|
if maybe_file.starts_with("-") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let path = PathBuf::from(maybe_file);
|
||||||
|
|
||||||
|
if path.extension().and_then(|e| e.to_str()) == Some("ezpplauncher-theme") {
|
||||||
|
app.fs_scope().allow_file(&path).ok();
|
||||||
|
files.push(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
app.emit("opened", files.clone()).ok();
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
builder
|
let app = builder
|
||||||
|
.setup(|app| {
|
||||||
|
// ── Config ────────────────────────────────────────────────────────
|
||||||
|
let home = std::env::var("HOME")
|
||||||
|
.or_else(|_| std::env::var("USERPROFILE"))
|
||||||
|
.unwrap_or_else(|_| ".".into());
|
||||||
|
let db_path = PathBuf::from(home).join(".ezpplauncher").join("config.db");
|
||||||
|
|
||||||
|
let hwid = get_id().unwrap_or_else(|_| "recorderinsandybridge".into());
|
||||||
|
|
||||||
|
let mut cfg = config::Config::new(db_path);
|
||||||
|
cfg.init(&hwid)?;
|
||||||
|
|
||||||
|
// ── Opened files ──────────────────────────────────────────────────
|
||||||
|
let mut opened_files = Vec::new();
|
||||||
|
let args = std::env::args().collect::<Vec<_>>();
|
||||||
|
if args.len() > 1 {
|
||||||
|
for maybe_file in args.iter().skip(1) {
|
||||||
|
if maybe_file.starts_with("-") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let path = PathBuf::from(maybe_file);
|
||||||
|
if path.extension().and_then(|e| e.to_str()) == Some("ezpplauncher-theme") {
|
||||||
|
app.fs_scope().allow_file(&path).ok();
|
||||||
|
opened_files.push(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
app.manage(AppState {
|
||||||
|
config: Mutex::new(cfg),
|
||||||
|
opened_files: Mutex::new(opened_files),
|
||||||
|
});
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
|
opened_urls,
|
||||||
get_hwid,
|
get_hwid,
|
||||||
find_osu_installation,
|
find_osu_installation,
|
||||||
valid_osu_folder,
|
valid_osu_folder,
|
||||||
get_beatmapsets_count,
|
get_beatmapsets_count,
|
||||||
|
get_skins,
|
||||||
get_skins_count,
|
get_skins_count,
|
||||||
get_osu_version,
|
get_osu_version,
|
||||||
get_osu_release_stream,
|
get_osu_release_stream,
|
||||||
@@ -41,13 +119,46 @@ pub fn run() {
|
|||||||
get_ezpp_launcher_update_files,
|
get_ezpp_launcher_update_files,
|
||||||
download_ezpp_launcher_update_files,
|
download_ezpp_launcher_update_files,
|
||||||
replace_ui_files,
|
replace_ui_files,
|
||||||
is_osu_running
|
is_osu_running,
|
||||||
|
open_url_in_browser,
|
||||||
|
get_launcher_version,
|
||||||
|
exit,
|
||||||
|
get_platform,
|
||||||
|
check_for_corruption,
|
||||||
|
presence_connect,
|
||||||
|
presence_disconnect,
|
||||||
|
presence_update_status,
|
||||||
|
presence_update_user,
|
||||||
|
presence_update_button,
|
||||||
|
presence_is_connected,
|
||||||
|
has_osuwinello,
|
||||||
|
has_wmctrl,
|
||||||
|
has_net8,
|
||||||
|
encrypt_string,
|
||||||
|
download_ezpp_launcher_update,
|
||||||
|
install_ezpp_launcher_update,
|
||||||
|
read_theme_info,
|
||||||
|
extract_theme,
|
||||||
|
download_and_extract_theme,
|
||||||
|
config_get,
|
||||||
|
config_set,
|
||||||
|
config_exists,
|
||||||
|
config_delete,
|
||||||
|
config_clear,
|
||||||
|
config_all,
|
||||||
|
run_open_tablet_driver,
|
||||||
|
stop_open_tablet_driver,
|
||||||
|
is_open_tablet_driver_running,
|
||||||
|
is_open_tablet_driver_path_valid
|
||||||
])
|
])
|
||||||
.plugin(tauri_plugin_fs::init())
|
.plugin(tauri_plugin_fs::init())
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
.plugin(tauri_plugin_shell::init())
|
.plugin(tauri_plugin_shell::init())
|
||||||
.plugin(tauri_plugin_cors_fetch::init())
|
.plugin(tauri_plugin_cors_fetch::init())
|
||||||
.plugin(tauri_plugin_sql::Builder::default().build())
|
.build(tauri::generate_context!())
|
||||||
.run(tauri::generate_context!())
|
.expect("error while building tauri application");
|
||||||
.expect("error while running tauri application");
|
|
||||||
|
app.run(|app, event| {
|
||||||
|
presence::handle_run_event(app, &event);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,370 @@
|
|||||||
|
use std::io::{Cursor, Read};
|
||||||
|
|
||||||
|
use anyhow::{Result, anyhow};
|
||||||
|
use byteorder::{LittleEndian, ReadBytesExt};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
pub struct OsuReader {
|
||||||
|
cursor: Cursor<Vec<u8>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl OsuReader {
|
||||||
|
pub fn new(data: Vec<u8>) -> Self {
|
||||||
|
Self {
|
||||||
|
cursor: Cursor::new(data),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_i16(&mut self) -> Result<i16> {
|
||||||
|
Ok(self.cursor.read_i16::<LittleEndian>()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_i32(&mut self) -> Result<i32> {
|
||||||
|
Ok(self.cursor.read_i32::<LittleEndian>()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_i64(&mut self) -> Result<i64> {
|
||||||
|
Ok(self.cursor.read_i64::<LittleEndian>()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_u8(&mut self) -> Result<u8> {
|
||||||
|
Ok(self.cursor.read_u8()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_f32(&mut self) -> Result<f32> {
|
||||||
|
Ok(self.cursor.read_f32::<LittleEndian>()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_f64(&mut self) -> Result<f64> {
|
||||||
|
Ok(self.cursor.read_f64::<LittleEndian>()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_bool(&mut self) -> Result<bool> {
|
||||||
|
Ok(self.read_u8()? != 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_string(&mut self) -> Result<Option<String>> {
|
||||||
|
let indicator = self.read_u8()?;
|
||||||
|
|
||||||
|
if indicator == 0 {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
|
||||||
|
if indicator != 0x0B {
|
||||||
|
return Err(anyhow!("Invalid osu string indicator"));
|
||||||
|
}
|
||||||
|
|
||||||
|
let len = self.read_uleb128()? as usize;
|
||||||
|
let mut buf = vec![0; len];
|
||||||
|
self.cursor.read_exact(&mut buf)?;
|
||||||
|
|
||||||
|
Ok(Some(String::from_utf8(buf)?))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_uleb128(&mut self) -> Result<u64> {
|
||||||
|
let mut result = 0;
|
||||||
|
let mut shift = 0;
|
||||||
|
|
||||||
|
loop {
|
||||||
|
let byte = self.read_u8()?;
|
||||||
|
result |= ((byte & 0x7F) as u64) << shift;
|
||||||
|
|
||||||
|
if (byte & 0x80) == 0 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
shift += 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct TimingPoint {
|
||||||
|
pub bpm: f64,
|
||||||
|
pub offset: f64,
|
||||||
|
pub inherited: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Beatmap {
|
||||||
|
pub artist_name: Option<String>,
|
||||||
|
pub artist_unicode: Option<String>,
|
||||||
|
pub song_title: Option<String>,
|
||||||
|
pub song_title_unicode: Option<String>,
|
||||||
|
pub creator: Option<String>,
|
||||||
|
pub difficulty: Option<String>,
|
||||||
|
pub audio: Option<String>,
|
||||||
|
pub md5: Option<String>,
|
||||||
|
pub osu_file_name: Option<String>,
|
||||||
|
|
||||||
|
pub ranked_status: u8,
|
||||||
|
pub hitcircles: i16,
|
||||||
|
pub slider_count: i16,
|
||||||
|
pub spinner_count: i16,
|
||||||
|
pub last_modification: i64,
|
||||||
|
|
||||||
|
pub approach_rate: f32,
|
||||||
|
pub circle_size: f32,
|
||||||
|
pub hp_drain: f32,
|
||||||
|
pub overall_difficulty: f32,
|
||||||
|
pub slider_velocity: f64,
|
||||||
|
|
||||||
|
pub difficulties: HashMap<i32, f64>,
|
||||||
|
|
||||||
|
pub drain_time: i32,
|
||||||
|
pub total_time: i32,
|
||||||
|
pub preview_offset: i32,
|
||||||
|
|
||||||
|
pub beatmap_id: i32,
|
||||||
|
pub beatmapset_id: i32,
|
||||||
|
pub thread_id: i32,
|
||||||
|
|
||||||
|
pub grade_standard: u8,
|
||||||
|
pub grade_taiko: u8,
|
||||||
|
pub grade_catch: u8,
|
||||||
|
pub grade_mania: u8,
|
||||||
|
|
||||||
|
pub local_beatmap_offset: i16,
|
||||||
|
pub stack_leniency: f32,
|
||||||
|
|
||||||
|
pub mode: u8,
|
||||||
|
pub song_source: Option<String>,
|
||||||
|
pub song_tags: Option<String>,
|
||||||
|
|
||||||
|
pub online_beatmap_offset: i16,
|
||||||
|
pub title_font: Option<String>,
|
||||||
|
|
||||||
|
pub unplayed: bool,
|
||||||
|
pub last_played: i64,
|
||||||
|
pub osz2: bool,
|
||||||
|
pub folder_name: Option<String>,
|
||||||
|
pub last_checked_against_repository: i64,
|
||||||
|
|
||||||
|
pub ignore_sound: bool,
|
||||||
|
pub ignore_skin: bool,
|
||||||
|
pub disable_storyboard: bool,
|
||||||
|
pub disable_video: bool,
|
||||||
|
pub visual_override: bool,
|
||||||
|
|
||||||
|
pub last_modification_time: i32,
|
||||||
|
pub mania_scroll_speed: u8,
|
||||||
|
|
||||||
|
pub timing_points: Vec<TimingPoint>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct OsuDbData {
|
||||||
|
pub osuver: i32,
|
||||||
|
pub folder_count: i32,
|
||||||
|
pub is_unlocked: bool,
|
||||||
|
pub date_unlock_ticks: i64,
|
||||||
|
pub username: Option<String>,
|
||||||
|
pub beatmaps: Vec<Beatmap>,
|
||||||
|
pub userperms: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// =========================
|
||||||
|
// PARSER
|
||||||
|
// =========================
|
||||||
|
//
|
||||||
|
|
||||||
|
pub fn parse_osudb(bytes: Vec<u8>) -> Result<OsuDbData> {
|
||||||
|
let mut reader = OsuReader::new(bytes);
|
||||||
|
|
||||||
|
let osuver = reader.read_i32()?;
|
||||||
|
let folder_count = reader.read_i32()?;
|
||||||
|
let is_unlocked = reader.read_bool()?;
|
||||||
|
let date_unlock_ticks = reader.read_i64()?;
|
||||||
|
let username = reader.read_string()?;
|
||||||
|
let beatmaps_count = reader.read_i32()?;
|
||||||
|
|
||||||
|
let mut beatmaps = Vec::new();
|
||||||
|
|
||||||
|
for _ in 0..beatmaps_count {
|
||||||
|
if osuver < 20191107 {
|
||||||
|
reader.read_i32()?; // entry size
|
||||||
|
}
|
||||||
|
|
||||||
|
let artist_name = reader.read_string()?;
|
||||||
|
let artist_unicode = reader.read_string()?;
|
||||||
|
let song_title = reader.read_string()?;
|
||||||
|
let song_title_unicode = reader.read_string()?;
|
||||||
|
let creator = reader.read_string()?;
|
||||||
|
let difficulty = reader.read_string()?;
|
||||||
|
let audio = reader.read_string()?;
|
||||||
|
let md5 = reader.read_string()?;
|
||||||
|
let osu_file_name = reader.read_string()?;
|
||||||
|
|
||||||
|
let ranked_status = reader.read_u8()?;
|
||||||
|
let hitcircles = reader.read_i16()?;
|
||||||
|
let slider_count = reader.read_i16()?;
|
||||||
|
let spinner_count = reader.read_i16()?;
|
||||||
|
let last_modification = reader.read_i64()?;
|
||||||
|
|
||||||
|
let approach_rate = if osuver < 20140609 {
|
||||||
|
reader.read_u8()? as f32
|
||||||
|
} else {
|
||||||
|
reader.read_f32()?
|
||||||
|
};
|
||||||
|
|
||||||
|
let circle_size = if osuver < 20140609 {
|
||||||
|
reader.read_u8()? as f32
|
||||||
|
} else {
|
||||||
|
reader.read_f32()?
|
||||||
|
};
|
||||||
|
|
||||||
|
let hp_drain = if osuver < 20140609 {
|
||||||
|
reader.read_u8()? as f32
|
||||||
|
} else {
|
||||||
|
reader.read_f32()?
|
||||||
|
};
|
||||||
|
|
||||||
|
let overall_difficulty = if osuver < 20140609 {
|
||||||
|
reader.read_u8()? as f32
|
||||||
|
} else {
|
||||||
|
reader.read_f32()?
|
||||||
|
};
|
||||||
|
|
||||||
|
let slider_velocity = reader.read_f64()?;
|
||||||
|
|
||||||
|
let mut difficulties: HashMap<i32, f64> = HashMap::new();
|
||||||
|
|
||||||
|
if osuver >= 20140609 {
|
||||||
|
for _ in 0..4 {
|
||||||
|
let len = reader.read_i32()?;
|
||||||
|
for _ in 0..len {
|
||||||
|
reader.read_u8()?;
|
||||||
|
let mode = reader.read_i32()?;
|
||||||
|
reader.read_u8()?;
|
||||||
|
let diff = if osuver > 20250107 {
|
||||||
|
reader.read_f32()? as f64
|
||||||
|
} else {
|
||||||
|
reader.read_f64()?
|
||||||
|
};
|
||||||
|
|
||||||
|
difficulties.insert(mode, diff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let drain_time = reader.read_i32()?;
|
||||||
|
let total_time = reader.read_i32()?;
|
||||||
|
let preview_offset = reader.read_i32()?;
|
||||||
|
|
||||||
|
let timing_len = reader.read_i32()?;
|
||||||
|
let mut timing_points = Vec::new();
|
||||||
|
for _ in 0..timing_len {
|
||||||
|
timing_points.push(TimingPoint {
|
||||||
|
bpm: reader.read_f64()?,
|
||||||
|
offset: reader.read_f64()?,
|
||||||
|
inherited: reader.read_bool()?,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let beatmap_id = reader.read_i32()?;
|
||||||
|
let beatmapset_id = reader.read_i32()?;
|
||||||
|
let thread_id = reader.read_i32()?;
|
||||||
|
|
||||||
|
let grade_standard = reader.read_u8()?;
|
||||||
|
let grade_taiko = reader.read_u8()?;
|
||||||
|
let grade_catch = reader.read_u8()?;
|
||||||
|
let grade_mania = reader.read_u8()?;
|
||||||
|
|
||||||
|
let local_beatmap_offset = reader.read_i16()?;
|
||||||
|
let stack_leniency = reader.read_f32()?;
|
||||||
|
|
||||||
|
let mode = reader.read_u8()?;
|
||||||
|
let song_source = reader.read_string()?;
|
||||||
|
let song_tags = reader.read_string()?;
|
||||||
|
|
||||||
|
let online_beatmap_offset = reader.read_i16()?;
|
||||||
|
let title_font = reader.read_string()?;
|
||||||
|
|
||||||
|
let unplayed = reader.read_bool()?;
|
||||||
|
let last_played = reader.read_i64()?;
|
||||||
|
let osz2 = reader.read_bool()?;
|
||||||
|
let folder_name = reader.read_string()?;
|
||||||
|
let last_checked_against_repository = reader.read_i64()?;
|
||||||
|
|
||||||
|
let ignore_sound = reader.read_bool()?;
|
||||||
|
let ignore_skin = reader.read_bool()?;
|
||||||
|
let disable_storyboard = reader.read_bool()?;
|
||||||
|
let disable_video = reader.read_bool()?;
|
||||||
|
let visual_override = reader.read_bool()?;
|
||||||
|
|
||||||
|
if osuver < 20140609 {
|
||||||
|
reader.read_i16()?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let last_modification_time = reader.read_i32()?;
|
||||||
|
let mania_scroll_speed = reader.read_u8()?;
|
||||||
|
|
||||||
|
beatmaps.push(Beatmap {
|
||||||
|
artist_name,
|
||||||
|
artist_unicode,
|
||||||
|
song_title,
|
||||||
|
song_title_unicode,
|
||||||
|
creator,
|
||||||
|
difficulty,
|
||||||
|
audio,
|
||||||
|
md5,
|
||||||
|
osu_file_name,
|
||||||
|
ranked_status,
|
||||||
|
hitcircles,
|
||||||
|
slider_count,
|
||||||
|
spinner_count,
|
||||||
|
last_modification,
|
||||||
|
approach_rate,
|
||||||
|
circle_size,
|
||||||
|
hp_drain,
|
||||||
|
overall_difficulty,
|
||||||
|
slider_velocity,
|
||||||
|
difficulties,
|
||||||
|
drain_time,
|
||||||
|
total_time,
|
||||||
|
preview_offset,
|
||||||
|
beatmap_id,
|
||||||
|
beatmapset_id,
|
||||||
|
thread_id,
|
||||||
|
grade_standard,
|
||||||
|
grade_taiko,
|
||||||
|
grade_catch,
|
||||||
|
grade_mania,
|
||||||
|
local_beatmap_offset,
|
||||||
|
stack_leniency,
|
||||||
|
mode,
|
||||||
|
song_source,
|
||||||
|
song_tags,
|
||||||
|
online_beatmap_offset,
|
||||||
|
title_font,
|
||||||
|
unplayed,
|
||||||
|
last_played,
|
||||||
|
osz2,
|
||||||
|
folder_name,
|
||||||
|
last_checked_against_repository,
|
||||||
|
ignore_sound,
|
||||||
|
ignore_skin,
|
||||||
|
disable_storyboard,
|
||||||
|
disable_video,
|
||||||
|
visual_override,
|
||||||
|
last_modification_time,
|
||||||
|
mania_scroll_speed,
|
||||||
|
timing_points,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let userperms = reader.read_i32()?;
|
||||||
|
|
||||||
|
Ok(OsuDbData {
|
||||||
|
osuver,
|
||||||
|
folder_count,
|
||||||
|
is_unlocked,
|
||||||
|
date_unlock_ticks,
|
||||||
|
username,
|
||||||
|
beatmaps,
|
||||||
|
userperms,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,346 @@
|
|||||||
|
use once_cell::sync::Lazy;
|
||||||
|
use presenceforge::{ActivityBuilder, AsyncDiscordIpcClient};
|
||||||
|
use std::sync::Mutex as StdMutex;
|
||||||
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
use tauri::{AppHandle, RunEvent};
|
||||||
|
use tokio::sync::{mpsc, oneshot};
|
||||||
|
use tokio::time::{Duration, interval};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct PresenceButton {
|
||||||
|
pub label: String,
|
||||||
|
pub url: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct PresenceData {
|
||||||
|
pub state: String,
|
||||||
|
pub details: String,
|
||||||
|
pub large_image_key: String,
|
||||||
|
pub large_image_text: String,
|
||||||
|
pub small_image_key: Option<String>,
|
||||||
|
pub small_image_text: Option<String>,
|
||||||
|
pub dynamic_button: Option<PresenceButton>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for PresenceData {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
state: "Idle in Launcher...".to_string(),
|
||||||
|
details: " ".to_string(),
|
||||||
|
large_image_key: "ezppfarm".to_string(),
|
||||||
|
large_image_text: "EZPPFarm".to_string(),
|
||||||
|
small_image_key: None,
|
||||||
|
small_image_text: None,
|
||||||
|
dynamic_button: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
enum PresenceCommand {
|
||||||
|
Connect(oneshot::Sender<bool>),
|
||||||
|
Disconnect(oneshot::Sender<()>),
|
||||||
|
UpdateData(PresenceData),
|
||||||
|
IsConnected(oneshot::Sender<bool>),
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ReconnectResult {
|
||||||
|
Connected(AsyncDiscordIpcClient),
|
||||||
|
Failed,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct PresenceActor {
|
||||||
|
receiver: mpsc::Receiver<PresenceCommand>,
|
||||||
|
reconnect_rx: mpsc::Receiver<ReconnectResult>,
|
||||||
|
reconnect_tx: mpsc::Sender<ReconnectResult>,
|
||||||
|
client: Option<AsyncDiscordIpcClient>,
|
||||||
|
data: PresenceData,
|
||||||
|
start_timestamp: i64,
|
||||||
|
reconnecting: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PresenceActor {
|
||||||
|
fn new(receiver: mpsc::Receiver<PresenceCommand>) -> Self {
|
||||||
|
let start = SystemTime::now()
|
||||||
|
.duration_since(UNIX_EPOCH)
|
||||||
|
.unwrap()
|
||||||
|
.as_secs() as i64;
|
||||||
|
|
||||||
|
let (reconnect_tx, reconnect_rx) = mpsc::channel(1);
|
||||||
|
|
||||||
|
Self {
|
||||||
|
receiver,
|
||||||
|
reconnect_rx,
|
||||||
|
reconnect_tx,
|
||||||
|
client: None,
|
||||||
|
data: PresenceData::default(),
|
||||||
|
start_timestamp: start,
|
||||||
|
reconnecting: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn run(&mut self) {
|
||||||
|
let mut heartbeat = interval(Duration::from_secs(5));
|
||||||
|
heartbeat.tick().await;
|
||||||
|
|
||||||
|
loop {
|
||||||
|
tokio::select! {
|
||||||
|
Some(cmd) = self.receiver.recv() => {
|
||||||
|
match cmd {
|
||||||
|
PresenceCommand::Connect(resp) => self.cmd_connect(resp).await,
|
||||||
|
PresenceCommand::Disconnect(resp) => self.cmd_disconnect(resp).await,
|
||||||
|
PresenceCommand::UpdateData(data) => {
|
||||||
|
self.data = data;
|
||||||
|
self.push_presence().await;
|
||||||
|
}
|
||||||
|
PresenceCommand::IsConnected(resp) => {
|
||||||
|
let _ = resp.send(self.client.is_some());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Some(result) = self.reconnect_rx.recv() => {
|
||||||
|
self.reconnecting = false;
|
||||||
|
match result {
|
||||||
|
ReconnectResult::Connected(client) => {
|
||||||
|
println!("Presence: reconnect succeeded.");
|
||||||
|
self.client = Some(client);
|
||||||
|
self.push_presence().await;
|
||||||
|
}
|
||||||
|
ReconnectResult::Failed => {
|
||||||
|
eprintln!("Presence: all reconnect attempts exhausted.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = heartbeat.tick() => {
|
||||||
|
self.push_presence().await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn cmd_connect(&mut self, resp: oneshot::Sender<bool>) {
|
||||||
|
if self.client.is_some() {
|
||||||
|
let _ = resp.send(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
match try_connect_once().await {
|
||||||
|
Some(client) => {
|
||||||
|
self.client = Some(client);
|
||||||
|
self.reconnecting = false;
|
||||||
|
self.push_presence().await;
|
||||||
|
let _ = resp.send(true);
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
eprintln!("Presence: initial connect failed; spawning reconnect task.");
|
||||||
|
let _ = resp.send(false);
|
||||||
|
self.spawn_reconnect_task();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn cmd_disconnect(&mut self, resp: oneshot::Sender<()>) {
|
||||||
|
if let Some(mut client) = self.client.take() {
|
||||||
|
let _ = client.clear_activity().await;
|
||||||
|
println!("Presence: disconnected.");
|
||||||
|
}
|
||||||
|
let _ = resp.send(());
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn push_presence(&mut self) {
|
||||||
|
let client = match self.client.as_mut() {
|
||||||
|
Some(c) => c,
|
||||||
|
None => return,
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut builder = ActivityBuilder::new()
|
||||||
|
.state(&self.data.state)
|
||||||
|
.details(&self.data.details)
|
||||||
|
.start_timestamp(self.start_timestamp as u64)
|
||||||
|
.large_image(&self.data.large_image_key)
|
||||||
|
.large_text(&self.data.large_image_text);
|
||||||
|
|
||||||
|
if let Some(key) = &self.data.small_image_key {
|
||||||
|
builder = builder.small_image(key);
|
||||||
|
}
|
||||||
|
if let Some(text) = &self.data.small_image_text {
|
||||||
|
builder = builder.small_text(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(btn) = &self.data.dynamic_button {
|
||||||
|
builder = builder.button(&btn.label, &btn.url);
|
||||||
|
} else {
|
||||||
|
builder = builder.button(
|
||||||
|
"Download the Launcher",
|
||||||
|
"https://git.ez-pp.farm/EZPPFarm/EZPPLauncher/releases/latest",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
builder = builder.button("Join EZPPFarm", "https://ez-pp.farm/discord");
|
||||||
|
|
||||||
|
let activity = builder.build();
|
||||||
|
|
||||||
|
/* println!("Presence: updating activity: {:?}", activity); */
|
||||||
|
if let Err(e) = client.set_activity(&activity).await {
|
||||||
|
eprintln!("Presence: set_activity failed ({:?}); will reconnect.", e);
|
||||||
|
self.client = None;
|
||||||
|
self.spawn_reconnect_task();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn spawn_reconnect_task(&mut self) {
|
||||||
|
if self.reconnecting {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.reconnecting = true;
|
||||||
|
|
||||||
|
let tx = self.reconnect_tx.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
const MAX_ATTEMPTS: u32 = 5;
|
||||||
|
for attempt in 1..=MAX_ATTEMPTS {
|
||||||
|
let delay = Duration::from_secs(5 * attempt as u64);
|
||||||
|
println!(
|
||||||
|
"Presence: reconnect attempt {}/{} in {:?}…",
|
||||||
|
attempt, MAX_ATTEMPTS, delay
|
||||||
|
);
|
||||||
|
tokio::time::sleep(delay).await;
|
||||||
|
|
||||||
|
if let Some(client) = try_connect_once().await {
|
||||||
|
let _ = tx.send(ReconnectResult::Connected(client)).await;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let _ = tx.send(ReconnectResult::Failed).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn try_connect_once() -> Option<AsyncDiscordIpcClient> {
|
||||||
|
match AsyncDiscordIpcClient::new("1032772293220384808").await {
|
||||||
|
Ok(mut client) => match client.connect().await {
|
||||||
|
Ok(_) => {
|
||||||
|
println!("Presence: IPC connected.");
|
||||||
|
Some(client)
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
eprintln!("Presence: IPC connect error: {:?}", e);
|
||||||
|
None
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Err(e) => {
|
||||||
|
eprintln!("Presence: failed to create client: {:?}", e);
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static PRESENCE_TX: Lazy<mpsc::Sender<PresenceCommand>> = Lazy::new(|| {
|
||||||
|
let (tx, rx) = mpsc::channel(32);
|
||||||
|
let mut actor = PresenceActor::new(rx);
|
||||||
|
tokio::spawn(async move { actor.run().await });
|
||||||
|
tx
|
||||||
|
});
|
||||||
|
|
||||||
|
pub static PRESENCE_DATA: Lazy<StdMutex<PresenceData>> =
|
||||||
|
Lazy::new(|| StdMutex::new(PresenceData::default()));
|
||||||
|
|
||||||
|
pub async fn connect() -> bool {
|
||||||
|
let (tx, rx) = oneshot::channel();
|
||||||
|
if PRESENCE_TX.send(PresenceCommand::Connect(tx)).await.is_ok() {
|
||||||
|
return rx.await.unwrap_or(false);
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn disconnect() {
|
||||||
|
let (tx, rx) = oneshot::channel();
|
||||||
|
if PRESENCE_TX.send(PresenceCommand::Disconnect(tx)).await.is_ok() {
|
||||||
|
let _ = tokio::time::timeout(Duration::from_secs(2), rx).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn has_presence() -> bool {
|
||||||
|
let (tx, rx) = oneshot::channel();
|
||||||
|
if PRESENCE_TX
|
||||||
|
.send(PresenceCommand::IsConnected(tx))
|
||||||
|
.await
|
||||||
|
.is_ok()
|
||||||
|
{
|
||||||
|
return rx.await.unwrap_or(false);
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn update_status(state: Option<&str>, details: Option<&str>, large_image_key: Option<&str>) {
|
||||||
|
let data = {
|
||||||
|
let mut guard = PRESENCE_DATA.lock().unwrap();
|
||||||
|
if let Some(s) = state {
|
||||||
|
guard.state = s.to_string();
|
||||||
|
}
|
||||||
|
if let Some(d) = details {
|
||||||
|
guard.details = d.to_string();
|
||||||
|
}
|
||||||
|
if let Some(img) = large_image_key {
|
||||||
|
guard.large_image_key = img.to_string();
|
||||||
|
}
|
||||||
|
guard.clone()
|
||||||
|
};
|
||||||
|
|
||||||
|
let tx = PRESENCE_TX.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = tx.send(PresenceCommand::UpdateData(data)).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn update_user(username: Option<&str>, id: Option<&str>) {
|
||||||
|
let data = {
|
||||||
|
let mut guard = PRESENCE_DATA.lock().unwrap();
|
||||||
|
guard.small_image_key = id.map(|s| format!("https://a.ez-pp.farm/{}", s));
|
||||||
|
guard.small_image_text = username.map(str::to_string);
|
||||||
|
guard.clone()
|
||||||
|
};
|
||||||
|
|
||||||
|
let tx = PRESENCE_TX.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = tx.send(PresenceCommand::UpdateData(data)).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_button(label: &str, url: &str) {
|
||||||
|
let data = {
|
||||||
|
let mut guard = PRESENCE_DATA.lock().unwrap();
|
||||||
|
guard.dynamic_button = Some(PresenceButton {
|
||||||
|
label: label.to_string(),
|
||||||
|
url: url.to_string(),
|
||||||
|
});
|
||||||
|
guard.clone()
|
||||||
|
};
|
||||||
|
|
||||||
|
let tx = PRESENCE_TX.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = tx.send(PresenceCommand::UpdateData(data)).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clear_button() {
|
||||||
|
let data = {
|
||||||
|
let mut guard = PRESENCE_DATA.lock().unwrap();
|
||||||
|
guard.dynamic_button = None;
|
||||||
|
guard.clone()
|
||||||
|
};
|
||||||
|
|
||||||
|
let tx = PRESENCE_TX.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = tx.send(PresenceCommand::UpdateData(data)).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn handle_run_event(_app: &AppHandle, event: &RunEvent) {
|
||||||
|
if let RunEvent::ExitRequested { .. } | RunEvent::Exit = event {
|
||||||
|
tauri::async_runtime::block_on(async {
|
||||||
|
disconnect().await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// state.rs
|
||||||
|
use crate::config::Config;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::sync::Mutex;
|
||||||
|
|
||||||
|
pub struct AppState {
|
||||||
|
pub config: Mutex<Config>,
|
||||||
|
pub opened_files: Mutex<Vec<PathBuf>>,
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
use std::ffi::OsString;
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::os::windows::ffi::OsStringExt;
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use sysinfo::Pid;
|
use sysinfo::Pid;
|
||||||
|
|
||||||
@@ -26,10 +24,13 @@ pub fn get_osu_user_config<P: AsRef<Path>>(
|
|||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let current_user = std::env::var("USERNAME").unwrap_or_else(|_| "Admin".to_string());
|
let current_user = std::env::var("USERNAME")
|
||||||
|
.or_else(|_| std::env::var("USER"))
|
||||||
|
.unwrap_or_else(|_| "Admin".to_string());
|
||||||
let osu_config_path = osu_folder_path
|
let osu_config_path = osu_folder_path
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.join(format!("osu!.{}.cfg", current_user));
|
.join(format!("osu!.{}.cfg", current_user));
|
||||||
|
println!("Looking for user config at: {:?}", osu_config_path);
|
||||||
if !osu_config_path.exists() {
|
if !osu_config_path.exists() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@@ -50,7 +51,9 @@ pub fn set_osu_user_config_vals(
|
|||||||
osu_folder_path: &str,
|
osu_folder_path: &str,
|
||||||
key_values: &[(&str, Option<&str>)],
|
key_values: &[(&str, Option<&str>)],
|
||||||
) -> Result<bool, String> {
|
) -> Result<bool, String> {
|
||||||
let current_user = std::env::var("USERNAME").unwrap_or_else(|_| "Admin".to_string());
|
let current_user = std::env::var("USERNAME")
|
||||||
|
.or_else(|_| std::env::var("USER"))
|
||||||
|
.unwrap_or_else(|_| "Admin".to_string());
|
||||||
let osu_config_path = Path::new(osu_folder_path).join(format!("osu!.{}.cfg", current_user));
|
let osu_config_path = Path::new(osu_folder_path).join(format!("osu!.{}.cfg", current_user));
|
||||||
|
|
||||||
if !osu_config_path.exists() {
|
if !osu_config_path.exists() {
|
||||||
@@ -73,7 +76,6 @@ pub fn set_osu_user_config_vals(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect indices and keys to update to avoid borrow checker issues
|
|
||||||
let mut updates = Vec::new();
|
let mut updates = Vec::new();
|
||||||
for (i, line) in lines.iter().enumerate() {
|
for (i, line) in lines.iter().enumerate() {
|
||||||
if let Some((existing_key, _)) = line.split_once(" = ") {
|
if let Some((existing_key, _)) = line.split_once(" = ") {
|
||||||
@@ -88,7 +90,6 @@ pub fn set_osu_user_config_vals(
|
|||||||
keys_to_add.remove(trimmed_key.as_str());
|
keys_to_add.remove(trimmed_key.as_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new keys that were not found
|
|
||||||
for key in keys_to_add {
|
for key in keys_to_add {
|
||||||
if let Some(value) = keys_to_set.get(key) {
|
if let Some(value) = keys_to_set.get(key) {
|
||||||
lines.push(format!("{} = {}", key, value));
|
lines.push(format!("{} = {}", key, value));
|
||||||
@@ -141,7 +142,6 @@ pub fn set_osu_config_vals(
|
|||||||
keys_to_add.remove(trimmed_key.as_str());
|
keys_to_add.remove(trimmed_key.as_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new keys that were not found
|
|
||||||
for key in keys_to_add {
|
for key in keys_to_add {
|
||||||
if let Some(value) = keys_to_set.get(key) {
|
if let Some(value) = keys_to_set.get(key) {
|
||||||
lines.push(format!("{} = {}", key, value));
|
lines.push(format!("{} = {}", key, value));
|
||||||
@@ -178,7 +178,74 @@ pub fn get_osu_config<P: AsRef<Path>>(
|
|||||||
return Some(config_map);
|
return Some(config_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
pub fn is_osuwinello_available() -> bool {
|
||||||
|
use std::process::Command;
|
||||||
|
Command::new("osu-wine")
|
||||||
|
.arg("--info")
|
||||||
|
.stdout(std::process::Stdio::null())
|
||||||
|
.stderr(std::process::Stdio::null())
|
||||||
|
.status()
|
||||||
|
.is_ok()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
pub fn is_osuwinello_available() -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
pub fn is_wmctrl_available() -> bool {
|
||||||
|
use std::process::Command;
|
||||||
|
Command::new("wmctrl")
|
||||||
|
.arg("-V")
|
||||||
|
.stdout(std::process::Stdio::null())
|
||||||
|
.stderr(std::process::Stdio::null())
|
||||||
|
.status()
|
||||||
|
.is_ok()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
pub fn is_wmctrl_available() -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
pub fn get_window_title_by_pid(target_pid: Pid) -> String {
|
||||||
|
use std::process::Command;
|
||||||
|
let find_title = || -> Option<String> {
|
||||||
|
let output = Command::new("wmctrl").arg("-lp").output().ok()?;
|
||||||
|
|
||||||
|
if !output.status.success() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
let output_str = String::from_utf8(output.stdout).ok()?;
|
||||||
|
|
||||||
|
for line in output_str.lines() {
|
||||||
|
let parts: Vec<&str> = line.split_whitespace().collect();
|
||||||
|
if parts.len() < 4 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Ok(pid) = parts[2].parse::<u32>() {
|
||||||
|
if pid == target_pid.as_u32() {
|
||||||
|
let title = parts[4..].join(" ");
|
||||||
|
return Some(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
|
find_title().unwrap_or_default()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
pub fn get_window_title_by_pid(pid: Pid) -> String {
|
pub fn get_window_title_by_pid(pid: Pid) -> String {
|
||||||
|
use std::ffi::OsString;
|
||||||
|
use std::os::windows::ffi::OsStringExt;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use winapi::shared::windef::HWND;
|
use winapi::shared::windef::HWND;
|
||||||
use winapi::um::winuser::{
|
use winapi::um::winuser::{
|
||||||
@@ -204,11 +271,11 @@ pub fn get_window_title_by_pid(pid: Pid) -> String {
|
|||||||
let title_str = title.to_string_lossy().into_owned();
|
let title_str = title.to_string_lossy().into_owned();
|
||||||
if !title_str.is_empty() {
|
if !title_str.is_empty() {
|
||||||
*result.lock().unwrap() = Some(title_str);
|
*result.lock().unwrap() = Some(title_str);
|
||||||
return 0; // Stop enumeration
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1 // Continue enumeration
|
1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,3 +289,107 @@ pub fn get_window_title_by_pid(pid: Pid) -> String {
|
|||||||
}
|
}
|
||||||
result.lock().unwrap().clone().unwrap_or_default()
|
result.lock().unwrap().clone().unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn is_net8_installed() -> bool {
|
||||||
|
use tokio::process::Command;
|
||||||
|
|
||||||
|
let mut command = Command::new("dotnet");
|
||||||
|
command.arg("--list-runtimes");
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
|
const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||||
|
command.creation_flags(CREATE_NO_WINDOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
let output_result = command.output().await;
|
||||||
|
match output_result {
|
||||||
|
Ok(output) => {
|
||||||
|
if !output.status.success() {
|
||||||
|
eprintln!(
|
||||||
|
"Error: `dotnet --list-runtimes` failed with status: {}",
|
||||||
|
output.status
|
||||||
|
);
|
||||||
|
eprintln!("stderr: {}", String::from_utf8_lossy(&output.stderr));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let stdout_str = String::from_utf8_lossy(&output.stdout);
|
||||||
|
stdout_str
|
||||||
|
.lines()
|
||||||
|
.any(|line| line.starts_with("Microsoft.WindowsDesktop.App 8."))
|
||||||
|
}
|
||||||
|
Err(_) => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
pub fn encrypt_password(password: &str, _entropy: &str) -> Result<String, String> {
|
||||||
|
Ok(password.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
pub fn encrypt_password(password: &str, entropy: &str) -> Result<String, String> {
|
||||||
|
use base64::{Engine as _, engine::general_purpose};
|
||||||
|
use std::ffi::OsStr;
|
||||||
|
use std::os::windows::ffi::OsStrExt;
|
||||||
|
use std::ptr;
|
||||||
|
use std::slice;
|
||||||
|
use winapi::shared::minwindef::{BYTE, DWORD, LPVOID};
|
||||||
|
use winapi::shared::ntdef::LPCWSTR;
|
||||||
|
use winapi::um::dpapi::{CRYPTPROTECT_UI_FORBIDDEN, CryptProtectData};
|
||||||
|
use winapi::um::winbase::LocalFree;
|
||||||
|
use winapi::um::wincrypt::DATA_BLOB;
|
||||||
|
|
||||||
|
let description = "Encrypted";
|
||||||
|
|
||||||
|
let password_bytes = password.as_bytes();
|
||||||
|
let mut input_blob = DATA_BLOB {
|
||||||
|
cbData: password_bytes.len() as DWORD,
|
||||||
|
pbData: password_bytes.as_ptr() as *mut BYTE,
|
||||||
|
};
|
||||||
|
|
||||||
|
let entropy_bytes = entropy.as_bytes();
|
||||||
|
let mut entropy_blob = DATA_BLOB {
|
||||||
|
cbData: entropy_bytes.len() as DWORD,
|
||||||
|
pbData: entropy_bytes.as_ptr() as *mut BYTE,
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut output_blob = DATA_BLOB {
|
||||||
|
cbData: 0,
|
||||||
|
pbData: ptr::null_mut(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let wide_description: Vec<u16> = OsStrExt::encode_wide(OsStr::new(description))
|
||||||
|
.chain(Some(0))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
let p_description: LPCWSTR = wide_description.as_ptr();
|
||||||
|
|
||||||
|
let result = unsafe {
|
||||||
|
CryptProtectData(
|
||||||
|
&mut input_blob,
|
||||||
|
p_description,
|
||||||
|
&mut entropy_blob,
|
||||||
|
ptr::null_mut(),
|
||||||
|
ptr::null_mut(),
|
||||||
|
CRYPTPROTECT_UI_FORBIDDEN,
|
||||||
|
&mut output_blob,
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
if result == 0 {
|
||||||
|
return Err("CryptProtectData failed".to_string());
|
||||||
|
}
|
||||||
|
|
||||||
|
let encrypted_data =
|
||||||
|
unsafe { slice::from_raw_parts(output_blob.pbData, output_blob.cbData as usize).to_vec() };
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
LocalFree(output_blob.pbData as LPVOID);
|
||||||
|
}
|
||||||
|
|
||||||
|
let base64_string = general_purpose::STANDARD.encode(&encrypted_data);
|
||||||
|
|
||||||
|
Ok(base64_string)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,33 +1,90 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "ezpplauncher",
|
"productName": "EZPPLauncher",
|
||||||
"version": "0.1.0",
|
"version": "3.2.5",
|
||||||
"identifier": "farm.ezpp.launcher.app",
|
"identifier": "farm.EZPPFarm.Launcher",
|
||||||
|
"mainBinaryName": "ezpplauncher",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "bun run dev",
|
"beforeDevCommand": "bun run vite:dev",
|
||||||
"devUrl": "http://localhost:1420",
|
"devUrl": "http://localhost:1420",
|
||||||
"beforeBuildCommand": "bun run build",
|
"beforeBuildCommand": "",
|
||||||
"frontendDist": "../build"
|
"frontendDist": "../build"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"title": "ezpplauncher",
|
"title": "EZPPLauncher",
|
||||||
"width": 1000,
|
"width": 1000,
|
||||||
"height": 700,
|
"height": 650,
|
||||||
|
"minWidth": 1000,
|
||||||
|
"minHeight": 650,
|
||||||
"decorations": false,
|
"decorations": false,
|
||||||
"resizable": false,
|
"resizable": false,
|
||||||
"maximizable": false
|
"maximizable": false,
|
||||||
|
"shadow": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"withGlobalTauri": true,
|
"withGlobalTauri": true,
|
||||||
"security": {
|
"security": {
|
||||||
"csp": null
|
"csp": {
|
||||||
|
"default-src": "'self' tauri: customprotocol: asset:",
|
||||||
|
"script-src": "'self' 'unsafe-inline' asset: http://asset.localhost https://asset.localhost https://analytics.ez-pp.farm",
|
||||||
|
"style-src": "'self' 'unsafe-inline' asset: http://asset.localhost https://asset.localhost",
|
||||||
|
"img-src": "'self' asset: http://asset.localhost https://asset.localhost blob: data: https://assets.ppy.sh https://a.ez-pp.farm https://git.ez-pp.farm https://osu.direct",
|
||||||
|
"connect-src": "'self' ipc: http://ipc.localhost https://ez-pp.farm https://api.ez-pp.farm https://c.ez-pp.farm https://analytics.ez-pp.farm https://git.ez-pp.farm https://osu.direct https://osu.ppy.sh",
|
||||||
|
"media-src": "'self' asset: http://asset.localhost https://asset.localhost blob:",
|
||||||
|
"font-src": [
|
||||||
|
"'self'",
|
||||||
|
"asset:",
|
||||||
|
"blob:",
|
||||||
|
"data:",
|
||||||
|
"http://asset.localhost",
|
||||||
|
"https://asset.localhost"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assetProtocol": {
|
||||||
|
"enable": true,
|
||||||
|
"scope": [
|
||||||
|
"$HOME/.ezpplauncher/themes/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
|
"publisher": "EZPPFarm",
|
||||||
|
"copyright": "EZPPFarm",
|
||||||
|
"shortDescription": "osu! launcher for EZPPFarm",
|
||||||
|
"longDescription": "EZPPLauncher is a custom osu! launcher for the EZPPFarm server, featuring automatic updates, ingame login, stat tracking and launcher theming.",
|
||||||
|
"homepage": "https://ez-pp.farm",
|
||||||
|
"license": "GPL-3.0",
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": "all",
|
"targets": [
|
||||||
|
"nsis",
|
||||||
|
"appimage"
|
||||||
|
],
|
||||||
|
"fileAssociations": [
|
||||||
|
{
|
||||||
|
"ext": [
|
||||||
|
"ezpplauncher-theme"
|
||||||
|
],
|
||||||
|
"name": "EZPPLauncher Theme",
|
||||||
|
"description": "EZPPLauncher Theme File",
|
||||||
|
"role": "Viewer",
|
||||||
|
"mimeType": "application/x-ezpplauncher-theme"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"windows": {
|
||||||
|
"webviewInstallMode": {
|
||||||
|
"silent": true,
|
||||||
|
"type": "downloadBootstrapper"
|
||||||
|
},
|
||||||
|
"nsis": {
|
||||||
|
"installMode": "currentUser",
|
||||||
|
"compression": "lzma",
|
||||||
|
"installerIcon": "icons/icon.ico",
|
||||||
|
"installerHooks": "./nsis/nsis-hooks.nsh"
|
||||||
|
}
|
||||||
|
},
|
||||||
"icon": [
|
"icon": [
|
||||||
"icons/32x32.png",
|
"icons/32x32.png",
|
||||||
"icons/128x128.png",
|
"icons/128x128.png",
|
||||||
|
|||||||
@@ -1,89 +1,168 @@
|
|||||||
@tailwind base;
|
@import "tailwindcss";
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
* {
|
@import "tw-animate-css";
|
||||||
-webkit-user-select: none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-o-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
-webkit-user-drag: none;
|
@custom-variant dark (&:where(.dark, .dark *));
|
||||||
-khtml-user-drag: none;
|
|
||||||
-moz-user-drag: none;
|
@import "@fontsource-variable/sora";
|
||||||
-o-user-drag: none;
|
@import "@fontsource/space-mono";
|
||||||
user-drag: none;
|
|
||||||
|
:root {
|
||||||
|
--radius: 0.625rem;
|
||||||
|
--background: oklch(95.36% 0.017 256.57);
|
||||||
|
--foreground: oklch(40.06% 0.038 266.38);
|
||||||
|
--card: oklch(100% 0 0);
|
||||||
|
--card-foreground: oklch(40.06% 0.038 266.38);
|
||||||
|
--popover: oklch(84.01% 0.028 258.47);
|
||||||
|
--popover-foreground: oklch(40.06% 0.038 266.38);
|
||||||
|
--primary: oklch(60.7% 0.226 299.68);
|
||||||
|
--primary-foreground: oklch(100% 0 0);
|
||||||
|
--secondary: oklch(84.01% 0.028 258.47);
|
||||||
|
--secondary-foreground: oklch(40.06% 0.038 266.38);
|
||||||
|
--muted: oklch(89.49% 0.023 256.59);
|
||||||
|
--muted-foreground: oklch(51.01% 0.028 265.36);
|
||||||
|
--accent: oklch(54.41% 0.186 230.5);
|
||||||
|
--accent-foreground: oklch(100% 0 0);
|
||||||
|
--destructive: oklch(51.68% 0.202 15.84);
|
||||||
|
--destructive-foreground: oklch(100% 0 0);
|
||||||
|
--border: oklch(78.52% 0.026 260.1);
|
||||||
|
--input: oklch(84.01% 0.028 258.47);
|
||||||
|
--ring: oklch(60.7% 0.226 299.68);
|
||||||
|
--chart-1: oklch(60.7% 0.226 299.68);
|
||||||
|
--chart-2: oklch(54.41% 0.186 230.5);
|
||||||
|
--chart-3: oklch(46.49% 0.139 139.66);
|
||||||
|
--chart-4: oklch(60.01% 0.202 55.86);
|
||||||
|
--chart-5: oklch(70.11% 0.125 39.15);
|
||||||
|
--sidebar: oklch(92.65% 0.019 256.57);
|
||||||
|
--sidebar-background: oklch(92.65% 0.019 256.57);
|
||||||
|
--sidebar-foreground: oklch(40.06% 0.038 266.38);
|
||||||
|
--sidebar-primary: oklch(60.7% 0.226 299.68);
|
||||||
|
--sidebar-primary-foreground: oklch(100% 0 0);
|
||||||
|
--sidebar-accent: oklch(54.41% 0.186 230.5);
|
||||||
|
--sidebar-accent-foreground: oklch(100% 0 0);
|
||||||
|
--sidebar-border: oklch(78.52% 0.026 260.1);
|
||||||
|
--sidebar-ring: oklch(60.7% 0.226 299.68);
|
||||||
|
|
||||||
|
--font-sans:
|
||||||
|
"Sora Variable", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||||
|
"Segoe UI Symbol", "Noto Color Emoji";
|
||||||
|
--font-mono:
|
||||||
|
"Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
||||||
|
"Courier New", monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
.dark {
|
||||||
:root {
|
--background: oklch(17.02% 0.042 282.86);
|
||||||
--background: 0 0% 100%;
|
--foreground: oklch(89.24% 0.079 263.24);
|
||||||
--foreground: 224 71.4% 4.1%;
|
--card: oklch(20.22% 0.048 282.86);
|
||||||
--muted: 220 14.3% 95.9%;
|
--card-foreground: oklch(89.24% 0.079 263.24);
|
||||||
--muted-foreground: 220 8.9% 46.1%;
|
--popover: oklch(20.3% 0.05 282.86);
|
||||||
--popover: 0 0% 100%;
|
--popover-foreground: oklch(89.24% 0.079 263.24);
|
||||||
--popover-foreground: 224 71.4% 4.1%;
|
--primary: oklch(72.08% 0.196 356.34);
|
||||||
--card: 0 0% 100%;
|
--primary-foreground: oklch(20.22% 0.048 282.86);
|
||||||
--card-foreground: 224 71.4% 4.1%;
|
--secondary: oklch(42.99% 0.031 270.49);
|
||||||
--border: 220 13% 91%;
|
--secondary-foreground: oklch(89.24% 0.079 263.24);
|
||||||
--input: 220 13% 91%;
|
--muted: oklch(24.41% 0.048 271.21);
|
||||||
--primary: 220.9 39.3% 11%;
|
--muted-foreground: oklch(73.83% 0.057 265.65);
|
||||||
--primary-foreground: 210 20% 98%;
|
--accent: oklch(86.2% 0.131 300.42);
|
||||||
--secondary: 220 14.3% 95.9%;
|
--accent-foreground: oklch(20.22% 0.048 282.86);
|
||||||
--secondary-foreground: 220.9 39.3% 11%;
|
--destructive: oklch(77.23% 0.146 11.66);
|
||||||
--accent: 220 14.3% 95.9%;
|
--destructive-foreground: oklch(20.22% 0.048 282.86);
|
||||||
--accent-foreground: 220.9 39.3% 11%;
|
--border: oklch(27.7% 0.041 276.87);
|
||||||
--destructive: 0 72.2% 50.6%;
|
--input: oklch(27.7% 0.041 276.87);
|
||||||
--destructive-foreground: 210 20% 98%;
|
--ring: oklch(72.08% 0.196 356.34);
|
||||||
--ring: 224 71.4% 4.1%;
|
--chart-1: oklch(72.08% 0.196 356.34);
|
||||||
--radius: 0.5rem;
|
--chart-2: oklch(77.19% 0.121 223.01);
|
||||||
--sidebar-background: 0 0% 98%;
|
--chart-3: oklch(79.1% 0.119 150.21);
|
||||||
--sidebar-foreground: 240 5.3% 26.1%;
|
--chart-4: oklch(79.74% 0.167 57.97);
|
||||||
--sidebar-primary: 240 5.9% 10%;
|
--chart-5: oklch(92.11% 0.061 37.8);
|
||||||
--sidebar-primary-foreground: 0 0% 98%;
|
--sidebar: oklch(13.29% 0.036 282.86);
|
||||||
--sidebar-accent: 240 4.8% 95.9%;
|
--sidebar-background: oklch(13.29% 0.036 282.86);
|
||||||
--sidebar-accent-foreground: 240 5.9% 10%;
|
--sidebar-foreground: oklch(89.24% 0.079 263.24);
|
||||||
--sidebar-border: 220 13% 91%;
|
--sidebar-primary: oklch(72.08% 0.196 356.34);
|
||||||
--sidebar-ring: 217.2 91.2% 59.8%;
|
--sidebar-primary-foreground: oklch(20.22% 0.048 282.86);
|
||||||
}
|
--sidebar-accent: oklch(75.21% 0.121 293.01);
|
||||||
|
--sidebar-accent-foreground: oklch(20.22% 0.048 282.86);
|
||||||
|
--sidebar-border: oklch(35.13% 0.03 273.31);
|
||||||
|
--sidebar-ring: oklch(72.08% 0.196 356.34);
|
||||||
|
}
|
||||||
|
|
||||||
.dark {
|
@theme inline {
|
||||||
--background: 224 71.4% 4.1%;
|
--radius-sm: calc(var(--radius) - 4px);
|
||||||
--foreground: 210 20% 98%;
|
--radius-md: calc(var(--radius) - 2px);
|
||||||
--muted: 215 27.9% 16.9%;
|
--radius-lg: var(--radius);
|
||||||
--muted-foreground: 217.9 10.6% 64.9%;
|
--radius-xl: calc(var(--radius) + 4px);
|
||||||
--popover: 224 71.4% 4.1%;
|
--color-background: var(--background);
|
||||||
--popover-foreground: 210 20% 98%;
|
--color-theme: #181825;
|
||||||
--card: 224 71.4% 4.1%;
|
--color-theme-50: #e9e9f1;
|
||||||
--card-foreground: 210 20% 98%;
|
--color-theme-100: #dbdbe8;
|
||||||
--border: 215 27.9% 16.9%;
|
--color-theme-200: #bfbfd6;
|
||||||
--input: 215 27.9% 16.9%;
|
--color-theme-300: #a4a4c4;
|
||||||
--primary: 210 20% 98%;
|
--color-theme-400: #8888b2;
|
||||||
--primary-foreground: 220.9 39.3% 11%;
|
--color-theme-500: #6c6ca0;
|
||||||
--secondary: 215 27.9% 16.9%;
|
--color-theme-600: #575786;
|
||||||
--secondary-foreground: 210 20% 98%;
|
--color-theme-700: #45456b;
|
||||||
--accent: 215 27.9% 16.9%;
|
--color-theme-800: #33334f;
|
||||||
--accent-foreground: 210 20% 98%;
|
--color-theme-900: #212133;
|
||||||
--destructive: 0 62.8% 30.6%;
|
--color-theme-950: #181825;
|
||||||
--destructive-foreground: 210 20% 98%;
|
--color-foreground: var(--foreground);
|
||||||
--ring: 216 12.2% 83.9%;
|
--color-card: var(--card);
|
||||||
--sidebar-background: 240 5.9% 10%;
|
--color-card-foreground: var(--card-foreground);
|
||||||
--sidebar-foreground: 240 4.8% 95.9%;
|
--color-popover: var(--popover);
|
||||||
--sidebar-primary: 224.3 76.3% 48%;
|
--color-popover-foreground: var(--popover-foreground);
|
||||||
--sidebar-primary-foreground: 0 0% 100%;
|
--color-primary: var(--primary);
|
||||||
--sidebar-accent: 240 3.7% 15.9%;
|
--color-primary-50: #ffe5f1;
|
||||||
--sidebar-accent-foreground: 240 4.8% 95.9%;
|
--color-primary-100: #ffcce2;
|
||||||
--sidebar-border: 240 3.7% 15.9%;
|
--color-primary-200: #ff99c5;
|
||||||
--sidebar-ring: 217.2 91.2% 59.8%;
|
--color-primary-300: #ff66a8;
|
||||||
}
|
--color-primary-400: #ff338b;
|
||||||
|
--color-primary-500: #ff006e;
|
||||||
|
--color-primary-600: #cc0058;
|
||||||
|
--color-primary-700: #990042;
|
||||||
|
--color-primary-800: #66002c;
|
||||||
|
--color-primary-900: #330016;
|
||||||
|
--color-primary-950: #24000f;
|
||||||
|
--color-primary-foreground: var(--primary-foreground);
|
||||||
|
--color-secondary: var(--secondary);
|
||||||
|
--color-secondary-foreground: var(--secondary-foreground);
|
||||||
|
--color-muted: var(--muted);
|
||||||
|
--color-muted-foreground: var(--muted-foreground);
|
||||||
|
--color-accent: var(--accent);
|
||||||
|
--color-accent-foreground: var(--accent-foreground);
|
||||||
|
--color-destructive: var(--destructive);
|
||||||
|
--color-border: var(--border);
|
||||||
|
--color-input: var(--input);
|
||||||
|
--color-ring: var(--ring);
|
||||||
|
--color-chart-1: var(--chart-1);
|
||||||
|
--color-chart-2: var(--chart-2);
|
||||||
|
--color-chart-3: var(--chart-3);
|
||||||
|
--color-chart-4: var(--chart-4);
|
||||||
|
--color-chart-5: var(--chart-5);
|
||||||
|
--color-sidebar: var(--sidebar);
|
||||||
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||||
|
--color-sidebar-primary: var(--sidebar-primary);
|
||||||
|
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||||
|
--color-sidebar-accent: var(--sidebar-accent);
|
||||||
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||||
|
--color-sidebar-border: var(--sidebar-border);
|
||||||
|
--color-sidebar-ring: var(--sidebar-ring);
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
* {
|
* {
|
||||||
@apply border-border;
|
@apply border-border outline-ring/50;
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
@apply bg-background text-foreground;
|
@apply bg-background text-foreground;
|
||||||
}
|
}
|
||||||
|
button:not([disabled]),
|
||||||
|
[role="button"]:not([disabled]) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" class="dark">
|
<html lang="en" class="dark">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>EZPPLauncher</title>
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
|
||||||
<head>
|
<body class="bg-theme-950" data-sveltekit-preload-data="hover">
|
||||||
<meta charset="utf-8" />
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
</body>
|
||||||
<title>EZPPLauncher</title>
|
</html>
|
||||||
%sveltekit.head%
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="bg-theme-950" data-sveltekit-preload-data="hover">
|
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.2 MiB |
|
After Width: | Height: | Size: 173 KiB |
@@ -1,6 +1,13 @@
|
|||||||
import type { EZPPUser, EZPPUserInfoResponse, EZPPUserResponse } from '@/types';
|
import type {
|
||||||
|
EZPPUser,
|
||||||
|
EZPPUserInfoResponse,
|
||||||
|
EZPPUserResponse,
|
||||||
|
EZPPUSerStatusResponse,
|
||||||
|
StreamsResult,
|
||||||
|
} from '$lib/types';
|
||||||
import { betterFetch } from '@better-fetch/fetch';
|
import { betterFetch } from '@better-fetch/fetch';
|
||||||
|
|
||||||
|
const VERSION_ENDPOINT = 'https://version.ez-pp.farm/';
|
||||||
const BANCHO_ENDPOINT = 'https://c.ez-pp.farm/';
|
const BANCHO_ENDPOINT = 'https://c.ez-pp.farm/';
|
||||||
const API_ENDPOINT = 'https://api.ez-pp.farm/';
|
const API_ENDPOINT = 'https://api.ez-pp.farm/';
|
||||||
const ENDPOINT = 'https://ez-pp.farm/';
|
const ENDPOINT = 'https://ez-pp.farm/';
|
||||||
@@ -54,12 +61,12 @@ export const ezppfarm = {
|
|||||||
}
|
}
|
||||||
return request.data;
|
return request.data;
|
||||||
},
|
},
|
||||||
getUserInfo: async (userId: number) => {
|
getUserInfo: async (userId: number, scope: 'all' | 'info' | 'stats' = 'all') => {
|
||||||
const request = await betterFetch<EZPPUserInfoResponse>(`${API_ENDPOINT}v1/get_player_info`, {
|
const request = await betterFetch<EZPPUserInfoResponse>(`${API_ENDPOINT}v1/get_player_info`, {
|
||||||
timeout,
|
timeout,
|
||||||
query: {
|
query: {
|
||||||
id: userId,
|
id: userId,
|
||||||
scope: 'all',
|
scope,
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -68,4 +75,47 @@ export const ezppfarm = {
|
|||||||
});
|
});
|
||||||
return request.error ? undefined : request.data;
|
return request.error ? undefined : request.data;
|
||||||
},
|
},
|
||||||
|
getUserStatus: async (userId: number) => {
|
||||||
|
const request = await betterFetch<EZPPUSerStatusResponse>(
|
||||||
|
`${API_ENDPOINT}v1/get_player_status`,
|
||||||
|
{
|
||||||
|
timeout,
|
||||||
|
query: {
|
||||||
|
id: userId,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': 'EZPPLauncher',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return request.error ? undefined : request.data;
|
||||||
|
},
|
||||||
|
latestBuildVersion: async (releaseStream: string): Promise<string | undefined> => {
|
||||||
|
const request = await betterFetch<StreamsResult>(`${VERSION_ENDPOINT}api/changelog`, {
|
||||||
|
timeout,
|
||||||
|
query: {
|
||||||
|
stream: 'none',
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': 'EZPPLauncher',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (request.error) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const releaseData = request.data;
|
||||||
|
if (!releaseData || !releaseData.streams) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (releaseData.streams.length === 0) return undefined;
|
||||||
|
const selectedRelease = releaseData.streams.find(
|
||||||
|
(releaseBuild) =>
|
||||||
|
releaseBuild.name.toLowerCase() === releaseStream.replaceAll(' ', '').toLowerCase()
|
||||||
|
);
|
||||||
|
if (!selectedRelease) return undefined;
|
||||||
|
return selectedRelease.latest_build.display_version;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import type { Release } from '$lib/types';
|
||||||
|
import { betterFetch } from '@better-fetch/fetch';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
|
const ENDPOINT = 'https://git.ez-pp.farm/';
|
||||||
|
|
||||||
|
const timeout = 5000; // 5 seconds;
|
||||||
|
|
||||||
|
export const git = {
|
||||||
|
hasUpdate: async (version: string): Promise<Release | undefined> => {
|
||||||
|
try {
|
||||||
|
const request = await betterFetch<Release[]>(
|
||||||
|
`${ENDPOINT}api/v1/repos/EZPPFarm/EZPPLauncher/releases?limit=1`,
|
||||||
|
{
|
||||||
|
timeout,
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'EZPPLauncher',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (request.error) return undefined;
|
||||||
|
|
||||||
|
const latestRelease = request.data[0];
|
||||||
|
if (!latestRelease) return undefined;
|
||||||
|
|
||||||
|
const hasUpdate = semver.lt(version, latestRelease.tag_name);
|
||||||
|
|
||||||
|
return hasUpdate ? latestRelease : undefined;
|
||||||
|
} catch {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import type { StreamsResult } from '@/types';
|
|
||||||
import { betterFetch } from '@better-fetch/fetch';
|
|
||||||
|
|
||||||
const API_ENDPOINT = 'https://osu.ppy.sh/api/';
|
|
||||||
|
|
||||||
const timeout = 5000; // 5 seconds;
|
|
||||||
|
|
||||||
export const osuapi = {
|
|
||||||
latestBuildVersion: async (releaseStream: string): Promise<string | undefined> => {
|
|
||||||
const request = await betterFetch<StreamsResult>(`${API_ENDPOINT}v2/changelog`, {
|
|
||||||
timeout,
|
|
||||||
query: {
|
|
||||||
stream: 'none',
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'User-Agent': 'EZPPLauncher',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (request.error) {
|
|
||||||
if (request.error.status >= 500 && request.error.status < 600)
|
|
||||||
throw new Error('Server not reachable');
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const releaseData = request.data;
|
|
||||||
const selectedRelease = releaseData.streams.find(
|
|
||||||
(releaseBuild) =>
|
|
||||||
releaseBuild.name.toLowerCase() === releaseStream.replaceAll(' ', '').toLowerCase()
|
|
||||||
);
|
|
||||||
if (!selectedRelease) return undefined;
|
|
||||||
return selectedRelease.latest_build.display_version;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
const API_ENDPOINT = "https://osu.direct/api/";
|
const API_ENDPOINT = 'https://osu.direct/api/';
|
||||||
|
|
||||||
export const osudirect = {
|
export const osudirect = {
|
||||||
osu: async (mapId: number): Promise<string | undefined> => {
|
osu: async (mapId: number): Promise<string | undefined> => {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
import { buttonVariants } from '$lib/components/ui/button/index.js';
|
||||||
import { buttonVariants } from "$lib/components/ui/button/index.js";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AlertDialogPrimitive.ActionProps = $props();
|
}: AlertDialogPrimitive.ActionProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AlertDialogPrimitive.Action bind:ref class={cn(buttonVariants(), className)} {...restProps} />
|
<AlertDialogPrimitive.Action bind:ref class={cn(buttonVariants(), className)} {...restProps} />
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
import { buttonVariants } from '$lib/components/ui/button/index.js';
|
||||||
import { buttonVariants } from "$lib/components/ui/button/index.js";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AlertDialogPrimitive.CancelProps = $props();
|
}: AlertDialogPrimitive.CancelProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AlertDialogPrimitive.Cancel
|
<AlertDialogPrimitive.Cancel
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
|
class={cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AlertDialog as AlertDialogPrimitive, type WithoutChild } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import AlertDialogOverlay from "./alert-dialog-overlay.svelte";
|
import AlertDialogOverlay from './alert-dialog-overlay.svelte';
|
||||||
import { cn } from "$lib/utils.js";
|
import { AlertDialog as AlertDialogPrimitive, type WithoutChild } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
portalProps,
|
portalProps,
|
||||||
...restProps
|
...restProps
|
||||||
}: WithoutChild<AlertDialogPrimitive.ContentProps> & {
|
}: WithoutChild<AlertDialogPrimitive.ContentProps> & {
|
||||||
portalProps?: AlertDialogPrimitive.PortalProps;
|
portalProps?: AlertDialogPrimitive.PortalProps;
|
||||||
} = $props();
|
} = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AlertDialogPrimitive.Portal {...portalProps}>
|
<AlertDialogPrimitive.Portal {...portalProps}>
|
||||||
<AlertDialogOverlay />
|
<AlertDialogOverlay />
|
||||||
<AlertDialogPrimitive.Content
|
<AlertDialogPrimitive.Content
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn(
|
class={cn(
|
||||||
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",
|
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
</AlertDialogPrimitive.Portal>
|
</AlertDialogPrimitive.Portal>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AlertDialogPrimitive.DescriptionProps = $props();
|
}: AlertDialogPrimitive.DescriptionProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AlertDialogPrimitive.Description
|
<AlertDialogPrimitive.Description
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn("text-muted-foreground text-sm", className)}
|
class={cn('text-muted-foreground text-sm', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { WithElementRef } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import type { HTMLAttributes } from "svelte/elements";
|
import type { WithElementRef } from 'bits-ui';
|
||||||
import { cn } from "$lib/utils.js";
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
children,
|
children,
|
||||||
...restProps
|
...restProps
|
||||||
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
bind:this={ref}
|
bind:this={ref}
|
||||||
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
|
class={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
>
|
>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { WithElementRef } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import type { HTMLAttributes } from "svelte/elements";
|
import type { WithElementRef } from 'bits-ui';
|
||||||
import { cn } from "$lib/utils.js";
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
children,
|
children,
|
||||||
...restProps
|
...restProps
|
||||||
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
bind:this={ref}
|
bind:this={ref}
|
||||||
class={cn("flex flex-col space-y-2 text-center sm:text-left", className)}
|
class={cn('flex flex-col space-y-2 text-center sm:text-left', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
>
|
>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AlertDialogPrimitive.OverlayProps = $props();
|
}: AlertDialogPrimitive.OverlayProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AlertDialogPrimitive.Overlay
|
<AlertDialogPrimitive.Overlay
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn(
|
class={cn(
|
||||||
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",
|
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
level = 3,
|
level = 3,
|
||||||
...restProps
|
...restProps
|
||||||
}: AlertDialogPrimitive.TitleProps = $props();
|
}: AlertDialogPrimitive.TitleProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AlertDialogPrimitive.Title
|
<AlertDialogPrimitive.Title
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn("text-lg font-semibold", className)}
|
class={cn('text-lg font-semibold', className)}
|
||||||
{level}
|
{level}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,39 +1,39 @@
|
|||||||
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
import Action from './alert-dialog-action.svelte';
|
||||||
import Title from "./alert-dialog-title.svelte";
|
import Cancel from './alert-dialog-cancel.svelte';
|
||||||
import Action from "./alert-dialog-action.svelte";
|
import Content from './alert-dialog-content.svelte';
|
||||||
import Cancel from "./alert-dialog-cancel.svelte";
|
import Description from './alert-dialog-description.svelte';
|
||||||
import Footer from "./alert-dialog-footer.svelte";
|
import Footer from './alert-dialog-footer.svelte';
|
||||||
import Header from "./alert-dialog-header.svelte";
|
import Header from './alert-dialog-header.svelte';
|
||||||
import Overlay from "./alert-dialog-overlay.svelte";
|
import Overlay from './alert-dialog-overlay.svelte';
|
||||||
import Content from "./alert-dialog-content.svelte";
|
import Title from './alert-dialog-title.svelte';
|
||||||
import Description from "./alert-dialog-description.svelte";
|
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
const Root = AlertDialogPrimitive.Root;
|
const Root = AlertDialogPrimitive.Root;
|
||||||
const Trigger = AlertDialogPrimitive.Trigger;
|
const Trigger = AlertDialogPrimitive.Trigger;
|
||||||
const Portal = AlertDialogPrimitive.Portal;
|
const Portal = AlertDialogPrimitive.Portal;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Title,
|
Title,
|
||||||
Action,
|
Action,
|
||||||
Cancel,
|
Cancel,
|
||||||
Portal,
|
Portal,
|
||||||
Footer,
|
Footer,
|
||||||
Header,
|
Header,
|
||||||
Trigger,
|
Trigger,
|
||||||
Overlay,
|
Overlay,
|
||||||
Content,
|
Content,
|
||||||
Description,
|
Description,
|
||||||
//
|
//
|
||||||
Root as AlertDialog,
|
Root as AlertDialog,
|
||||||
Title as AlertDialogTitle,
|
Title as AlertDialogTitle,
|
||||||
Action as AlertDialogAction,
|
Action as AlertDialogAction,
|
||||||
Cancel as AlertDialogCancel,
|
Cancel as AlertDialogCancel,
|
||||||
Portal as AlertDialogPortal,
|
Portal as AlertDialogPortal,
|
||||||
Footer as AlertDialogFooter,
|
Footer as AlertDialogFooter,
|
||||||
Header as AlertDialogHeader,
|
Header as AlertDialogHeader,
|
||||||
Trigger as AlertDialogTrigger,
|
Trigger as AlertDialogTrigger,
|
||||||
Overlay as AlertDialogOverlay,
|
Overlay as AlertDialogOverlay,
|
||||||
Content as AlertDialogContent,
|
Content as AlertDialogContent,
|
||||||
Description as AlertDialogDescription,
|
Description as AlertDialogDescription,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { reduceAnimations } from '$lib/userSettings';
|
||||||
|
|
||||||
|
//TODO: maybe dynamic background images fetched from ezpp?
|
||||||
|
|
||||||
|
const COUNT = 60;
|
||||||
|
|
||||||
|
function rand(min: number, max: number) {
|
||||||
|
return Math.random() * (max - min) + min;
|
||||||
|
}
|
||||||
|
|
||||||
|
const streaks = Array.from({ length: COUNT })
|
||||||
|
.map((_, i) => {
|
||||||
|
const depth = rand(0, 2);
|
||||||
|
|
||||||
|
const scale = 0.6 + depth * 0.8;
|
||||||
|
const speed = 0.4 + depth * 1.35;
|
||||||
|
|
||||||
|
const distance = 150;
|
||||||
|
const duration = distance / speed;
|
||||||
|
|
||||||
|
return {
|
||||||
|
width: rand(300, 320) * scale,
|
||||||
|
height: 32 * scale,
|
||||||
|
x: (i / COUNT) * 200 - 50,
|
||||||
|
y: ((i * 137.5) % 100) - 20,
|
||||||
|
opacity: 0.25 + depth * 0.65,
|
||||||
|
duration,
|
||||||
|
delay: rand(0, duration),
|
||||||
|
scale,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => a.scale - b.scale);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="absolute bg blur-[2px]">
|
||||||
|
<div
|
||||||
|
class="relative h-full w-full from-0% to-90% bg-gradient-to-b from-transparent to-black z-50"
|
||||||
|
></div>
|
||||||
|
{#each streaks as s, index (index)}
|
||||||
|
<div
|
||||||
|
class="streak drop-shadow-lg transition-opacity duration-1000"
|
||||||
|
style="
|
||||||
|
width:{s.width}px;
|
||||||
|
height:{s.height}px;
|
||||||
|
left:{s.x}%;
|
||||||
|
top:{s.y}%;
|
||||||
|
opacity:{$reduceAnimations ? 0 : s.opacity};
|
||||||
|
animation-duration:{s.duration}s;
|
||||||
|
animation-delay:-{s.delay}s;
|
||||||
|
"
|
||||||
|
></div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.bg {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
background: linear-gradient(
|
||||||
|
180deg,
|
||||||
|
var(--color-primary-300) 0%,
|
||||||
|
var(--color-primary-600) 40%,
|
||||||
|
var(--color-primary-900) 100%
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.streak {
|
||||||
|
position: absolute;
|
||||||
|
background: #d6f3ff;
|
||||||
|
border-radius: 999px;
|
||||||
|
transform: rotate(-35deg);
|
||||||
|
animation: move linear infinite;
|
||||||
|
will-change: transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes move {
|
||||||
|
from {
|
||||||
|
transform: translate(-150vw, 150vh) rotate(-35deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: translate(150vw, -150vh) rotate(-35deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Avatar as AvatarPrimitive } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { Avatar as AvatarPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AvatarPrimitive.FallbackProps = $props();
|
}: AvatarPrimitive.FallbackProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AvatarPrimitive.Fallback
|
<AvatarPrimitive.Fallback
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn("bg-muted flex h-full w-full items-center justify-center rounded-full", className)}
|
class={cn('bg-muted flex h-full w-full items-center justify-center rounded-full', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Avatar as AvatarPrimitive } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { Avatar as AvatarPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AvatarPrimitive.ImageProps = $props();
|
}: AvatarPrimitive.ImageProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AvatarPrimitive.Image
|
<AvatarPrimitive.Image
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn("aspect-square h-full w-full", className)}
|
class={cn('aspect-square h-full w-full', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Avatar as AvatarPrimitive } from "bits-ui";
|
import { cn } from '$lib/utils.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { Avatar as AvatarPrimitive } from 'bits-ui';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
ref = $bindable(null),
|
ref = $bindable(null),
|
||||||
class: className,
|
class: className,
|
||||||
...restProps
|
...restProps
|
||||||
}: AvatarPrimitive.RootProps = $props();
|
}: AvatarPrimitive.RootProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AvatarPrimitive.Root
|
<AvatarPrimitive.Root
|
||||||
bind:ref
|
bind:ref
|
||||||
class={cn("relative flex size-10 shrink-0 overflow-hidden rounded-full", className)}
|
class={cn('relative flex size-10 shrink-0 overflow-hidden rounded-full', className)}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|||||||