Elin Modding Docs Doc
Loading...
Searching...
No Matches
Net.cs
1using System;
2using System.Collections.Generic;
3using System.IO;
4using Cysharp.Threading.Tasks;
5using Cysharp.Threading.Tasks.CompilerServices;
6using Newtonsoft.Json;
7using Newtonsoft.Json.Linq;
8using UnityEngine;
9
10// Token: 0x02000134 RID: 308
11public class Net : MonoBehaviour
12{
13 // Token: 0x170001CA RID: 458
14 // (get) Token: 0x06000839 RID: 2105 RVA: 0x000363C3 File Offset: 0x000345C3
15 public static bool ShowNetError
16 {
17 get
18 {
19 return EClass.core.config.test.showNetError || EClass.debug.enable;
20 }
21 }
22
23 // Token: 0x0600083A RID: 2106 RVA: 0x000363E8 File Offset: 0x000345E8
24 public void ShowVote(string logs)
25 {
26 StringReader stringReader = new StringReader(logs);
27 for (string message = stringReader.ReadLine(); message != null; message = stringReader.ReadLine())
28 {
29 Debug.Log(message);
30 }
31 }
32
33 // Token: 0x0600083B RID: 2107 RVA: 0x00036418 File Offset: 0x00034618
34 public void ShowChat(string logs)
35 {
36 foreach (JToken jtoken in ((JArray)JsonConvert.DeserializeObject(logs)))
37 {
38 Net.ChatLog chatLog = jtoken.ToObject<Net.ChatLog>();
39 Debug.Log(chatLog.name + "/" + chatLog.msg);
40 }
41 }
42
43 // Token: 0x0600083C RID: 2108 RVA: 0x00036484 File Offset: 0x00034684
44 public static UniTask<bool> UploadFile(string id, string password, string name, string title, string path, string idLang)
45 {
46 Net.<UploadFile>d__13 <UploadFile>d__;
47 <UploadFile>d__.<>t__builder = AsyncUniTaskMethodBuilder<bool>.Create();
48 <UploadFile>d__.id = id;
49 <UploadFile>d__.password = password;
50 <UploadFile>d__.name = name;
51 <UploadFile>d__.title = title;
52 <UploadFile>d__.path = path;
53 <UploadFile>d__.idLang = idLang;
54 <UploadFile>d__.<>1__state = -1;
55 <UploadFile>d__.<>t__builder.Start<Net.<UploadFile>d__13>(ref <UploadFile>d__);
56 return <UploadFile>d__.<>t__builder.Task;
57 }
58
59 // Token: 0x0600083D RID: 2109 RVA: 0x000364F4 File Offset: 0x000346F4
60 public static UniTask<FileInfo> DownloadFile(Net.DownloadMeta item, string path, string idLang)
61 {
62 Net.<DownloadFile>d__15 <DownloadFile>d__;
63 <DownloadFile>d__.<>t__builder = AsyncUniTaskMethodBuilder<FileInfo>.Create();
64 <DownloadFile>d__.item = item;
65 <DownloadFile>d__.path = path;
66 <DownloadFile>d__.idLang = idLang;
67 <DownloadFile>d__.<>1__state = -1;
68 <DownloadFile>d__.<>t__builder.Start<Net.<DownloadFile>d__15>(ref <DownloadFile>d__);
69 return <DownloadFile>d__.<>t__builder.Task;
70 }
71
72 // Token: 0x0600083E RID: 2110 RVA: 0x00036548 File Offset: 0x00034748
73 public static UniTask<List<Net.DownloadMeta>> GetFileList(string idLang)
74 {
75 Net.<GetFileList>d__16 <GetFileList>d__;
76 <GetFileList>d__.<>t__builder = AsyncUniTaskMethodBuilder<List<Net.DownloadMeta>>.Create();
77 <GetFileList>d__.idLang = idLang;
78 <GetFileList>d__.<>1__state = -1;
79 <GetFileList>d__.<>t__builder.Start<Net.<GetFileList>d__16>(ref <GetFileList>d__);
80 return <GetFileList>d__.<>t__builder.Task;
81 }
82
83 // Token: 0x0600083F RID: 2111 RVA: 0x0003658C File Offset: 0x0003478C
84 public static UniTask<bool> SendVote(int id, string idLang)
85 {
86 Net.<SendVote>d__17 <SendVote>d__;
87 <SendVote>d__.<>t__builder = AsyncUniTaskMethodBuilder<bool>.Create();
88 <SendVote>d__.id = id;
89 <SendVote>d__.idLang = idLang;
90 <SendVote>d__.<>1__state = -1;
91 <SendVote>d__.<>t__builder.Start<Net.<SendVote>d__17>(ref <SendVote>d__);
92 return <SendVote>d__.<>t__builder.Task;
93 }
94
95 // Token: 0x06000840 RID: 2112 RVA: 0x000365D8 File Offset: 0x000347D8
96 public static UniTask<List<Net.VoteLog>> GetVote(string idLang)
97 {
98 Net.<GetVote>d__18 <GetVote>d__;
99 <GetVote>d__.<>t__builder = AsyncUniTaskMethodBuilder<List<Net.VoteLog>>.Create();
100 <GetVote>d__.idLang = idLang;
101 <GetVote>d__.<>1__state = -1;
102 <GetVote>d__.<>t__builder.Start<Net.<GetVote>d__18>(ref <GetVote>d__);
103 return <GetVote>d__.<>t__builder.Task;
104 }
105
106 // Token: 0x06000841 RID: 2113 RVA: 0x0003661C File Offset: 0x0003481C
107 public static UniTask<bool> SendChat(string name, string msg, ChatCategory cat, string idLang)
108 {
109 Net.<SendChat>d__19 <SendChat>d__;
110 <SendChat>d__.<>t__builder = AsyncUniTaskMethodBuilder<bool>.Create();
111 <SendChat>d__.name = name;
112 <SendChat>d__.msg = msg;
113 <SendChat>d__.cat = cat;
114 <SendChat>d__.idLang = idLang;
115 <SendChat>d__.<>1__state = -1;
116 <SendChat>d__.<>t__builder.Start<Net.<SendChat>d__19>(ref <SendChat>d__);
117 return <SendChat>d__.<>t__builder.Task;
118 }
119
120 // Token: 0x06000842 RID: 2114 RVA: 0x00036678 File Offset: 0x00034878
121 public static UniTask<List<Net.ChatLog>> GetChat(ChatCategory cat, string idLang)
122 {
123 Net.<GetChat>d__20 <GetChat>d__;
124 <GetChat>d__.<>t__builder = AsyncUniTaskMethodBuilder<List<Net.ChatLog>>.Create();
125 <GetChat>d__.idLang = idLang;
126 <GetChat>d__.<>1__state = -1;
127 <GetChat>d__.<>t__builder.Start<Net.<GetChat>d__20>(ref <GetChat>d__);
128 return <GetChat>d__.<>t__builder.Task;
129 }
130
131 // Token: 0x0400089A RID: 2202
132 public List<Net.ChatLog> chatList;
133
134 // Token: 0x0400089B RID: 2203
135 private const string urlScript = "http://ylva.php.xdomain.jp/script/";
136
137 // Token: 0x0400089C RID: 2204
138 private const string urlChat = "http://ylva.php.xdomain.jp/script/chat/";
139
140 // Token: 0x0400089D RID: 2205
141 private const string urlVote = "http://ylva.php.xdomain.jp/script/vote/";
142
143 // Token: 0x0400089E RID: 2206
144 private const string urlUpload = "http://ylva.php.xdomain.jp/script/uploader/";
145
146 // Token: 0x0400089F RID: 2207
147 public static bool isUploading;
148
149 // Token: 0x02000859 RID: 2137
150 public class ChatLog
151 {
152 // Token: 0x040023AF RID: 9135
153 public string name;
154
155 // Token: 0x040023B0 RID: 9136
156 public string msg;
157 }
158
159 // Token: 0x0200085A RID: 2138
160 public class VoteLog
161 {
162 // Token: 0x040023B1 RID: 9137
163 public string name;
164
165 // Token: 0x040023B2 RID: 9138
166 public int count;
167
168 // Token: 0x040023B3 RID: 9139
169 public int index;
170
171 // Token: 0x040023B4 RID: 9140
172 public int time;
173 }
174
175 // Token: 0x0200085B RID: 2139
176 public class DownloadMeta
177 {
178 // Token: 0x06003A06 RID: 14854 RVA: 0x00133E98 File Offset: 0x00132098
179 public bool IsValidVersion()
180 {
181 return !global::Version.Get(this.version).IsBelow(EClass.core.versionMoongate);
182 }
183
184 // Token: 0x040023B5 RID: 9141
185 public string name;
186
187 // Token: 0x040023B6 RID: 9142
188 public string title;
189
190 // Token: 0x040023B7 RID: 9143
191 public string id;
192
193 // Token: 0x040023B8 RID: 9144
194 public string path;
195
196 // Token: 0x040023B9 RID: 9145
197 public string date;
198
199 // Token: 0x040023BA RID: 9146
200 public int version;
201 }
202
203 // Token: 0x0200085C RID: 2140
204 public class DownloadCahce
205 {
206 // Token: 0x040023BB RID: 9147
207 public Dictionary<string, string> items = new Dictionary<string, string>();
208 }
209}
Definition Net.cs:12