Code cleanup and performance enhancement efforts
This commit is contained in:
1390
DevourClient/ClientMain.cs
Normal file
1390
DevourClient/ClientMain.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -121,17 +121,38 @@ namespace DevourClient.Hacks
|
|||||||
{
|
{
|
||||||
if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer)
|
if (!Il2CppPhoton.Bolt.BoltNetwork.IsServer)
|
||||||
{
|
{
|
||||||
MelonLogger.Msg("You need to be host to spawn stuff !");
|
Hacks.Misc.ShowMessageBox("You need to be host to spawn stuff !");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameObject _localPlayer = Helpers.Entities.LocalPlayer_.p_GameObject;
|
||||||
|
|
||||||
|
if (_localPlayer != null)
|
||||||
|
{
|
||||||
|
Vector3 pos = _localPlayer.transform.position;
|
||||||
|
|
||||||
GameObject _azazel;
|
GameObject _azazel;
|
||||||
Vector3 pos = Player.GetPlayer().transform.position;
|
|
||||||
|
|
||||||
_azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity);
|
_azazel = BoltNetwork.Instantiate(_azazelPrefabId, new Vector3(pos.x, pos.y, pos.z + 1f), Quaternion.identity);
|
||||||
|
Il2Cpp.SurvivalAzazelBehaviour azazelBehaviour = _azazel?.GetComponent<Il2Cpp.SurvivalAzazelBehaviour>();
|
||||||
|
|
||||||
|
if (_azazel != null)
|
||||||
|
{
|
||||||
|
if (azazelBehaviour != null)
|
||||||
|
{
|
||||||
_azazel.gameObject.GetComponent<Il2Cpp.SurvivalAzazelBehaviour>().Spawn();
|
_azazel.gameObject.GetComponent<Il2Cpp.SurvivalAzazelBehaviour>().Spawn();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MelonLogger.Error("azazelBehaviour is null!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MelonLogger.Error("azazel is null!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void CarryObject(string name)
|
public static void CarryObject(string name)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ namespace DevourClient.Helpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity);
|
BoltNetwork.Instantiate(BoltPrefabs.Cage, p_GameObject.transform.position, Quaternion.identity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TP()
|
public void TP()
|
||||||
@@ -104,27 +103,34 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent<UltimateCharacterLocomotion>();
|
UltimateCharacterLocomotion ucl = Helpers.Map.GetAzazel().GetComponent<UltimateCharacterLocomotion>();
|
||||||
|
|
||||||
try
|
if (ucl)
|
||||||
{
|
{
|
||||||
ucl.SetPosition(p_GameObject.transform.position);
|
ucl.SetPosition(p_GameObject.transform.position);
|
||||||
}
|
}
|
||||||
catch { return; }
|
else
|
||||||
|
{
|
||||||
|
MelonLogger.Error("Azazel not found!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShootPlayer()
|
public void ShootPlayer()
|
||||||
{
|
{
|
||||||
if (!BoltNetwork.IsServer){
|
if (!BoltNetwork.IsServer)
|
||||||
|
{
|
||||||
MelonLogger.Msg("You need to be server !");
|
MelonLogger.Msg("You need to be server !");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_GameObject == null){
|
if (p_GameObject == null)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Il2Cpp.AzazelSamBehaviour _azazelSam = UnityEngine.Object.FindObjectOfType<Il2Cpp.AzazelSamBehaviour>();
|
Il2Cpp.AzazelSamBehaviour _azazelSam = UnityEngine.Object.FindObjectOfType<Il2Cpp.AzazelSamBehaviour>();
|
||||||
|
|
||||||
if (_azazelSam){
|
if (_azazelSam)
|
||||||
|
{
|
||||||
_azazelSam.OnShootPlayer(p_GameObject, true);
|
_azazelSam.OnShootPlayer(p_GameObject, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,7 +190,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetLocalPlayer()
|
public static IEnumerator GetLocalPlayer()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player");
|
GameObject[] currentPlayers = GameObject.FindGameObjectsWithTag("Player");
|
||||||
|
|
||||||
@@ -204,7 +210,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetAllPlayers()
|
public static IEnumerator GetAllPlayers()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
|
GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
|
||||||
Players = new BasePlayer[players.Length];
|
Players = new BasePlayer[players.Length];
|
||||||
@@ -241,7 +247,7 @@ namespace DevourClient.Helpers
|
|||||||
}
|
}
|
||||||
public static IEnumerator GetGoatsAndRats()
|
public static IEnumerator GetGoatsAndRats()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType<Il2Cpp.GoatBehaviour>();
|
GoatsAndRats = Il2Cpp.GoatBehaviour.FindObjectsOfType<Il2Cpp.GoatBehaviour>();
|
||||||
|
|
||||||
@@ -252,7 +258,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetSurvivalInteractables()
|
public static IEnumerator GetSurvivalInteractables()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType<Il2Cpp.SurvivalInteractable>();
|
SurvivalInteractables = Il2Cpp.SurvivalInteractable.FindObjectsOfType<Il2Cpp.SurvivalInteractable>();
|
||||||
|
|
||||||
@@ -263,7 +269,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetKeys()
|
public static IEnumerator GetKeys()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType<Il2Cpp.KeyBehaviour>();
|
Keys = Il2Cpp.KeyBehaviour.FindObjectsOfType<Il2Cpp.KeyBehaviour>();
|
||||||
|
|
||||||
@@ -274,7 +280,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetDemons()
|
public static IEnumerator GetDemons()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType<Il2Cpp.SurvivalDemonBehaviour>();
|
Demons = Il2Cpp.SurvivalDemonBehaviour.FindObjectsOfType<Il2Cpp.SurvivalDemonBehaviour>();
|
||||||
|
|
||||||
@@ -285,7 +291,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetSpiders()
|
public static IEnumerator GetSpiders()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType<Il2Cpp.SpiderBehaviour>();
|
Spiders = Il2Cpp.SpiderBehaviour.FindObjectsOfType<Il2Cpp.SpiderBehaviour>();
|
||||||
|
|
||||||
@@ -296,7 +302,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetGhosts()
|
public static IEnumerator GetGhosts()
|
||||||
{
|
{
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType<Il2Cpp.GhostBehaviour>();
|
Ghosts = Il2Cpp.GhostBehaviour.FindObjectsOfType<Il2Cpp.GhostBehaviour>();
|
||||||
|
|
||||||
@@ -307,7 +313,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetBoars()
|
public static IEnumerator GetBoars()
|
||||||
{
|
{
|
||||||
for (; ; )
|
while (true)
|
||||||
{
|
{
|
||||||
Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType<Il2Cpp.BoarBehaviour>();
|
Boars = Il2Cpp.BoarBehaviour.FindObjectsOfType<Il2Cpp.BoarBehaviour>();
|
||||||
|
|
||||||
@@ -318,7 +324,7 @@ namespace DevourClient.Helpers
|
|||||||
|
|
||||||
public static IEnumerator GetCorpses()
|
public static IEnumerator GetCorpses()
|
||||||
{
|
{
|
||||||
for (; ; )
|
while (true)
|
||||||
{
|
{
|
||||||
Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType<Il2Cpp.CorpseBehaviour>();
|
Corpses = Il2Cpp.CorpseBehaviour.FindObjectsOfType<Il2Cpp.CorpseBehaviour>();
|
||||||
|
|
||||||
@@ -332,7 +338,7 @@ namespace DevourClient.Helpers
|
|||||||
/*
|
/*
|
||||||
* ikr AzazelS, because in case we spawn multiple we want the esp to render all of them
|
* ikr AzazelS, because in case we spawn multiple we want the esp to render all of them
|
||||||
*/
|
*/
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType<Il2Cpp.SurvivalAzazelBehaviour>();
|
Azazels = Il2Cpp.SurvivalAzazelBehaviour.FindObjectsOfType<Il2Cpp.SurvivalAzazelBehaviour>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using DevourClient;
|
|
||||||
|
|
||||||
namespace DevourClient.Hooks
|
namespace DevourClient.Hooks
|
||||||
{
|
{
|
||||||
@@ -11,7 +10,7 @@ namespace DevourClient.Hooks
|
|||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
static void Prefix(ref Il2CppOpsive.UltimateCharacterController.Traits.Attribute attribute)
|
static void Prefix(ref Il2CppOpsive.UltimateCharacterController.Traits.Attribute attribute)
|
||||||
{
|
{
|
||||||
if (Load.unlimitedUV && attribute.m_Name == "Battery")
|
if (ClientMain.unlimitedUV && attribute.m_Name == "Battery")
|
||||||
{
|
{
|
||||||
attribute.m_Value = 100.0f;
|
attribute.m_Value = 100.0f;
|
||||||
return;
|
return;
|
||||||
@@ -25,9 +24,9 @@ namespace DevourClient.Hooks
|
|||||||
{
|
{
|
||||||
static void Postfix(ref Il2Cpp.RankHelpers.ExpGainInfo __result)
|
static void Postfix(ref Il2Cpp.RankHelpers.ExpGainInfo __result)
|
||||||
{
|
{
|
||||||
if (Load.exp_modifier)
|
if (ClientMain.exp_modifier)
|
||||||
{
|
{
|
||||||
__result.totalExp = (int)Load.exp;
|
__result.totalExp = (int)ClientMain.exp;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user