scripts
This commit is contained in:
@@ -0,0 +1,200 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace UnityEngine.Networking
|
||||
{
|
||||
// Token: 0x02000294 RID: 660
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class DownloadHandler : IDisposable
|
||||
{
|
||||
// Token: 0x06002D27 RID: 11559 RVA: 0x0003FE70 File Offset: 0x0003E070
|
||||
internal DownloadHandler()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002D28 RID: 11560
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal extern void InternalCreateBuffer();
|
||||
|
||||
// Token: 0x06002D29 RID: 11561
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal extern void InternalCreateScript();
|
||||
|
||||
// Token: 0x06002D2A RID: 11562
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal extern void InternalCreateAssetBundle(string url, uint crc);
|
||||
|
||||
// Token: 0x06002D2B RID: 11563 RVA: 0x0003FE7C File Offset: 0x0003E07C
|
||||
internal void InternalCreateAssetBundleCached(string url, string name, Hash128 hash, uint crc)
|
||||
{
|
||||
DownloadHandler.INTERNAL_CALL_InternalCreateAssetBundleCached(this, url, name, ref hash, crc);
|
||||
}
|
||||
|
||||
// Token: 0x06002D2C RID: 11564
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern void INTERNAL_CALL_InternalCreateAssetBundleCached(DownloadHandler self, string url, string name, ref Hash128 hash, uint crc);
|
||||
|
||||
// Token: 0x06002D2D RID: 11565
|
||||
[ThreadAndSerializationSafe]
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern void InternalDestroy();
|
||||
|
||||
// Token: 0x06002D2E RID: 11566 RVA: 0x0003FE8C File Offset: 0x0003E08C
|
||||
~DownloadHandler()
|
||||
{
|
||||
this.InternalDestroy();
|
||||
}
|
||||
|
||||
// Token: 0x06002D2F RID: 11567 RVA: 0x0003FEBC File Offset: 0x0003E0BC
|
||||
public void Dispose()
|
||||
{
|
||||
this.InternalDestroy();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
// Token: 0x17000A41 RID: 2625
|
||||
// (get) Token: 0x06002D30 RID: 11568
|
||||
public extern bool isDone
|
||||
{
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
get;
|
||||
}
|
||||
|
||||
// Token: 0x17000A42 RID: 2626
|
||||
// (get) Token: 0x06002D31 RID: 11569 RVA: 0x0003FECC File Offset: 0x0003E0CC
|
||||
public byte[] data
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetData();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000A43 RID: 2627
|
||||
// (get) Token: 0x06002D32 RID: 11570 RVA: 0x0003FEE8 File Offset: 0x0003E0E8
|
||||
public string text
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetText();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06002D33 RID: 11571 RVA: 0x0003FF04 File Offset: 0x0003E104
|
||||
protected virtual byte[] GetData()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Token: 0x06002D34 RID: 11572 RVA: 0x0003FF1C File Offset: 0x0003E11C
|
||||
protected virtual string GetText()
|
||||
{
|
||||
byte[] data = this.GetData();
|
||||
string text;
|
||||
if (data != null && data.Length > 0)
|
||||
{
|
||||
text = this.GetTextEncoder().GetString(data, 0, data.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
// Token: 0x06002D35 RID: 11573 RVA: 0x0003FF64 File Offset: 0x0003E164
|
||||
private Encoding GetTextEncoder()
|
||||
{
|
||||
string contentType = this.GetContentType();
|
||||
if (!string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
int num = contentType.IndexOf("charset", StringComparison.OrdinalIgnoreCase);
|
||||
if (num > -1)
|
||||
{
|
||||
int num2 = contentType.IndexOf('=', num);
|
||||
if (num2 > -1)
|
||||
{
|
||||
string text = contentType.Substring(num2 + 1).Trim().Trim(new char[] { '\'', '"' })
|
||||
.Trim();
|
||||
int num3 = text.IndexOf(';');
|
||||
if (num3 > -1)
|
||||
{
|
||||
text = text.Substring(0, num3);
|
||||
}
|
||||
try
|
||||
{
|
||||
return Encoding.GetEncoding(text);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Debug.LogWarning(string.Format("Unsupported encoding '{0}': {1}", text, ex.Message));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Encoding.UTF8;
|
||||
}
|
||||
|
||||
// Token: 0x06002D36 RID: 11574
|
||||
[GeneratedByOldBindingsGenerator]
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private extern string GetContentType();
|
||||
|
||||
// Token: 0x06002D37 RID: 11575 RVA: 0x00040040 File Offset: 0x0003E240
|
||||
[UsedByNativeCode]
|
||||
protected virtual bool ReceiveData(byte[] data, int dataLength)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06002D38 RID: 11576 RVA: 0x00040058 File Offset: 0x0003E258
|
||||
[UsedByNativeCode]
|
||||
protected virtual void ReceiveContentLength(int contentLength)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002D39 RID: 11577 RVA: 0x0004005C File Offset: 0x0003E25C
|
||||
[UsedByNativeCode]
|
||||
protected virtual void CompleteContent()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06002D3A RID: 11578 RVA: 0x00040060 File Offset: 0x0003E260
|
||||
[UsedByNativeCode]
|
||||
protected virtual float GetProgress()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
// Token: 0x06002D3B RID: 11579 RVA: 0x0004007C File Offset: 0x0003E27C
|
||||
protected static T GetCheckedDownloader<T>(UnityWebRequest www) where T : DownloadHandler
|
||||
{
|
||||
if (www == null)
|
||||
{
|
||||
throw new NullReferenceException("Cannot get content from a null UnityWebRequest object");
|
||||
}
|
||||
if (!www.isDone)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot get content from an unfinished UnityWebRequest object");
|
||||
}
|
||||
if (www.isNetworkError)
|
||||
{
|
||||
throw new InvalidOperationException(www.error);
|
||||
}
|
||||
return (T)((object)www.downloadHandler);
|
||||
}
|
||||
|
||||
// Token: 0x040008A3 RID: 2211
|
||||
[NonSerialized]
|
||||
internal IntPtr m_Ptr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user