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
SaveSynchronisationOperation_SendFile.cs
Go to the documentation of this file.
1using System;
2using Terraria;
4using UnityEngine;
5
6// Token: 0x020002CD RID: 717
8{
9 // Token: 0x06001090 RID: 4240 RVA: 0x00050EF4 File Offset: 0x0004F0F4
11 {
12 if (!true)
13 {
14 }
15 base..ctor();
17 bool flag = filenameToSend.Contains(".plr");
18 bool flag2 = filenameToSend.StartsWith("/OldSaves");
19 if ("/OldSaves" == null)
20 {
21 }
22 string savePath = Main.SavePath;
23 string text = filenameToSend.Replace(".plr", "");
24 string[] files = FileManager.GetFiles(savePath + text, "*.map");
26 if (files == null)
27 {
29 if ("/OldSaves/PersistentUserData.dat" == null)
30 {
31 }
32 string savePath2 = Main.SavePath;
33 string text2 = this.filename;
34 string text3 = savePath2 + text2;
35 long num = 0L;
36 byte[] array = FileUtilities.ReadAllBytes(text3, num != 0L);
38 return;
39 }
40 if ("/OldSaves" == null)
41 {
42 }
43 string savePath3 = Main.SavePath;
44 string text4;
45 if (text4 == null || text4 != null)
46 {
47 string[] array2 = this.mapFiles;
48 return;
49 }
51 }
52
53 // Token: 0x06001091 RID: 4241 RVA: 0x00050FF4 File Offset: 0x0004F1F4
54 public override void Begin()
55 {
56 IntPtr invoke_impl;
57 if (this.fileDataToSend != null)
58 {
59 string text = this.filename;
60 byte[] array = this.fileDataToSend;
62 IntPtr method_code = sendData.method_code;
63 invoke_impl = sendData.invoke_impl;
64 IntPtr method = sendData.method;
65 if (invoke_impl != 0)
66 {
67 }
68 return;
69 }
70 string text2 = this.filename;
71 string text3 = "No Data " + text2;
72 if (invoke_impl == 0)
73 {
74 }
76 int num = 1;
77 this.IsComplete = num != 0;
78 }
79
80 // Token: 0x06001092 RID: 4242 RVA: 0x00051110 File Offset: 0x0004F310
82 {
83 int num = this.sendOffset;
84 int num2 = this.mapFilesOffset;
85 byte[] array = this.fileDataToSend;
87 this.SendNextChunk();
88 if (this.pendingChunks == 0)
89 {
90 string[] array2 = this.mapFiles;
91 if (array2 != null)
92 {
94 if (array2 == null)
95 {
96 }
97 string savePath = Main.SavePath;
98 string text = this.filename;
99 string text2 = savePath + text;
100 long num3 = 0L;
101 byte[] array3 = FileUtilities.ReadAllBytes(text2, num3 != 0L);
102 int num4 = this.mapFilesOffset;
105 return;
106 }
107 int num5 = 1;
108 this.IsComplete = num5 != 0;
109 }
110 }
111
112 // Token: 0x06001093 RID: 4243 RVA: 0x000511AC File Offset: 0x0004F3AC
113 private void SendNextChunk()
114 {
115 byte[] array = this.fileDataToSend;
116 int num = this.sendOffset;
117 byte[] array2 = this.fileDataToSend;
118 int num2 = this.sendOffset;
120 IntPtr invoke_impl = sendData.invoke_impl;
121 IntPtr method_code = sendData.method_code;
122 int num3 = this.sendOffset;
123 int num4 = this.mapFilesOffset;
126 }
127
128 // Token: 0x06001094 RID: 4244 RVA: 0x00051210 File Offset: 0x0004F410
129 public override string GetStatus()
130 {
131 byte[] array = this.fileDataToSend;
132 int num = this.sendOffset;
133 string text;
134 return text;
135 }
136
137 // Token: 0x06001095 RID: 4245 RVA: 0x0005122C File Offset: 0x0004F42C
138 // Note: this type is marked as 'beforefieldinit'.
142
143 // Token: 0x04001F71 RID: 8049
144 private string filename;
145
146 // Token: 0x04001F72 RID: 8050
147 private byte[] fileDataToSend;
148
149 // Token: 0x04001F73 RID: 8051
150 private int sendOffset;
151
152 // Token: 0x04001F74 RID: 8052
153 private int pendingChunks;
154
155 // Token: 0x04001F75 RID: 8053
156 private int mapFilesOffset;
157
158 // Token: 0x04001F76 RID: 8054
159 private string[] mapFiles;
160
161 // Token: 0x04001F77 RID: 8055
162 private static byte[] fileDataBuffer;
163}
class f__AnonymousType0<< Count > j__TPar
static string[] GetFiles(string path, string searchPattern)
SaveSynchronisationOperation_SendFile(string filenameToSend, SaveSynchronisationOperation.SendDataFunction sendOperation)
override void ProcessMessage(SaveSynchronisationOperation.MessageId messageId, byte[] data)
readonly SaveSynchronisationOperation.SendDataFunction SendData
static string SavePath
Definition Main.cs:4045
static byte[] ReadAllBytes(string path, bool cloud=false)
static void LogError(object message)
Definition Debug.cs:62