Skip to content

Commit a831dcd

Browse files
committed
remove discord-rpc stuff in favor of client mod
1 parent b5ce9fd commit a831dcd

File tree

8 files changed

+8
-70
lines changed

8 files changed

+8
-70
lines changed

src-tauri/Cargo.lock

Lines changed: 6 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ chardet = "0.2.4"
2222
chardetng = "0.1.17"
2323
encoding_rs = "0.8.34"
2424
dirs-next = "2.0.0"
25-
discord-rich-presence = "0.2.4"
2625
regex = "1.10.5"
2726
runas = "1.2.0"
2827
sysinfo = "0.30.13"

src-tauri/src/commands.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ pub async fn inject(
1414
dll: &str,
1515
omp_file: &str,
1616
password: &str,
17-
discord: bool,
1817
) -> std::result::Result<(), String> {
19-
match injector::run_samp(name, ip, port, exe, dll, omp_file, password, discord).await {
18+
match injector::run_samp(name, ip, port, exe, dll, omp_file, password).await {
2019
Ok(_) => Ok(()),
2120
Err(e) => {
2221
log::warn!("{}", e);

src-tauri/src/injector.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub async fn run_samp(
1717
_dll_path: &str,
1818
_omp_file: &str,
1919
_password: &str,
20-
_discord: bool,
2120
) -> Result<()> {
2221
Ok(())
2322
}
@@ -31,7 +30,6 @@ pub async fn run_samp(
3130
dll_path: &str,
3231
omp_file: &str,
3332
password: &str,
34-
discord: bool,
3533
) -> Result<()> {
3634
// Prepare the command to spawn the executable
3735
let mut cmd = Command::new(format!("{}/{}", executable_dir, GTA_SA_EXECUTABLE));
@@ -49,10 +47,6 @@ pub async fn run_samp(
4947
ready_for_exec = ready_for_exec.arg("-z").arg(password);
5048
}
5149

52-
if discord {
53-
ready_for_exec = ready_for_exec.arg("--discord");
54-
}
55-
5650
let process = ready_for_exec.current_dir(executable_dir).spawn();
5751

5852
match process {

src-tauri/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ async fn handle_cli_args() -> Result<()> {
125125
&format!("{}/{}", gamepath, SAMP_DLL),
126126
&omp_client_path,
127127
&password,
128-
true,
129128
)
130129
.await
131130
.map_err(|e| LauncherError::InternalError(e.to_string()))?;

src/containers/Settings/Tab/Advanced.tsx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { t } from "i18next";
2-
import { Pressable, StyleSheet, TouchableOpacity, View } from "react-native";
3-
import CheckBox from "../../../components/CheckBox";
2+
import { StyleSheet, TouchableOpacity, View } from "react-native";
43
import Text from "../../../components/Text";
5-
import { useGenericPersistentState } from "../../../states/genericStates";
64
import { useTheme } from "../../../states/theme";
75
import {
86
exportFavoriteListFile,
@@ -12,8 +10,6 @@ import { sc } from "../../../utils/sizeScaler";
1210

1311
const Advanced = () => {
1412
const { theme } = useTheme();
15-
const { shouldUpdateDiscordStatus, toggleDiscordStatus } =
16-
useGenericPersistentState();
1713
return (
1814
<View
1915
style={{
@@ -31,25 +27,6 @@ const Advanced = () => {
3127
marginTop: sc(10),
3228
}}
3329
>
34-
<Pressable
35-
style={{
36-
flexDirection: "row",
37-
alignItems: "center",
38-
}}
39-
onPress={async () => {
40-
toggleDiscordStatus(!shouldUpdateDiscordStatus);
41-
}}
42-
>
43-
<CheckBox
44-
value={shouldUpdateDiscordStatus}
45-
style={{ marginRight: sc(7) }}
46-
/>
47-
<Text semibold color={theme.textPrimary} size={2}>
48-
{`${t("settings_advanced_discord_status")} ${t(
49-
"settings_advanced_discord_status_requires_restart"
50-
)}`}
51-
</Text>
52-
</Pressable>
5330
<TouchableOpacity
5431
style={[
5532
styles.importButton,

src/states/genericStates.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,17 @@ const useGenericTempState = create<GenericTempStates>()((set, get) => ({
4141
interface GenericPersistentStates {
4242
sideLists: boolean;
4343
language: LanguageType;
44-
shouldUpdateDiscordStatus: boolean;
4544
showSideLists: (show: boolean) => void;
4645
setLanguage: (lang: LanguageType) => void;
47-
toggleDiscordStatus: (toggle: boolean) => void;
4846
}
4947

5048
const useGenericPersistentState = create<GenericPersistentStates>()(
5149
persist(
5250
(set) => ({
5351
sideLists: true,
5452
language: "en",
55-
shouldUpdateDiscordStatus: true,
5653
showSideLists: (show: boolean) => set(() => ({ sideLists: show })),
5754
setLanguage: (lang) => set(() => ({ language: lang })),
58-
toggleDiscordStatus: (toggle) =>
59-
set(() => ({ shouldUpdateDiscordStatus: toggle })),
6055
}),
6156
{
6257
name: "generic-state-storage",

src/utils/game.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
ResourceInfo,
99
validFileChecksums,
1010
} from "../constants/app";
11-
import { useGenericPersistentState } from "../states/genericStates";
1211
import { useJoinServerPrompt } from "../states/joinServerPrompt";
1312
import { useMessageBox } from "../states/messageModal";
1413
import { useNotification } from "../states/notification";
@@ -72,7 +71,6 @@ export const startGame = async (
7271
const { sampVersion } = useSettings.getState();
7372
const { showPrompt, setServer } = useJoinServerPrompt.getState();
7473
const { setSelected } = useServers.getState();
75-
const { shouldUpdateDiscordStatus } = useGenericPersistentState.getState();
7674

7775
if (IN_GAME) {
7876
invoke("send_message_to_game", {
@@ -218,7 +216,6 @@ export const startGame = async (
218216
dll: ourSAMPDllPath,
219217
ompFile: await getLocalPath("omp", "omp-client.dll"),
220218
password,
221-
discord: shouldUpdateDiscordStatus,
222219
})
223220
.then(() => {
224221
addToRecentlyJoined(server);

0 commit comments

Comments
 (0)