File tree Expand file tree Collapse file tree
MaiChartManager/Controllers/Mod Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,6 +290,49 @@ public async Task InstallAquaMaiOnline(InstallAquaMaiOnlineDto req)
290290 throw new InvalidOperationException ( "Failed to download AquaMai from all urls" , lastException ) ;
291291 }
292292
293+ [ HttpPost ]
294+ public async Task InstallMuMod ( )
295+ {
296+ CopyFile ( ModPaths . MuModDllBuiltinPath , ModPaths . MuModDllInstalledPath ) ;
297+
298+ if ( System . IO . File . Exists ( ModPaths . AquaMaiDllInstalledPath ) )
299+ {
300+ System . IO . File . Delete ( ModPaths . AquaMaiDllInstalledPath ) ;
301+ }
302+
303+ if ( ! System . IO . File . Exists ( ModPaths . MuModConfigPath ) )
304+ {
305+ System . IO . File . WriteAllText ( ModPaths . MuModConfigPath , "Channel = \" slow\" \n CachePath = \" LocalAssets\\ \\ MuMod.cache\" \n " ) ;
306+ }
307+
308+ try
309+ {
310+ await muModService . EnsureCache ( CancellationToken . None ) ;
311+ }
312+ catch ( Exception e )
313+ {
314+ logger . LogError ( e , "Failed to download MuMod cache during install, but DLL was installed successfully" ) ;
315+ }
316+ }
317+
318+ [ HttpPost ]
319+ public void DeleteAquaMai ( )
320+ {
321+ if ( System . IO . File . Exists ( ModPaths . AquaMaiDllInstalledPath ) )
322+ {
323+ FileSystem . DeleteFile ( ModPaths . AquaMaiDllInstalledPath , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
324+ }
325+ }
326+
327+ [ HttpPost ]
328+ public void DeleteMuMod ( )
329+ {
330+ if ( System . IO . File . Exists ( ModPaths . MuModDllInstalledPath ) )
331+ {
332+ FileSystem . DeleteFile ( ModPaths . MuModDllInstalledPath , UIOption . OnlyErrorDialogs , RecycleOption . SendToRecycleBin ) ;
333+ }
334+ }
335+
293336 [ HttpPost ]
294337 public void KillGameProcess ( )
295338 {
You can’t perform that action at this time.
0 commit comments