scripts
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP.Caching;
|
||||
using Cpp2IlInjected;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BestHTTP.Examples
|
||||
{
|
||||
// Token: 0x020012C5 RID: 4805
|
||||
[Token(Token = "0x20012C5")]
|
||||
[StructLayout(3)]
|
||||
public sealed class CacheMaintenanceSample : MonoBehaviour
|
||||
{
|
||||
// Token: 0x0600785D RID: 30813 RVA: 0x0018FDD0 File Offset: 0x0018DFD0
|
||||
[Token(Token = "0x600785D")]
|
||||
[Address(RVA = "0x1E63DF0", Offset = "0x1E627F0", VA = "0x181E63DF0")]
|
||||
private void OnGUI()
|
||||
{
|
||||
Rect clientArea = GUIHelper.ClientArea;
|
||||
Action action = delegate
|
||||
{
|
||||
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
|
||||
GUILayoutOption[] array = Array.Empty<GUILayoutOption>();
|
||||
GUILayout.Label("Delete cached entities older then", array);
|
||||
GUILayoutOption[] array2 = new GUILayoutOption[1];
|
||||
GUILayoutOption guilayoutOption = GUILayout.MinWidth(50f);
|
||||
if (guilayoutOption != 0)
|
||||
{
|
||||
}
|
||||
array2[0] = guilayoutOption;
|
||||
GUILayoutOption[] array3 = new GUILayoutOption[1];
|
||||
GUILayoutOption guilayoutOption2 = GUILayout.MinWidth(100f);
|
||||
if (guilayoutOption2 != 0)
|
||||
{
|
||||
}
|
||||
array3[0] = guilayoutOption2;
|
||||
float num = GUILayout.HorizontalSlider(100f, 1f, 60f, array3);
|
||||
this.value = guilayoutOption2;
|
||||
GUILayout.Space(10f);
|
||||
CacheMaintenanceSample.DeleteOlderTypes deleteOlderTypes = this.deleteOlderType;
|
||||
string[] array4 = new string[4];
|
||||
if ("Days" != 0)
|
||||
{
|
||||
}
|
||||
array4[0] = "Days";
|
||||
if ("Hours" != 0)
|
||||
{
|
||||
}
|
||||
array4[1] = "Hours";
|
||||
if ("Mins" != 0)
|
||||
{
|
||||
}
|
||||
array4[2] = "Mins";
|
||||
if ("Secs" != 0)
|
||||
{
|
||||
}
|
||||
array4[3] = "Secs";
|
||||
GUILayoutOption[] array5 = Array.Empty<GUILayoutOption>();
|
||||
uint num3;
|
||||
int num2 = GUILayout.SelectionGrid((int)deleteOlderTypes, array4, (int)num3, array5);
|
||||
this.deleteOlderType = (CacheMaintenanceSample.DeleteOlderTypes)num2;
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10f);
|
||||
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
|
||||
GUILayoutOption[] array6 = new GUILayoutOption[1];
|
||||
GUILayoutOption guilayoutOption3 = GUILayout.Width(150f);
|
||||
if (guilayoutOption3 != 0)
|
||||
{
|
||||
}
|
||||
array6[0] = guilayoutOption3;
|
||||
GUILayout.Label("Max Cache Size (bytes): ", array6);
|
||||
GUILayoutOption[] array7 = new GUILayoutOption[1];
|
||||
GUILayoutOption guilayoutOption4 = GUILayout.Width(70f);
|
||||
if (guilayoutOption4 != 0)
|
||||
{
|
||||
}
|
||||
array7[0] = guilayoutOption4;
|
||||
GUILayoutOption[] array8 = Array.Empty<GUILayoutOption>();
|
||||
float num4 = GUILayout.HorizontalSlider(70f, 1024f, 10485760f, array8);
|
||||
this.maxCacheSize = array8;
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space((float)524288.0);
|
||||
GUILayoutOption[] array9 = Array.Empty<GUILayoutOption>();
|
||||
if (GUILayout.Button("Maintenance", array9))
|
||||
{
|
||||
TimeSpan timeSpan = TimeSpan.FromDays(524288.0);
|
||||
CacheMaintenanceSample.DeleteOlderTypes deleteOlderTypes2 = this.deleteOlderType;
|
||||
if (deleteOlderTypes2 != CacheMaintenanceSample.DeleteOlderTypes.Days)
|
||||
{
|
||||
if (deleteOlderTypes2 != CacheMaintenanceSample.DeleteOlderTypes.Days)
|
||||
{
|
||||
if (deleteOlderTypes2 != CacheMaintenanceSample.DeleteOlderTypes.Days)
|
||||
{
|
||||
if (deleteOlderTypes2 != CacheMaintenanceSample.DeleteOlderTypes.Hours)
|
||||
{
|
||||
goto IL_240;
|
||||
}
|
||||
TimeSpan timeSpan2 = TimeSpan.FromSeconds(524288.0);
|
||||
}
|
||||
TimeSpan timeSpan3 = TimeSpan.FromMinutes(524288.0);
|
||||
}
|
||||
TimeSpan timeSpan4 = TimeSpan.FromHours(524288.0);
|
||||
}
|
||||
TimeSpan timeSpan5 = TimeSpan.FromDays(524288.0);
|
||||
IL_240:
|
||||
int num5 = this.maxCacheSize;
|
||||
HTTPCacheService.BeginMaintainence(new HTTPCacheMaintananceParams(timeSpan5, (ulong)num5));
|
||||
}
|
||||
};
|
||||
GUIHelper.DrawArea(clientArea, true, action);
|
||||
}
|
||||
|
||||
// Token: 0x0600785E RID: 30814 RVA: 0x0018FDF8 File Offset: 0x0018DFF8
|
||||
[Token(Token = "0x600785E")]
|
||||
[Address(RVA = "0x1E64570", Offset = "0x1E62F70", VA = "0x181E64570")]
|
||||
public CacheMaintenanceSample()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x040056E4 RID: 22244
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x40056E4")]
|
||||
private CacheMaintenanceSample.DeleteOlderTypes deleteOlderType = (CacheMaintenanceSample.DeleteOlderTypes)((ulong)3L);
|
||||
|
||||
// Token: 0x040056E5 RID: 22245
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x1C")]
|
||||
[Token(Token = "0x40056E5")]
|
||||
private int value = (int)((ulong)10L);
|
||||
|
||||
// Token: 0x040056E6 RID: 22246
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x40056E6")]
|
||||
private int maxCacheSize = (int)((ulong)5242880L);
|
||||
|
||||
// Token: 0x020012C6 RID: 4806
|
||||
[Token(Token = "0x20012C6")]
|
||||
private enum DeleteOlderTypes
|
||||
{
|
||||
// Token: 0x040056E8 RID: 22248
|
||||
[Token(Token = "0x40056E8")]
|
||||
Days,
|
||||
// Token: 0x040056E9 RID: 22249
|
||||
[Token(Token = "0x40056E9")]
|
||||
Hours,
|
||||
// Token: 0x040056EA RID: 22250
|
||||
[Token(Token = "0x40056EA")]
|
||||
Mins,
|
||||
// Token: 0x040056EB RID: 22251
|
||||
[Token(Token = "0x40056EB")]
|
||||
Secs
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user