2
2
// See the LICENSE file in the repository root for full license text.
3
3
4
4
using System ;
5
- using System . Collections . Generic ;
6
5
using System . IO ;
7
- using System . Reflection ;
8
- using Semver ;
9
- using VRCOSC . App . Packages ;
10
- using VRCOSC . App . SDK . Modules ;
11
6
using VRCOSC . App . SDK . Modules . Attributes . Settings ;
12
7
using VRCOSC . App . Serialisation ;
13
8
using VRCOSC . App . Utils ;
@@ -31,50 +26,10 @@ protected override bool ExecuteAfterDeserialisation(SerialisableModule data)
31
26
32
27
Reference . Enabled . Value = data . Enabled ;
33
28
34
- var clonedSettings = new Dictionary < string , object ? > ( data . Settings ) ;
35
-
36
29
foreach ( var settingPair in data . Settings )
37
30
{
38
31
var ( settingKey , settingValue ) = settingPair ;
39
32
40
- var savedVersion = data . PackageVersion is not null ? SemVersion . Parse ( data . PackageVersion ) : new SemVersion ( 0 ) ;
41
- var latestVersion = PackageManager . GetInstance ( ) . GetInstalledVersion ( Reference . PackageID ) ;
42
-
43
- while ( savedVersion != latestVersion )
44
- {
45
- if ( Reference . Migrators . TryGetValue ( settingKey , out var migrator ) )
46
- {
47
- if ( migrator . TryGetValue ( savedVersion , out MethodInfo ? info ) )
48
- {
49
- var attribute = info . GetCustomAttribute < ModuleMigrationAttribute > ( ) ! ;
50
- var sourceType = info . GetParameters ( ) [ 0 ] . ParameterType ;
51
-
52
- if ( TryConvertToTargetType ( settingValue , sourceType , out var convertedValue ) )
53
- {
54
- settingValue = info . Invoke ( Reference , [ convertedValue ] ) ;
55
- settingKey = attribute . DestinationSetting ;
56
- savedVersion = attribute . DestinationVersion ;
57
- shouldReserialise = true ;
58
- }
59
- }
60
- else
61
- {
62
- break ;
63
- }
64
- }
65
- else
66
- {
67
- break ;
68
- }
69
- }
70
-
71
- clonedSettings [ settingKey ] = settingValue ;
72
- }
73
-
74
- foreach ( var settingPair in clonedSettings )
75
- {
76
- var ( settingKey , settingValue ) = settingPair ;
77
-
78
33
try
79
34
{
80
35
var setting = Reference . GetSetting < ModuleSetting > ( settingKey ) ;
0 commit comments