11public class Net : MonoBehaviour
15 public static bool ShowNetError
19 return EClass.core.config.test.showNetError ||
EClass.debug.enable;
24 public void ShowVote(
string logs)
26 StringReader stringReader =
new StringReader(logs);
27 for (
string message = stringReader.ReadLine(); message !=
null; message = stringReader.ReadLine())
34 public void ShowChat(
string logs)
36 foreach (JToken jtoken
in ((JArray)JsonConvert.DeserializeObject(logs)))
39 Debug.Log(chatLog.name +
"/" + chatLog.msg);
44 public static UniTask<bool> UploadFile(
string id,
string password,
string name,
string title,
string path,
string idLang)
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;
60 public static UniTask<FileInfo> DownloadFile(
Net.
DownloadMeta item,
string path,
string idLang)
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;
73 public static UniTask<List<
Net.
DownloadMeta>> GetFileList(
string idLang)
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;
84 public static UniTask<bool> SendVote(
int id,
string idLang)
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;
96 public static UniTask<List<
Net.
VoteLog>> GetVote(
string idLang)
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;
107 public static UniTask<bool> SendChat(
string name,
string msg, ChatCategory cat,
string idLang)
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;
121 public static UniTask<List<
Net.
ChatLog>> GetChat(ChatCategory cat,
string idLang)
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;
135 private const string urlScript =
"http://ylva.php.xdomain.jp/script/";
138 private const string urlChat =
"http://ylva.php.xdomain.jp/script/chat/";
141 private const string urlVote =
"http://ylva.php.xdomain.jp/script/vote/";
144 private const string urlUpload =
"http://ylva.php.xdomain.jp/script/uploader/";
147 public static bool isUploading;
179 public bool IsValidVersion()
181 return !global::Version.Get(this.version).IsBelow(
EClass.core.versionMoongate);
207 public Dictionary<string, string> items =
new Dictionary<string, string>();