Files
2026-04-08 23:40:05 +02:00

238 lines
6.1 KiB
C#

using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
using Photon.Pun;
using Photon.Realtime;
using RecRoom.Networking.SynchronizedFields;
using UnityEngine;
// Token: 0x02000284 RID: 644
[Token(Token = "0x2000284")]
[StructLayout(3)]
public class ToolPool : MonoBehaviourPun
{
// Token: 0x170002C9 RID: 713
// (get) Token: 0x06001312 RID: 4882 RVA: 0x00050968 File Offset: 0x0004EB68
[Token(Token = "0x170002C9")]
public Tool[] MNEJOFAKAJG
{
[Token(Token = "0x6001312")]
[Address(RVA = "0x3D32F0", Offset = "0x3D1CF0", VA = "0x1803D32F0")]
get
{
return this.pool;
}
}
// Token: 0x06001313 RID: 4883 RVA: 0x0005097C File Offset: 0x0004EB7C
[Token(Token = "0x6001313")]
[Address(RVA = "0x188EAD0", Offset = "0x188D4D0", VA = "0x18188EAD0", Slot = "13")]
protected override void Awake()
{
for (;;)
{
base..ctor();
Tool[] array = this.pool;
int num = 0;
if (num < array.Length)
{
array[num].SpawnedFromPool = true;
num++;
SynchronizedField<float>[] array2 = new SynchronizedField<float>[this.pool.Length];
this.NDJLDFNMBAH = array2;
Tool[] array3 = this.pool;
if (num >= array3.Length)
{
break;
}
SynchronizedField<float>[] ndjldfnmbah = this.NDJLDFNMBAH;
SynchronizedField<float> synchronizedField;
if (synchronizedField != 0)
{
}
num++;
ndjldfnmbah[0] = synchronizedField;
if (this.pool == 0)
{
break;
}
}
}
}
// Token: 0x06001314 RID: 4884 RVA: 0x00050A04 File Offset: 0x0004EC04
[Token(Token = "0x6001314")]
[Address(RVA = "0x188F070", Offset = "0x188DA70", VA = "0x18188F070", Slot = "15")]
protected virtual void Start()
{
if (PhotonNetwork.IsMasterClient && this.toolsDefaultDisabled)
{
Tool[] array = this.pool;
int num = 0;
if (num < array.Length)
{
Tool tool = array[num];
int num2 = 0;
tool.PAJGCGDFHKK = num2 != 0;
Tool[] array2 = this.pool;
num++;
}
}
}
// Token: 0x06001315 RID: 4885 RVA: 0x00050A5C File Offset: 0x0004EC5C
[Token(Token = "0x6001315")]
[Address(RVA = "0x188E600", Offset = "0x188D000", VA = "0x18188E600")]
public Tool Acquire(Vector3 DDHPAFKBMON, Quaternion IGPENJBJADK)
{
if (PhotonNetwork.IsMasterClient)
{
Func<Tool, bool> <>9__8_ = ToolPool.<>c.<>9__8_0;
if (<>9__8_ == 0)
{
ToolPool.<>c.<>9__8_0 = (Tool tool) => !tool.PAJGCGDFHKK;
}
int num;
if (this.BDHPOGHGFMC(<>9__8_) == -1)
{
Func<Tool, bool> func;
if (ToolPool.<>c.<>9__8_1 == 0)
{
func = (Tool tool) => !tool.FNFNLDBILFE;
ToolPool.<>c.<>9__8_1 = func;
}
if (this.BDHPOGHGFMC(func) == -1)
{
if (!this.forceDropIfNecessary)
{
goto IL_146;
}
Func<Tool, bool> func2;
if (ToolPool.<>c.<>9__8_2 == 0)
{
func2 = (Tool tool) => true;
ToolPool.<>c.<>9__8_2 = func2;
}
num = this.BDHPOGHGFMC(func2);
Tool tool4 = this.pool[num];
OKIMOMGKKDH ekjclgjfign = OKIMOMGKKDH.EKJCLGJFIGN;
tool4.IKEGONLJBPP = ekjclgjfign;
Tool[] array = this.pool;
}
Tool tool2 = this.pool[num];
this.Release(tool2);
}
if (num != -1)
{
SynchronizedField<float> synchronizedField = this.NDJLDFNMBAH[num];
double time = PhotonNetwork.Time;
Tool tool3 = this.pool[num];
PhotonView photonView = tool3.photonView;
Photon.Realtime.Player masterClient = PhotonNetwork.MasterClient;
photonView.TransferOwnership(masterClient);
Transform transform = tool3.transform;
float z = DDHPAFKBMON.z;
Transform transform2 = tool3.transform;
tool3.Snap();
tool3.PAJGCGDFHKK = true;
}
}
IL_146:
throw new IndexOutOfRangeException();
}
// Token: 0x06001316 RID: 4886 RVA: 0x00050BB8 File Offset: 0x0004EDB8
[Token(Token = "0x6001316")]
[Address(RVA = "0x188EEB0", Offset = "0x188D8B0", VA = "0x18188EEB0")]
public void Release(Tool EGFEJGHDNAI)
{
if (PhotonNetwork.IsMasterClient)
{
Tool[] array = this.pool;
bool flag;
if (flag && EGFEJGHDNAI.PAJGCGDFHKK)
{
PhotonView photonView = EGFEJGHDNAI.photonView;
Photon.Realtime.Player masterClient = PhotonNetwork.MasterClient;
photonView.TransferOwnership(masterClient);
int num = 0;
EGFEJGHDNAI.PAJGCGDFHKK = num != 0;
Transform transform = EGFEJGHDNAI.transform;
float z = Vector3.zero.z;
Transform transform2 = EGFEJGHDNAI.transform;
Quaternion identity = Quaternion.identity;
EGFEJGHDNAI.Snap();
}
}
}
// Token: 0x06001317 RID: 4887 RVA: 0x00050C38 File Offset: 0x0004EE38
[Token(Token = "0x6001317")]
[Address(RVA = "0x188EE00", Offset = "0x188D800", VA = "0x18188EE00")]
public void MasterDisableAll()
{
if (PhotonNetwork.IsMasterClient)
{
int num = 0;
Tool[] array = this.pool;
int length = array.Length;
if (num < length)
{
Tool tool = array[num];
this.Release(tool);
num++;
}
}
}
// Token: 0x06001318 RID: 4888 RVA: 0x00050C80 File Offset: 0x0004EE80
[Token(Token = "0x6001318")]
[Address(RVA = "0x188ECC0", Offset = "0x188D6C0", VA = "0x18188ECC0")]
private int BDHPOGHGFMC(Func<Tool, bool> HBPBAJNLGCP)
{
Tool[] array = this.pool;
int num = 0;
if (num < array.Length)
{
float num2 = this.NDJLDFNMBAH[num].Get();
Tool tool = this.pool[num];
if (HBPBAJNLGCP(tool) != 0)
{
}
Tool[] array2 = this.pool;
num++;
}
return -1;
}
// Token: 0x06001319 RID: 4889 RVA: 0x00050CDC File Offset: 0x0004EEDC
[Token(Token = "0x6001319")]
[Address(RVA = "0x188F140", Offset = "0x188DB40", VA = "0x18188F140")]
public ToolPool()
{
}
// Token: 0x04000EBB RID: 3771
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x4000EBB")]
[SerializeField]
protected Tool[] pool;
// Token: 0x04000EBC RID: 3772
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x4000EBC")]
[SerializeField]
private bool forceDropIfNecessary;
// Token: 0x04000EBD RID: 3773
[global::Cpp2IlInjected.FieldOffset(Offset = "0x49")]
[Token(Token = "0x4000EBD")]
[SerializeField]
private bool toolsDefaultDisabled = true;
// Token: 0x04000EBE RID: 3774
[global::Cpp2IlInjected.FieldOffset(Offset = "0x50")]
[Token(Token = "0x4000EBE")]
private SynchronizedField<float>[] NDJLDFNMBAH;
}