terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
ResourcePack.cs
Go to the documentation of this file.
1using System;
2using System.IO;
4using Ionic.Zip;
9
10namespace Terraria.IO
11{
12 // Token: 0x02000566 RID: 1382
13 public class ResourcePack
14 {
15 // Token: 0x17000670 RID: 1648
16 // (get) Token: 0x060033A3 RID: 13219 RVA: 0x00200248 File Offset: 0x001FE448
18 {
19 get
20 {
21 if (this._icon == null)
22 {
23 }
25 return texture2D;
26 }
27 }
28
29 // Token: 0x17000671 RID: 1649
30 // (get) Token: 0x060033A4 RID: 13220 RVA: 0x00200260 File Offset: 0x001FE460
31 // (set) Token: 0x060033A5 RID: 13221 RVA: 0x00200274 File Offset: 0x001FE474
32 public string Name
33 {
35 get
36 {
37 return this.<Name>k__BackingField;
38 }
40 private set
41 {
43 }
44 }
45
46 // Token: 0x17000672 RID: 1650
47 // (get) Token: 0x060033A6 RID: 13222 RVA: 0x00200288 File Offset: 0x001FE488
48 // (set) Token: 0x060033A7 RID: 13223 RVA: 0x0020029C File Offset: 0x001FE49C
49 public string Description
50 {
52 get
53 {
54 return this.<Description>k__BackingField;
55 }
57 private set
58 {
60 }
61 }
62
63 // Token: 0x17000673 RID: 1651
64 // (get) Token: 0x060033A8 RID: 13224 RVA: 0x002002B0 File Offset: 0x001FE4B0
65 // (set) Token: 0x060033A9 RID: 13225 RVA: 0x002002C4 File Offset: 0x001FE4C4
66 public string Author
67 {
69 get
70 {
71 return this.<Author>k__BackingField;
72 }
74 private set
75 {
77 }
78 }
79
80 // Token: 0x17000674 RID: 1652
81 // (get) Token: 0x060033AA RID: 13226 RVA: 0x002002D8 File Offset: 0x001FE4D8
82 // (set) Token: 0x060033AB RID: 13227 RVA: 0x002002EC File Offset: 0x001FE4EC
84 {
86 get
87 {
88 return this.<Version>k__BackingField;
89 }
91 private set
92 {
94 }
95 }
96
97 // Token: 0x17000675 RID: 1653
98 // (get) Token: 0x060033AC RID: 13228 RVA: 0x00200300 File Offset: 0x001FE500
99 // (set) Token: 0x060033AD RID: 13229 RVA: 0x00200314 File Offset: 0x001FE514
100 public bool IsEnabled
101 {
103 get
104 {
105 return this.<IsEnabled>k__BackingField;
106 }
108 set
109 {
110 }
111 }
112
113 // Token: 0x17000676 RID: 1654
114 // (get) Token: 0x060033AE RID: 13230 RVA: 0x00200324 File Offset: 0x001FE524
115 // (set) Token: 0x060033AF RID: 13231 RVA: 0x00200338 File Offset: 0x001FE538
116 public int SortingOrder
117 {
119 get
120 {
121 return this.<SortingOrder>k__BackingField;
122 }
124 set
125 {
127 }
128 }
129
130 // Token: 0x060033B0 RID: 13232 RVA: 0x0020034C File Offset: 0x001FE54C
131 public ResourcePack(IServiceProvider services, string path)
132 {
133 bool flag = File.Exists(path);
134 this._isCompressed = true;
135 }
136
137 // Token: 0x060033B1 RID: 13233 RVA: 0x002003C8 File Offset: 0x001FE5C8
138 public void Refresh()
139 {
140 this._needsReload = true;
141 }
142
143 // Token: 0x060033B2 RID: 13234 RVA: 0x002003DC File Offset: 0x001FE5DC
145 {
146 if (this._needsReload)
147 {
148 bool isCompressed = this._isCompressed;
149 string fullPath = this.FullPath;
150 if (isCompressed)
151 {
152 }
153 }
154 return this._contentSource;
155 }
156
157 // Token: 0x060033B3 RID: 13235 RVA: 0x00200408 File Offset: 0x001FE608
159 {
160 bool flag = this.HasFile("icon.png");
161 Stream stream = this.OpenStream("icon.png");
163 if (stream != null)
164 {
165 }
166 if ("Images/UI/DefaultResourcePackIcon" == null)
167 {
168 }
169 throw new OutOfMemoryException();
170 }
171
172 // Token: 0x060033B4 RID: 13236 RVA: 0x0020047C File Offset: 0x001FE67C
173 private void LoadManifest()
174 {
175 bool flag = this.HasFile("pack.json");
176 Stream stream = this.OpenStream("pack.json");
177 }
178
179 // Token: 0x060033B5 RID: 13237 RVA: 0x00200564 File Offset: 0x001FE764
180 private Stream OpenStream(string fileName)
181 {
182 /*
183An exception occurred when decompiling this method (060033B5)
184
185ICSharpCode.Decompiler.DecompilerException: Error decompiling System.IO.Stream Terraria.IO.ResourcePack::OpenStream(System.String)
186
187 ---> System.Exception: Basic block has to end with unconditional control flow.
188{
189 IL_001A:
190 stloc:FileStream(var_2_20, call:FileStream(File::OpenRead, ldloc:string(var_1)))
191}
192
193 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
194 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
195 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
196 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
197 --- End of inner exception stack trace ---
198 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
199 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
200*/;
201 }
202
203 // Token: 0x060033B6 RID: 13238 RVA: 0x00200594 File Offset: 0x001FE794
204 private bool HasFile(string fileName)
205 {
206 if (this._isCompressed)
207 {
208 return this._zipFile.ContainsEntry(fileName);
209 }
210 return File.Exists(Path.Combine(this.FullPath, fileName));
211 }
212
213 // Token: 0x04003C55 RID: 15445
214 public readonly string FullPath;
215
216 // Token: 0x04003C56 RID: 15446
217 public readonly string FileName;
218
219 // Token: 0x04003C57 RID: 15447
221 private string <Name>k__BackingField;
222
223 // Token: 0x04003C58 RID: 15448
225 private string <Description>k__BackingField;
226
227 // Token: 0x04003C59 RID: 15449
229 private string <Author>k__BackingField;
230
231 // Token: 0x04003C5A RID: 15450
233 private ResourcePackVersion <Version>k__BackingField;
234
235 // Token: 0x04003C5B RID: 15451
237 private bool <IsEnabled>k__BackingField;
238
239 // Token: 0x04003C5C RID: 15452
241 private int <SortingOrder>k__BackingField;
242
243 // Token: 0x04003C5D RID: 15453
245
246 // Token: 0x04003C5E RID: 15454
248
249 // Token: 0x04003C5F RID: 15455
251
252 // Token: 0x04003C60 RID: 15456
254
255 // Token: 0x04003C61 RID: 15457
257
258 // Token: 0x04003C62 RID: 15458
259 private bool _needsReload = true;
260
261 // Token: 0x04003C63 RID: 15459
262 private const string ICON_FILE_NAME = "icon.png";
263
264 // Token: 0x04003C64 RID: 15460
265 private const string PACK_FILE_NAME = "pack.json";
266 }
267}
class f__AnonymousType0<< Count > j__TPar
bool ContainsEntry(string name)
Definition ZipFile.cs:790
static bool Exists(string path)
Definition File.cs:86
static string Combine(string path1, string path2)
Definition Path.cs:41
readonly IServiceProvider _services
readonly string FullPath
IContentSource _contentSource
readonly string FileName
IContentSource GetContentSource()
string< Name > k__BackingField
bool HasFile(string fileName)
ResourcePack(IServiceProvider services, string path)
int< SortingOrder > k__BackingField
ResourcePackVersion< Version > k__BackingField
bool< IsEnabled > k__BackingField
readonly bool _isCompressed
string< Description > k__BackingField
string< Author > k__BackingField
Stream OpenStream(string fileName)
readonly ZipFile _zipFile