@@ -63,7 +63,7 @@ public partial class MainForm : Form
63
63
private bool manualIP ;
64
64
public MainForm ( )
65
65
{
66
- // check for offline mode
66
+ // Check for Offline Mode or No RCLONE Updating
67
67
string [ ] args = Environment . GetCommandLineArgs ( ) ;
68
68
foreach ( string arg in args )
69
69
{
@@ -111,7 +111,7 @@ public MainForm()
111
111
Properties . Settings . Default . SubmittedUpdates = String . Empty ;
112
112
Properties . Settings . Default . Save ( ) ;
113
113
}
114
- //Time for debuglog
114
+ // Launch time used within debuglog.
115
115
string launchtime = DateTime . Now . ToString ( "hh:mmtt(UTC)" ) ;
116
116
_ = Logger . Log ( $ "\n ------\n ------\n Program Launched at: { launchtime } \n ------\n ------") ;
117
117
if ( string . IsNullOrEmpty ( Properties . Settings . Default . CurrentLogPath ) )
@@ -1003,7 +1003,7 @@ private async void getApkButton_Click(object sender, EventArgs e)
1003
1003
string gameName = $ "{ GameName } v{ VersionInt } { packageName } { HWID . Substring ( 0 , 1 ) } ";
1004
1004
string gameZipName = $ "{ gameName } .zip";
1005
1005
1006
- // delete the zip and txt if they exist from a previously failed upload
1006
+ // Delete both zip & txt if the files exist, most likely due to a failed upload.
1007
1007
if ( File . Exists ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") )
1008
1008
{
1009
1009
File . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") ;
@@ -1078,15 +1078,15 @@ private async void getApkButton_Click(object sender, EventArgs e)
1078
1078
string currentlyUploading = GameName ;
1079
1079
changeTitle ( "Uploading to server, you can continue to use Rookie while it uploads in the background." ) ;
1080
1080
1081
- // get size of pending zip upload and write to text file
1081
+ // Get size of pending zip upload and write to text file
1082
1082
long zipSize = new FileInfo ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") . Length ;
1083
1083
File . WriteAllText ( $ "{ Properties . Settings . Default . MainDir } \\ { gameName } .txt", zipSize . ToString ( ) ) ;
1084
- // upload size file
1084
+ // Upload size file.
1085
1085
_ = RCLONE . runRcloneCommand_UploadConfig ( $ "copy \" { Properties . Settings . Default . MainDir } \\ { gameName } .txt\" RSL-gameuploads:") ;
1086
- // upload zip
1086
+ // Upload zip.
1087
1087
_ = RCLONE . runRcloneCommand_UploadConfig ( $ "copy \" { Properties . Settings . Default . MainDir } \\ { gameZipName } \" RSL-gameuploads:") ;
1088
1088
1089
- // deleting uploaded files
1089
+ // Delete files once uploaded.
1090
1090
File . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { gameName } .txt") ;
1091
1091
File . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") ;
1092
1092
@@ -1272,7 +1272,7 @@ private async void Form1_DragDrop(object sender, DragEventArgs e)
1272
1272
CurrAPK = file2 ;
1273
1273
System . Windows . Forms . Timer t3 = new System . Windows . Forms . Timer
1274
1274
{
1275
- Interval = 150000 // 180 seconds to fail
1275
+ Interval = 150000 // 150 seconds to fail
1276
1276
} ;
1277
1277
t3 . Tick += timer_Tick4 ;
1278
1278
t3 . Start ( ) ;
@@ -1621,8 +1621,8 @@ private async void initListView()
1621
1621
List < string > blacklistItems = blacklist . ToList ( ) ;
1622
1622
List < string > whitelistItems = whitelist . ToList ( ) ;
1623
1623
errorOnList = false ;
1624
- //This is for black list, but temporarly will be whitelist
1625
- //this list has games that we are actually going to upload
1624
+ //This is for the black list, but temporarily will be the whitelist
1625
+ //This list contains games that we are actually going to upload
1626
1626
newGamesToUploadList = whitelistItems . Intersect ( installedGames ) . ToList ( ) ;
1627
1627
progressBar . Style = ProgressBarStyle . Marquee ;
1628
1628
if ( SideloaderRCLONE . games . Count > 5 )
@@ -1915,7 +1915,7 @@ public static async void doUpload()
1915
1915
string gameName = $ "{ game . Uploadgamename } v{ game . Uploadversion } { game . Pckgcommand } { SideloaderUtilities . UUID ( ) . Substring ( 0 , 1 ) } ";
1916
1916
string gameZipName = $ "{ gameName } .zip";
1917
1917
1918
- // delete the zip and txt if they exist from a previously failed upload
1918
+ // Delete both zip & txt if the files exist, most likely due to a failed upload.
1919
1919
if ( File . Exists ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") )
1920
1920
{
1921
1921
File . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") ;
@@ -1933,12 +1933,12 @@ public static async void doUpload()
1933
1933
Directory . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { game . Pckgcommand } ", true ) ;
1934
1934
Program . form . changeTitle ( "Uploading to server, you may continue to use Rookie while it uploads." ) ;
1935
1935
1936
- // get size of pending zip upload and write to text file
1936
+ // Get size of pending zip upload and write to text file
1937
1937
long zipSize = new FileInfo ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") . Length ;
1938
1938
File . WriteAllText ( $ "{ Properties . Settings . Default . MainDir } \\ { gameName } .txt", zipSize . ToString ( ) ) ;
1939
- // upload size file
1939
+ // Upload size file.
1940
1940
_ = RCLONE . runRcloneCommand_UploadConfig ( $ "copy \" { Properties . Settings . Default . MainDir } \\ { gameName } .txt\" RSL-gameuploads:") ;
1941
- // upload zip
1941
+ // Upload zip.
1942
1942
_ = RCLONE . runRcloneCommand_UploadConfig ( $ "copy \" { Properties . Settings . Default . MainDir } \\ { gameZipName } \" RSL-gameuploads:") ;
1943
1943
1944
1944
if ( game . isUpdate )
@@ -1947,7 +1947,7 @@ public static async void doUpload()
1947
1947
Properties . Settings . Default . Save ( ) ;
1948
1948
}
1949
1949
1950
- // deleting uploaded files
1950
+ // Delete files once uploaded.
1951
1951
File . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { gameName } .txt") ;
1952
1952
File . Delete ( $ "{ Properties . Settings . Default . MainDir } \\ { gameZipName } ") ;
1953
1953
@@ -2085,7 +2085,7 @@ private void initMirrors(bool random)
2085
2085
2086
2086
remotesList . Invoke ( ( ) =>
2087
2087
{
2088
- remotesList . SelectedIndex = 0 ; //set mirror to first
2088
+ remotesList . SelectedIndex = 0 ; // Set mirror to first item in array.
2089
2089
currentRemote = "VRP-mirror" + remotesList . SelectedItem . ToString ( ) ;
2090
2090
} ) ;
2091
2091
@@ -2490,7 +2490,7 @@ public async void downloadInstallGameButton_Click(object sender, EventArgs e)
2490
2490
changeTitle ( "Downloading game " + gameName , false ) ;
2491
2491
2492
2492
int i = 0 ;
2493
- //Download
2493
+ // Begin download.
2494
2494
while ( t1 . IsAlive )
2495
2495
{
2496
2496
try
@@ -2569,7 +2569,7 @@ public async void downloadInstallGameButton_Click(object sender, EventArgs e)
2569
2569
break ;
2570
2570
}
2571
2571
{
2572
- //Quota Errors
2572
+ // Handle quota errors.
2573
2573
bool isinstalltxt = false ;
2574
2574
bool quotaError = false ;
2575
2575
bool otherError = false ;
@@ -2589,7 +2589,7 @@ public async void downloadInstallGameButton_Click(object sender, EventArgs e)
2589
2589
{
2590
2590
otherError = true ;
2591
2591
2592
- //Remove current game
2592
+ // Remove current game off queue.
2593
2593
cleanupActiveDownloadStatus ( ) ;
2594
2594
2595
2595
_ = FlexibleMessageBox . Show ( $ "Rclone error: { gameDownloadOutput . Error } ") ;
@@ -2720,6 +2720,7 @@ public async void downloadInstallGameButton_Click(object sender, EventArgs e)
2720
2720
{
2721
2721
if ( ! Properties . Settings . Default . nodevicemode | ! nodeviceonstart & DeviceConnected )
2722
2722
{
2723
+ // Attempt to delete OBB Folder before pushing.
2723
2724
deleteOBB ( packagename ) ;
2724
2725
Thread obbThread = new Thread ( ( ) =>
2725
2726
{
@@ -2742,6 +2743,7 @@ public async void downloadInstallGameButton_Click(object sender, EventArgs e)
2742
2743
{
2743
2744
try
2744
2745
{
2746
+ // Check if OBB was properly pushed with a size comparison.
2745
2747
obbsMismatch = await compareOBBSizes ( packagename , gameName , output ) ;
2746
2748
}
2747
2749
catch ( Exception ex ) { _ = FlexibleMessageBox . Show ( $ "Error comparing OBB sizes: { ex . Message } ") ; }
@@ -2764,7 +2766,7 @@ public async void downloadInstallGameButton_Click(object sender, EventArgs e)
2764
2766
try { Directory . Delete ( Properties . Settings . Default . downloadDir + "\\ " + gameName , true ) ; } catch ( Exception ex ) { _ = FlexibleMessageBox . Show ( $ "Error deleting game files: { ex . Message } ") ; }
2765
2767
}
2766
2768
2767
- //Remove current game
2769
+ // Remove current game off queue.
2768
2770
cleanupActiveDownloadStatus ( ) ;
2769
2771
}
2770
2772
}
@@ -2809,6 +2811,7 @@ private void deleteOBB(string packagename)
2809
2811
2810
2812
private const string OBBFolderPath = "/sdcard/Android/obb/" ;
2811
2813
2814
+ // Logic to compare OBB folders.
2812
2815
private async Task < bool > compareOBBSizes ( string packageName , string gameName , ProcessOutput output )
2813
2816
{
2814
2817
string localFolderPath = Path . Combine ( Properties . Settings . Default . downloadDir , gameName , packageName ) ;
@@ -2864,6 +2867,7 @@ private string cleanRemoteFolderSize(string rawSize)
2864
2867
return Regex . Replace ( replaced , "[^0-9]" , "" ) ;
2865
2868
}
2866
2869
2870
+ // Logic to handle mismatches after comparison.
2867
2871
private async Task < bool > handleObbSizeMismatchAsync ( string packageName , string gameName , ProcessOutput output )
2868
2872
{
2869
2873
var dialogResult = MessageBox . Show ( "Warning! It seems like the OBB wasn't pushed correctly, this means that the game may not launch correctly.\n Do you want to retry the push?" , "OBB Size Mismatch!" , MessageBoxButtons . YesNo ) ;
@@ -3181,7 +3185,7 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
3181
3185
{
3182
3186
if ( keyData == ( Keys . Control | Keys . F ) )
3183
3187
{
3184
- //show search
3188
+ // Show search box.
3185
3189
searchTextBox . Clear ( ) ;
3186
3190
searchTextBox . Visible = true ;
3187
3191
label2 . Visible = true ;
@@ -3235,11 +3239,8 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
3235
3239
{
3236
3240
try
3237
3241
{
3238
- //run the program again and close this one
3242
+ // Relaunch the program using Sideloader Launcher
3239
3243
_ = Process . Start ( Application . StartupPath + "\\ Sideloader Launcher.exe" ) ;
3240
- //or you can use Application.ExecutablePath
3241
-
3242
- //close this one
3243
3244
Process . GetCurrentProcess ( ) . Kill ( ) ;
3244
3245
}
3245
3246
catch
@@ -3704,8 +3705,6 @@ private async void updateAvailable_Click(object sender, EventArgs e)
3704
3705
List < string > blacklistItems = blacklist . ToList ( ) ;
3705
3706
List < string > whitelistItems = whitelist . ToList ( ) ;
3706
3707
errorOnList = false ;
3707
- //This is for black list, but temporarly will be whitelist
3708
- //this list has games that we are actually going to upload
3709
3708
newGamesToUploadList = whitelistItems . Intersect ( installedGames ) . ToList ( ) ;
3710
3709
progressBar . Style = ProgressBarStyle . Marquee ;
3711
3710
if ( SideloaderRCLONE . games . Count > 5 )
@@ -4041,8 +4040,6 @@ private async void lblUpToDate_Click(object sender, EventArgs e)
4041
4040
List < string > blacklistItems = blacklist . ToList ( ) ;
4042
4041
List < string > whitelistItems = whitelist . ToList ( ) ;
4043
4042
errorOnList = false ;
4044
- //This is for black list, but temporarly will be whitelist
4045
- //this list has games that we are actually going to upload
4046
4043
newGamesToUploadList = whitelistItems . Intersect ( installedGames ) . ToList ( ) ;
4047
4044
progressBar . Style = ProgressBarStyle . Marquee ;
4048
4045
if ( SideloaderRCLONE . games . Count > 5 )
@@ -4176,8 +4173,6 @@ private async void lblNeedsDonate_Click(object sender, EventArgs e)
4176
4173
List < string > blacklistItems = blacklist . ToList ( ) ;
4177
4174
List < string > whitelistItems = whitelist . ToList ( ) ;
4178
4175
errorOnList = false ;
4179
- //This is for black list, but temporarly will be whitelist
4180
- //this list has games that we are actually going to upload
4181
4176
newGamesToUploadList = whitelistItems . Intersect ( installedGames ) . ToList ( ) ;
4182
4177
progressBar . Style = ProgressBarStyle . Marquee ;
4183
4178
if ( SideloaderRCLONE . games . Count > 5 )
0 commit comments