File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ public static HttpObj MakeHttpConfig()
155155 Source = SourceLocal . Offical ,
156156 DownloadThread = 5 ,
157157 ProxyIP = "127.0.0.1" ,
158- ProxyPort = 1080 ,
158+ ProxyPort = 7890 ,
159159 CheckFile = true ,
160160 AutoDownload = true ,
161161 } ;
@@ -169,7 +169,7 @@ public static RunArgObj MakeJvmArgConfig()
169169 {
170170 return new RunArgObj
171171 {
172- GC = GCType . G1GC ,
172+ GC = GCType . Auto ,
173173 MaxMemory = 4096 ,
174174 MinMemory = 512 ,
175175 } ;
Original file line number Diff line number Diff line change @@ -87,14 +87,15 @@ public static void Init(CoreInitObj arg)
8787
8888 ConfigLoad . Init ( ) ;
8989 CoreHttpClient . Init ( ) ;
90+ InnerPath . Init ( ) ;
91+ ConfigSave . Init ( ) ;
9092 }
9193
9294 /// <summary>
9395 /// 初始化阶段2
9496 /// </summary>
9597 public static void Init1 ( )
9698 {
97- ConfigSave . Init ( ) ;
9899 LocalMaven . Init ( ) ;
99100 DownloadManager . Init ( ) ;
100101 AuthDatabase . Init ( ) ;
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+ using System . Threading . Tasks ;
6+ using ColorMC . Core . Objs ;
7+ using ColorMC . Core . Utils ;
8+
9+ namespace ColorMC . Core . LaunchPath ;
10+
11+ public static class InnerPath
12+ {
13+ public static string Inner { get ; private set ; }
14+
15+ public static void Init ( )
16+ {
17+ //存在用户文件夹
18+ Inner = SystemInfo . Os == OsType . MacOS ?
19+ Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , ".ColorMC" ) :
20+ Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "ColorMC" ) ;
21+ if ( ! Directory . Exists ( Inner ) )
22+ {
23+ Directory . CreateDirectory ( Inner ) ;
24+ }
25+ }
26+ }
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ public static class Names
5555 public const string NameVersionFile = "version.json" ;
5656 public const string NameAuthFile = "auth.json" ;
5757 public const string NameMavenFile = "maven.json" ;
58- public const string NameLogFile = "logs.log" ;
5958 public const string NameJavaFile = "java" ;
6059 public const string NameJavawFile = "javaw.exe" ;
6160 public const string NameOptifineFile = "optifine.json" ;
Original file line number Diff line number Diff line change 11using System . Collections . Concurrent ;
22using ColorMC . Core . Config ;
33using ColorMC . Core . Helpers ;
4+ using ColorMC . Core . LaunchPath ;
45using ColorMC . Core . Objs ;
56using ColorMC . Core . Objs . Login ;
67
@@ -31,14 +32,7 @@ public static class AuthDatabase
3132 /// </summary>
3233 public static void Init ( )
3334 {
34- //存在用户文件夹
35- var path = SystemInfo . Os == OsType . MacOS ?
36- Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , ".ColorMC" ) :
37- Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "ColorMC" ) ;
38-
39- Directory . CreateDirectory ( path ) ;
40-
41- s_local = Path . Combine ( path , Names . NameAuthFile ) ;
35+ s_local = Path . Combine ( InnerPath . Inner , Names . NameAuthFile ) ;
4236
4337 if ( File . Exists ( s_local ) )
4438 {
Original file line number Diff line number Diff line change @@ -108,8 +108,6 @@ public override void OnFrameworkInitializationCompleted()
108108 {
109109 ColorMCCore . Init1 ( ) ;
110110
111- Logs . Info ( LanguageUtils . Get ( "Core.Info3" ) ) ;
112-
113111 BaseBinding . Init1 ( ) ;
114112 } ) ;
115113 }
Original file line number Diff line number Diff line change @@ -107,9 +107,14 @@ public static void Main(string[] args)
107107
108108 RunType = RunType . Program ;
109109
110+ Logs . Init ( ) ;
110111 SystemInfo . Init ( ) ;
111112
112- Console . WriteLine ( $@ "RunDir: { BaseDir } ") ;
113+ Console . WriteLine ( $ "RunDir: { BaseDir } ") ;
114+ if ( ! Directory . Exists ( BaseDir ) )
115+ {
116+ Directory . CreateDirectory ( BaseDir ) ;
117+ }
113118
114119 try
115120 {
@@ -155,14 +160,9 @@ public static void Main(string[] args)
155160 s_arg . Local = BaseDir ;
156161
157162 LanguageUtils . Load ( LanguageType . zh_cn ) ;
158- Logs . Init ( ) ;
159163
160164 ColorMCCore . Init ( s_arg ) ;
161165
162- Logs . Info ( LanguageUtils . Get ( "Core.Info1" ) ) ;
163- Logs . Info ( SystemInfo . SystemName ) ;
164- Logs . Info ( SystemInfo . System ) ;
165-
166166 BaseBinding . ReadBuildConfig ( ) ;
167167
168168 LanguageUtils . Load ( ConfigLoad . Config . Language ) ;
@@ -196,7 +196,7 @@ public static bool StartArg(string[] args)
196196 return false ;
197197 }
198198
199- if ( args [ 0 ] is GuiNames . NameCommandGame or GuiNames . NameCommandOldGame && args . Length >= 2 )
199+ if ( args [ 0 ] is GuiNames . NameCommandGame && args . Length >= 2 )
200200 {
201201 if ( IsInit )
202202 {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public static class GuiNames
1515 public const string NameSakuraFrpDir = "sakurafrp" ;
1616 public const string NameHdiffDir = "hdiff" ;
1717
18+ public const string NameLogFile = "logs.log" ;
1819 public const string NameBlockFile = "block.json" ;
1920 public const string NameWindowFile = "window.json" ;
2021 public const string NameCloudConfigFile = "config.zip" ;
@@ -67,8 +68,6 @@ public static class GuiNames
6768 public const string NameTypeLong = "Long" ;
6869
6970 public const string NameCommandInstall = "--install" ;
70- [ Obsolete ( "Use NameCommandGame" ) ]
71- public const string NameCommandOldGame = "-game" ;
7271 public const string NameCommandGame = "--game" ;
7372 public const string NameCommandImport = "--import" ;
7473 public const string NameCommandRegister = "--register" ;
Original file line number Diff line number Diff line change @@ -125,16 +125,14 @@ public static class BlockTexUtils
125125 public static void Init ( )
126126 {
127127 s_local = Path . Combine ( ColorMCGui . BaseDir , GuiNames . NameBlockDir ) ;
128+ if ( ! Directory . Exists ( s_local ) )
129+ {
130+ Directory . CreateDirectory ( s_local ) ;
131+ }
128132
129133 s_file = Path . Combine ( s_local , GuiNames . NameBlockFile ) ;
130134
131- var path = SystemInfo . Os == OsType . MacOS ?
132- Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , ".ColorMC" ) :
133- Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "ColorMC" ) ;
134-
135- Directory . CreateDirectory ( path ) ;
136-
137- s_unlockFile = Path . Combine ( path , GuiNames . NameBlockFile ) ;
135+ s_unlockFile = Path . Combine ( InnerPath . Inner , GuiNames . NameBlockFile ) ;
138136
139137 LoadState ( ) ;
140138 LoadUnlock ( ) ;
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ public static void Load(LanguageType type)
3131 {
3232 string name = type switch
3333 {
34- LanguageType . en_us => "ColorMC.Gui.Resources .Language.en-us.json" ,
35- _ => "ColorMC.Gui.Resources .Language.zh-cn.json"
34+ LanguageType . en_us => "ColorMC.Gui.Resource .Language.en-us.json" ,
35+ _ => "ColorMC.Gui.Resource .Language.zh-cn.json"
3636 } ;
3737 var assm = Assembly . GetExecutingAssembly ( ) ;
3838 using var istr = assm . GetManifestResourceStream ( name ) ! ;
You can’t perform that action at this time.
0 commit comments