Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

Commit 0e3ed3d

Browse files
Add files via upload
1 parent 04beafb commit 0e3ed3d

4 files changed

Lines changed: 41 additions & 9 deletions

File tree

C#/App5.png

893 KB
Loading

C#/MainWindow.xaml.cs

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial class MainWindow : Window
3131

3232
int MajorV = 1;
3333
int MinorV = 0;
34-
int PatchV = 0;
34+
int PatchV = 1;
3535
Boolean Preview = false;
3636

3737
String IP = "";
@@ -84,12 +84,28 @@ public void Backup(object sender, RoutedEventArgs e)
8484
{
8585
if(running)
8686
{
87+
running = false;
8788
return;
8889
}
8990
running = true;
9091

92+
//Check Quest IP
93+
Boolean good = CheckIP();
94+
if (!good)
95+
{
96+
txtbox.AppendText("\n\nChoose a valid IP!");
97+
running = false;
98+
return;
99+
}
100+
91101
//Create all Backup Folders
92-
BackupFSet();
102+
Boolean good2 = BackupFSet();
103+
if (!good2)
104+
{
105+
txtbox.AppendText("\n\nThis Backup already exists!");
106+
running = false;
107+
return;
108+
}
93109

94110
//Scores
95111
txtbox.AppendText("\n\nBacking up scores");
@@ -143,6 +159,7 @@ public void Restore(object sender, RoutedEventArgs e)
143159
if (Backups.SelectedIndex == 0)
144160
{
145161
txtbox.AppendText("\n\nSelect a valid Backup!");
162+
running = false;
146163
return;
147164
}
148165

@@ -154,6 +171,7 @@ public void Restore(object sender, RoutedEventArgs e)
154171
if(!good)
155172
{
156173
txtbox.AppendText("\n\nChoose a valid IP!");
174+
running = false;
157175
return;
158176
}
159177

@@ -224,12 +242,13 @@ public Boolean CheckIP()
224242
{
225243
return false;
226244
}
227-
IP.Replace(":50000", "");
228-
IP.Replace(":5000", "");
229-
IP.Replace(":500", "");
230-
IP.Replace(":500", "");
231-
IP.Replace(":50", "");
232-
IP.Replace(":5", "");
245+
IP = IP.Replace("50000", "");
246+
IP = IP.Replace("5000", "");
247+
IP = IP.Replace("500", "");
248+
IP = IP.Replace("500", "");
249+
IP = IP.Replace(":50", "");
250+
IP = IP.Replace(":5", "");
251+
233252
int count = 0;
234253
for(int i = 0; i < IP.Length; i++)
235254
{
@@ -240,8 +259,14 @@ public Boolean CheckIP()
240259
}
241260
if(count != 3)
242261
{
262+
Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate {
263+
Quest.Text = IP;
264+
}));
243265
return false;
244266
}
267+
Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate {
268+
Quest.Text = IP;
269+
}));
245270
return true;
246271
}
247272

@@ -784,7 +809,7 @@ public String Strings(String line, int StartIndex)
784809
return Name;
785810
}
786811

787-
public void BackupFSet()
812+
public Boolean BackupFSet()
788813
{
789814
BName.Text = BName.Text.Replace("/", "");
790815
BName.Text = BName.Text.Replace(":", "");
@@ -804,6 +829,12 @@ public void BackupFSet()
804829
}
805830

806831
BackupF = exe + "\\Backups\\" + BName.Text;
832+
833+
if(Directory.Exists(BackupF))
834+
{
835+
return false;
836+
}
837+
807838
Songs = BackupF + "\\Songs";
808839
Mods = BackupF + "\\Mods";
809840
Scores = BackupF + "\\Scores";
@@ -825,6 +856,7 @@ public void BackupFSet()
825856
{
826857
Directory.CreateDirectory(Playlists);
827858
}
859+
return true;
828860
}
829861

830862
public void getBackups()
0 Bytes
Binary file not shown.
2 KB
Binary file not shown.

0 commit comments

Comments
 (0)