using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using Mirror; using Rewired; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("BigYeet")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BigYeet")] [assembly: AssemblyTitle("BigYeet")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BigYeet { [HarmonyPatch(typeof(PlayerMover), "FixedUpdate")] internal static class BallisticFlightPatch { private static void Postfix(PlayerMover __instance) { YeetController.OnMoverFixedUpdate(__instance); } } [HarmonyPatch(typeof(PlayerDecisions), "SetWindUpStartTime")] internal static class KickWindupGuardPatch { private static bool Prefix(PlayerDecisions __instance, double windUpStartTime) { if (windUpStartTime >= 0.0) { return true; } return !YeetController.OwnsWindup(__instance); } } [BepInPlugin("com.zaddish.bigyeet", "BigYeet", "1.1.0")] public sealed class Plugin : BasePlugin { public const string Guid = "com.zaddish.bigyeet"; public const string Name = "BigYeet"; public const string Version = "1.1.0"; internal static ManualLogSource Logger; public override void Load() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown Logger = ((BasePlugin)this).Log; YeetConfig.Init(new ConfigFile(Path.Combine(Paths.ConfigPath, "BigYeet.cfg"), true)); ClassInjector.RegisterTypeInIl2Cpp(); ((BasePlugin)this).AddComponent(); Harmony val = new Harmony("com.zaddish.bigyeet"); val.PatchAll(typeof(ThrowGatePatch)); val.PatchAll(typeof(BallisticFlightPatch)); val.PatchAll(typeof(KickWindupGuardPatch)); YeetNet.Install(val); ManualLogSource logger = Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(9, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("BigYeet"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("1.1.0"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" loaded."); } logger.LogInfo(val2); } } [HarmonyPatch(typeof(PlayerActions), "ActionDropPropOrPlayer")] internal static class ThrowGatePatch { private static bool Prefix(PlayerActions __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown PlayerCharacter playerCharacter = __instance.playerCharacter; if (!YeetController.IsAlive(playerCharacter)) { return true; } PlayerHands hands = playerCharacter.hands; if (hands == null) { return true; } if ((Object)hands.heldProp != (Object)null) { return true; } PlayerCharacter heldCharacter = hands.heldCharacter; if (!YeetController.IsAlive(heldCharacter)) { return true; } Player inputPlayer = playerCharacter.inputPlayer; if (inputPlayer == null) { return true; } if (YeetController.Winding) { if (!playerCharacter.decisions.willDropOnNextUp || inputPlayer.GetButton(10)) { return true; } playerCharacter.decisions.willDropOnNextUp = false; YeetController.ExecuteThrow(); return false; } if (!inputPlayer.GetButtonDown(10)) { return true; } playerCharacter.decisions.SetWindUpStartTime(NetworkTime.time); playerCharacter.decisions.willDropOnNextUp = true; YeetController.BeginWindup(playerCharacter, heldCharacter); return false; } } internal static class YeetConfig { internal static ConfigEntry ForceMultiplier; internal static ConfigEntry KickKey; internal static ConfigEntry KickForceMultiplier; internal static ConfigEntry DebugLog; internal static void Init(ConfigFile config) { ForceMultiplier = config.Bind("Throwing", "ForceMultiplier", 0.35f, "Player throw force"); KickKey = config.Bind("Kicking", "KickKey", (KeyCode)102, "hold to wind up a kick release to boot whatever is in front of you"); KickForceMultiplier = config.Bind("Kicking", "KickForceMultiplier", 0.25f, "Kick force"); DebugLog = config.Bind("Debug", "DebugLog", false, "Debugging"); } } public sealed class YeetController : MonoBehaviour { private class PendingLaunch { internal uint victimNetId; internal Vector3 carrierVelocity; internal Vector3 force; internal float expiry; } private class Flight { internal PlayerCharacter victim; internal Vector3 ballisticVelocity; internal float start; internal bool isKick; } private class Wobble { internal uint victimNetId; internal bool stale; internal Transform parentAtCapture; internal Vector3 baseLocalPosition; internal Quaternion baseLocalRotation; } public const int ThrowActionId = 10; public const int CancelActionId = 17; private const float MinimumThrowWindUp = 0.15f; private const float PendingLaunchTimeout = 2f; private const float FlightGracePeriod = 0.25f; private const float FlightMaxDuration = 8f; private static PlayerCharacter _carrier; private static PlayerCharacter _victim; private static readonly List _pending = new List(); private static readonly List _flights = new List(); private static readonly List _wobbles = new List(); private const float KickRange = 2.5f; private const float KickMinDot = 0.5f; private const float MinimumPlayerKickWindUp = 0.35f; private const float PropKickForceScale = 2f; private static bool _kickWinding; private static bool _propWindup; private static PlayerCharacter _kicker; private static double _kickWindUpStart; private static Transform _footL; private static Transform _footR; private const int MaxHomeChainDepth = 8; internal static bool Winding { get; private set; } public YeetController(IntPtr ptr) : base(ptr) { } internal static void BeginWindup(PlayerCharacter carrier, PlayerCharacter victim) { Winding = true; _carrier = carrier; _victim = victim; } internal static void QueueLaunch(uint victimNetId, Vector3 carrierVelocity, Vector3 force) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) _pending.RemoveAll((PendingLaunch p) => p.victimNetId == victimNetId); _pending.Add(new PendingLaunch { victimNetId = victimNetId, carrierVelocity = carrierVelocity, force = force, expiry = Time.unscaledTime + 2f }); } private void Update() { if (!NetworkClient.active && !NetworkServer.active) { ResetAll(); return; } if (Winding) { TickWindup(); } TickKickWindup(); TickPendingLaunches(); TickFlights(); } private void LateUpdate() { TickWindupWobble(); TickFlightFlail(); if ((_kickWinding || _propWindup) && IsAlive(_kicker)) { Crosshair.SetCrosshairMode((CrosshairMode)2, _kicker.arms.GetWindUp()); } } private void TickFlightFlail() { for (int i = 0; i < _flights.Count; i++) { PlayerCharacter victim = _flights[i].victim; if (IsAlive(victim)) { victim.myAnimator.SetFloat(PlayerAnimationConsts.paramFallDangerness, 1f); } } } private void TickWindup() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_004c: Expected O, but got Unknown if (!IsAlive(_carrier)) { Winding = false; _carrier = null; _victim = null; return; } PlayerCharacter heldCharacter = _carrier.hands.heldCharacter; if (!IsAlive(heldCharacter) || (Object)heldCharacter != (Object)_victim) { CancelWindup(); return; } Player inputPlayer = _carrier.inputPlayer; if (inputPlayer != null && inputPlayer.GetButtonDown(17)) { PlayerCharacter carrier = _carrier; CancelWindup(); carrier.actions.ActionDudUseHeld(); } else if (!_carrier.decisions.willDropOnNextUp) { CancelWindup(); } } internal static void ExecuteThrow() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) PlayerCharacter carrier = _carrier; PlayerCharacter victim = _victim; Winding = false; _carrier = null; _victim = null; if (!IsAlive(carrier)) { return; } float windUp = carrier.arms.GetWindUp(); LaunchSettings val = (carrier.gestures.isHoldingRaised ? carrier.tunings.throwSettings : carrier.tunings.lowThrowSettings); float num = val.angleCurve.Evaluate(carrier.head.headState.y); Vector3 val2 = carrier.cameraTransform.rotation * Quaternion.Euler(num, 0f, 0f) * Vector3.forward * (val.maxForce * windUp * YeetConfig.ForceMultiplier.Value); if (YeetConfig.DebugLog.Value) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(59, 7, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("windUp="); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(windUp, "F2"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" raised="); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(carrier.gestures.isHoldingRaised); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("headY="); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(carrier.head.headState.y, "F1"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" pitchDeg="); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(num, "F1"); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("camEuler="); Quaternion rotation = carrier.cameraTransform.rotation; ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((Quaternion)(ref rotation)).eulerAngles); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" force="); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(val2); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" maxForce="); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(val.maxForce); } logger.LogInfo(val3); } carrier.decisions.ClearWindUp(); carrier.playerNetworking.CmdDropHeldPlayer(); if (!(windUp < 0.15f) && IsAlive(victim)) { uint netId = ((NetworkBehaviour)carrier.playerNetworking).netId; uint netId2 = ((NetworkBehaviour)victim.playerNetworking).netId; YeetNet.SendThrow(netId, netId2, carrier.rb.linearVelocity, val2); } } private void CancelWindup() { if (IsAlive(_carrier)) { _carrier.decisions.ClearWindUp(); _carrier.decisions.willDropOnNextUp = false; } Winding = false; _carrier = null; _victim = null; } private void TickKickWindup() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown if (!_kickWinding && !_propWindup) { if (!Input.GetKeyDown(YeetConfig.KickKey.Value) || Winding) { return; } PlayerCharacter val = FindLocalPlayer(); if (IsAlive(val) && !((Object)(object)val.poser.currentPose != (Object)null) && !val.sitter.isSittingCorrected) { if ((Object)val.hands.heldProp != (Object)null) { val.decisions.SetWindUpStartTime(NetworkTime.time); _propWindup = true; _kicker = val; } else { _kickWindUpStart = NetworkTime.time; val.decisions.SetWindUpStartTime(_kickWindUpStart); _kickWinding = true; _kicker = val; } } } else if (_propWindup) { if (!IsAlive(_kicker) || (Object)_kicker.hands.heldProp == (Object)null || _kicker.sitter.isSittingCorrected) { _propWindup = false; _kicker = null; } else if (!Input.GetKey(YeetConfig.KickKey.Value)) { PlayerCharacter kicker = _kicker; _propWindup = false; _kicker = null; kicker.actions.ActionDropPropOrPlayer(); } } else if (!IsAlive(_kicker) || (Object)(object)_kicker.poser.currentPose != (Object)null || _kicker.sitter.isSittingCorrected || Winding) { CancelKickWindup(); } else if (!Input.GetKey(YeetConfig.KickKey.Value)) { ExecuteKick(); } } internal static bool OwnsWindup(PlayerDecisions decisions) { if (!_kickWinding || !IsAlive(_kicker)) { return false; } return ((Il2CppObjectBase)decisions).Pointer == ((Il2CppObjectBase)_kicker.decisions).Pointer; } private void CancelKickWindup() { PlayerCharacter kicker = _kicker; _kickWinding = false; _kicker = null; if (IsAlive(kicker)) { kicker.decisions.ClearWindUp(); } } private void ExecuteKick() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00be: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) PlayerCharacter kicker = _kicker; _kickWinding = false; _kicker = null; float windUp = kicker.arms.GetWindUp(); kicker.decisions.ClearWindUp(); if (windUp < 0.15f) { return; } Vector3 position = kicker.kernal.position; Vector3 val = kicker.cameraTransform.rotation * Vector3.forward; LayerMask layerMask = kicker.caster.layerMask; int value = ((LayerMask)(ref layerMask)).value; Vector3 footPos = KickOrigin(kicker); PlayerCharacter val2 = null; Prop val3 = null; float num = 0.5f; List allPlayerCharacters = PlayerCharacter.allPlayerCharacters; if (allPlayerCharacters != null) { for (int i = 0; i < allPlayerCharacters.Count; i++) { PlayerCharacter val4 = allPlayerCharacters[i]; if (!IsAlive(val4) || (Object)val4 == (Object)kicker || (Object)(object)val4.poser.currentPose != (Object)null || val4.sitter.isSittingCorrected || val4.faller.isDazed) { continue; } Vector3 val5 = val4.kernal.position - position; float magnitude = ((Vector3)(ref val5)).magnitude; if (!(magnitude > 2.5f)) { float num2 = Vector3.Dot(val5 / magnitude, val); if (num2 > num && KickPathClear(footPos, val4.kernal.position, ((Component)kicker).transform, ((Component)val4).transform, value)) { num = num2; val2 = val4; val3 = null; } } } } List allProps = Prop.allProps; if (allProps != null) { for (int j = 0; j < allProps.Count; j++) { Prop val6 = allProps[j]; if ((Object)val6 == (Object)null || (Object)val6.rb == (Object)null || !IsKickable(val6)) { continue; } Vector3 val7 = ((Component)val6).transform.position - position; float magnitude2 = ((Vector3)(ref val7)).magnitude; if (!(magnitude2 > 2.5f)) { float num3 = Vector3.Dot(val7 / magnitude2, val); if (num3 > num && KickPathClear(footPos, ((Component)val6).transform.position, ((Component)kicker).transform, ((Component)val6).transform, value)) { num = num3; val3 = val6; val2 = null; } } } } if (((Object)(object)val2 == (Object)null && (Object)(object)val3 == (Object)null) || ((Object)(object)val2 != (Object)null && windUp < 0.35f)) { return; } LaunchSettings kickSettings = kicker.tunings.kickSettings; float num4 = kickSettings.angleCurve.Evaluate(kicker.head.headState.y); Quaternion val8 = kicker.cameraTransform.rotation * Quaternion.Euler(num4, 0f, 0f); float num5 = YeetConfig.KickForceMultiplier.Value * (((Object)(object)val3 != (Object)null) ? 2f : 1f); Vector3 val9 = val8 * Vector3.forward * (kickSettings.maxForce * windUp * num5); Vector3 torque = kickSettings.maxTorque * windUp; kicker.myAnimator.SetFloat(PlayerAnimationConsts.paramLaunchStrength, windUp); kicker.myAnimator.SetTrigger(PlayerAnimationConsts.paramOnLaunch); if ((Object)(object)kicker.playerAudio != (Object)null && (Object)(object)kicker.playerAudio.kickSound != (Object)null) { kicker.playerAudio.kickSound.Play(kicker.kernal.position, (Object)null, (IAudioRTPCXProvider)null, true, (Transform)null, 0.0, -1f, (AudioClip)null, (FuncOneOut)null, (List)null, (Func)null); } if (YeetConfig.DebugLog.Value) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val10 = new BepInExInfoLogInterpolatedStringHandler(27, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral("kick windUp="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(windUp, "F2"); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" force="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(val9); ((BepInExLogInterpolatedStringHandler)val10).AppendLiteral(" target="); ((BepInExLogInterpolatedStringHandler)val10).AppendFormatted(((Object)(object)val2 != (Object)null) ? "player" : "prop"); } logger.LogInfo(val10); } uint netId = ((NetworkBehaviour)kicker.playerNetworking).netId; if ((Object)(object)val2 != (Object)null) { YeetNet.SendKick(netId, ((NetworkBehaviour)val2.playerNetworking).netId, targetIsPlayer: true, windUp, kicker.rb.linearVelocity, val9, torque); } else { YeetNet.SendKick(netId, val3.networkIdentity.netId, targetIsPlayer: false, windUp, kicker.rb.linearVelocity, val9, torque); } } private void TickPendingLaunches() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) for (int num = _pending.Count - 1; num >= 0; num--) { PendingLaunch pendingLaunch = _pending[num]; if (Time.unscaledTime > pendingLaunch.expiry) { _pending.RemoveAt(num); } else { PlayerCharacter val = FindPlayerByNetId(pendingLaunch.victimNetId); if (!IsAlive(val)) { _pending.RemoveAt(num); } else if (!((Object)(object)val.poser.currentPose != (Object)null)) { _pending.RemoveAt(num); BeginFlight(val, pendingLaunch.carrierVelocity, pendingLaunch.force); } } } } internal static void BeginFlight(PlayerCharacter victim, Vector3 carrierVelocity, Vector3 force, bool isKick = false, float launchStrength = 0f) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) Vector3 val = carrierVelocity + force / victim.rb.mass; if (((Vector3)(ref val)).magnitude < 0.2f) { return; } _flights.RemoveAll((Flight f) => (Object)f.victim == (Object)victim); _flights.Add(new Flight { victim = victim, ballisticVelocity = val, start = Time.time, isKick = isKick }); if (isKick) { victim.myAnimator.SetFloat(PlayerAnimationConsts.paramLaunchStrength, launchStrength); victim.myAnimator.SetTrigger(PlayerAnimationConsts.paramOnLaunch); } else { victim.myAnimator.SetFloat(PlayerAnimationConsts.paramFallDangerness, 1f); } if (!((NetworkBehaviour)victim).isLocalPlayer) { return; } victim.rb.linearVelocity = val; if (YeetConfig.DebugLog.Value) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(16, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("launch v0="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(val); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" mass="); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(victim.rb.mass); } logger.LogInfo(val2); } } private void TickFlights() { for (int num = _flights.Count - 1; num >= 0; num--) { Flight flight = _flights[num]; if (!IsAlive(flight.victim)) { _flights.RemoveAt(num); } else { bool flag = flight.victim.ground.isGrounded && Time.time > flight.start + 0.25f; bool flag2 = (Object)(object)flight.victim.poser.currentPose != (Object)null; bool flag3 = Time.time > flight.start + 8f; if (flag || flag2 || flag3) { if (flag && ((NetworkBehaviour)flight.victim).isLocalPlayer) { flight.victim.faller.TriggerFall(); } _flights.RemoveAt(num); } } } } private static bool KickPathClear(Vector3 footPos, Vector3 targetPos, Transform kicker, Transform target, int reachMask) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) Vector3 val = targetPos - footPos; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.01f) { return true; } Il2CppStructArray val2 = Physics.RaycastAll(footPos, val / magnitude, magnitude, reachMask, (QueryTriggerInteraction)1); float num = float.MaxValue; Transform val3 = null; for (int i = 0; i < ((Il2CppArrayBase)(object)val2).Length; i++) { RaycastHit val4 = ((Il2CppArrayBase)(object)val2)[i]; Transform transform = ((Component)((RaycastHit)(ref val4)).collider).transform; if (!transform.IsChildOf(kicker)) { val4 = ((Il2CppArrayBase)(object)val2)[i]; if (((RaycastHit)(ref val4)).distance < num) { val4 = ((Il2CppArrayBase)(object)val2)[i]; num = ((RaycastHit)(ref val4)).distance; val3 = transform; } } } if ((Object)val3 == (Object)null) { return true; } return val3.IsChildOf(target); } private static Vector3 KickOrigin(PlayerCharacter kicker) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if ((Object)_footL == (Object)null || (Object)_footR == (Object)null) { Il2CppArrayBase componentsInChildren = ((Component)kicker).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (((Object)componentsInChildren[i]).name == "foot_Target_bone_L") { _footL = componentsInChildren[i]; } else if (((Object)componentsInChildren[i]).name == "foot_Target_bone_R") { _footR = componentsInChildren[i]; } } } if ((Object)_footL != (Object)null && (Object)_footR != (Object)null) { return (_footL.position + _footR.position) * 0.5f; } return kicker.kernal.position; } internal static void OnMoverFixedUpdate(PlayerMover mover) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0045: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _flights.Count; i++) { Flight flight = _flights[i]; if (IsAlive(flight.victim) && ((NetworkBehaviour)flight.victim).isLocalPlayer && !((Object)mover.pc != (Object)flight.victim)) { flight.ballisticVelocity += Physics.gravity * Time.fixedDeltaTime; flight.victim.rb.linearVelocity = flight.ballisticVelocity; break; } } } private void TickWindupWobble() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_02d7: Expected O, but got Unknown //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_0168: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) List allPlayerCharacters = PlayerCharacter.allPlayerCharacters; if (allPlayerCharacters == null) { return; } for (int i = 0; i < _wobbles.Count; i++) { _wobbles[i].stale = true; } for (int j = 0; j < allPlayerCharacters.Count; j++) { PlayerCharacter val = allPlayerCharacters[j]; if (!IsAlive(val)) { continue; } PlayerCharacter heldCharacter = val.hands.heldCharacter; if (!IsAlive(heldCharacter) || (Object)(object)heldCharacter.poser.currentPose == (Object)null) { continue; } float windUp = val.arms.GetWindUp(); if (windUp <= 0.01f) { continue; } Transform kernal = heldCharacter.kernal; if ((Object)kernal == (Object)null) { continue; } uint netId = ((NetworkBehaviour)heldCharacter.playerNetworking).netId; Wobble wobble = null; for (int k = 0; k < _wobbles.Count; k++) { if (_wobbles[k].victimNetId == netId) { wobble = _wobbles[k]; break; } } if (wobble == null) { wobble = new Wobble { victimNetId = netId, parentAtCapture = kernal.parent, baseLocalPosition = kernal.localPosition, baseLocalRotation = kernal.localRotation }; _wobbles.Add(wobble); } wobble.stale = false; if ((Object)kernal.parent != (Object)wobble.parentAtCapture) { wobble.parentAtCapture = kernal.parent; wobble.baseLocalPosition = kernal.localPosition; wobble.baseLocalRotation = kernal.localRotation; } float num = Time.time * 18f; float num2 = 0.02f * windUp; kernal.localPosition = wobble.baseLocalPosition + new Vector3(Mathf.Sin(num) * num2, 0f, Mathf.Cos(num * 0.9f + 0.6f) * num2); kernal.localRotation = wobble.baseLocalRotation * Quaternion.Euler(Mathf.Sin(num * 1.1f + 0.4f) * 2.5f * windUp, 0f, Mathf.Cos(num * 0.8f + 2.1f) * 2.5f * windUp); } for (int num3 = _wobbles.Count - 1; num3 >= 0; num3--) { if (_wobbles[num3].stale) { PlayerCharacter val2 = FindPlayerByNetId(_wobbles[num3].victimNetId); if (IsAlive(val2) && (Object)val2.kernal != (Object)null && (Object)val2.kernal.parent == (Object)_wobbles[num3].parentAtCapture) { val2.kernal.localPosition = _wobbles[num3].baseLocalPosition; val2.kernal.localRotation = _wobbles[num3].baseLocalRotation; } _wobbles.RemoveAt(num3); } } } private static void ResetAll() { Winding = false; _carrier = null; _victim = null; _kickWinding = false; _propWindup = false; _kicker = null; _pending.Clear(); _flights.Clear(); _wobbles.Clear(); } internal static bool IsKickable(Prop p) { if (IsAlive(p.exclusiveHolder)) { return false; } return !HomeBelongsToPlayer(p.currentHome); } private static bool HomeBelongsToPlayer(PropHome home) { PropHome val = home; int num = 0; while (IsAlive((Object)(object)val) && num < 8) { if (IsAlive(val.parentCharacter)) { return true; } Prop parentProp = val.parentProp; if (!IsAlive((Object)(object)parentProp)) { return false; } val = parentProp.currentHome; num++; } return false; } internal static PlayerCharacter FindLocalPlayer() { List allPlayerCharacters = PlayerCharacter.allPlayerCharacters; if (allPlayerCharacters == null) { return null; } for (int i = 0; i < allPlayerCharacters.Count; i++) { PlayerCharacter val = allPlayerCharacters[i]; if (IsAlive(val) && ((NetworkBehaviour)val).isLocalPlayer) { return val; } } return null; } internal static PlayerCharacter FindPlayerByNetId(uint netId) { List allPlayerCharacters = PlayerCharacter.allPlayerCharacters; if (allPlayerCharacters == null) { return null; } for (int i = 0; i < allPlayerCharacters.Count; i++) { PlayerCharacter val = allPlayerCharacters[i]; if (IsAlive(val) && ((NetworkBehaviour)val.playerNetworking).netId == netId) { return val; } } return null; } internal static bool IsAlive(PlayerCharacter pc) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return (Object)pc != (Object)null; } internal static bool IsAlive(Object obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return obj != (Object)null; } } internal static class YeetNet { private const ushort FunctionHash = 23015; private const uint Magic = 1497711956u; private const byte ProtocolVersion = 1; private const byte PacketThrow = 1; private const byte PacketKick = 2; private const float MaxCarrierSpeed = 40f; private const float MaxThrowForce = 5000f; private static MethodInfo _bufferRpc; private const int PayloadLength = 34; internal static void Install(Harmony harmony) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown harmony.Patch((MethodBase)AccessTools.Method(typeof(NetworkServer), "OnCommandMessage", (Type[])null, (Type[])null), new HarmonyMethod(typeof(YeetNet), "HandleCommand", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)AccessTools.Method(typeof(NetworkClient), "OnRPCMessage", (Type[])null, (Type[])null), new HarmonyMethod(typeof(YeetNet), "HandleRpc", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); _bufferRpc = AccessTools.Method(typeof(NetworkConnectionToClient), "BufferRpc", new Type[2] { typeof(RpcMessage), typeof(int) }, (Type[])null); if (_bufferRpc == null) { Plugin.Logger.LogError((object)"BigYeet: NetworkConnectionToClient.BufferRpc not found; throws will not launch victims."); } } internal static void SendThrow(uint carrierNetId, uint victimNetId, Vector3 carrierVelocity, Vector3 force) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { RelayToAll(victimNetId, carrierVelocity, force); } else if (NetworkClient.active && NetworkClient.connection != null) { NetworkWriterPooled val = NetworkWriterPool.Get(); try { NetworkWriterExtensions.WriteUShort((NetworkWriter)(object)val, NetworkMessages.GetId()); NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, carrierNetId); ((NetworkWriter)val).WriteByte((byte)0); NetworkWriterExtensions.WriteUShort((NetworkWriter)(object)val, (ushort)23015); NetworkWriterExtensions.WriteBytesAndSize((NetworkWriter)(object)val, BuildPayload(victimNetId, carrierVelocity, force)); NetworkClient.connection.Send(((NetworkWriter)val).ToArraySegment(), Channels.Reliable); } finally { NetworkWriterPool.Return(val); } } } private static Il2CppStructArray BuildPayload(uint victimNetId, Vector3 carrierVelocity, Vector3 force) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) NetworkWriterPooled val = NetworkWriterPool.Get(); try { NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, 1497711956u); ((NetworkWriter)val).WriteByte((byte)1); ((NetworkWriter)val).WriteByte((byte)1); NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, victimNetId); NetworkWriterExtensions.WriteVector3((NetworkWriter)(object)val, carrierVelocity); NetworkWriterExtensions.WriteVector3((NetworkWriter)(object)val, force); return ((NetworkWriter)val).ToArray(); } finally { NetworkWriterPool.Return(val); } } private static bool ReadHeader(ArraySegment payload, out NetworkReader reader, out byte packetType) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown reader = null; packetType = 0; if (payload.Count < 6) { return false; } reader = new NetworkReader(payload); if (NetworkReaderExtensions.ReadUInt(reader) != 1497711956) { return false; } if (reader.ReadByte() != 1) { return false; } packetType = reader.ReadByte(); return true; } private static bool ReadThrow(NetworkReader reader, out uint victimNetId, out Vector3 carrierVelocity, out Vector3 force) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) victimNetId = 0u; carrierVelocity = Vector3.zero; force = Vector3.zero; if (reader.Remaining < 28) { return false; } victimNetId = NetworkReaderExtensions.ReadUInt(reader); carrierVelocity = NetworkReaderExtensions.ReadVector3(reader); force = NetworkReaderExtensions.ReadVector3(reader); return true; } private static bool HandleCommand(NetworkConnectionToClient conn, CommandMessage msg) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown if (msg.functionHash != 23015) { return true; } if (!ReadHeader(msg.payload, out var reader, out var packetType)) { return false; } switch (packetType) { case 2: return HandleKickCommand(conn, msg, reader); default: return false; case 1: { if (!ReadThrow(reader, out var victimNetId, out var carrierVelocity, out var force)) { return false; } NetworkIdentity identity = ((NetworkConnection)conn).identity; if ((Object)identity == (Object)null || identity.netId != msg.netId) { return false; } if (!float.IsFinite(carrierVelocity.x) || !float.IsFinite(carrierVelocity.y) || !float.IsFinite(carrierVelocity.z) || !float.IsFinite(force.x) || !float.IsFinite(force.y) || !float.IsFinite(force.z)) { return false; } carrierVelocity = Vector3.ClampMagnitude(carrierVelocity, 40f); force = Vector3.ClampMagnitude(force, 5000f); float hostAllowedForce = GetHostAllowedForce(conn); if (hostAllowedForce <= 0f) { return false; } if (((Vector3)(ref force)).magnitude > hostAllowedForce) { if (YeetConfig.DebugLog.Value) { ManualLogSource logger = Plugin.Logger; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(42, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("clamped throw force "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(((Vector3)(ref force)).magnitude, "F1"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(hostAllowedForce, "F1"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (host multiplier)"); } logger.LogInfo(val); } force = ((Vector3)(ref force)).normalized * hostAllowedForce; } RelayToAll(victimNetId, carrierVelocity, force); return false; } } } private static float GetHostAllowedForce(NetworkConnectionToClient conn) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown NetworkIdentity identity = ((NetworkConnection)conn).identity; if ((Object)identity == (Object)null) { return 0f; } PlayerNetworking component = ((Component)identity).GetComponent(); PlayerCharacter val = (((Object)(object)component == (Object)null) ? null : component.playerCharacter); if ((Object)val == (Object)null) { return 0f; } return Mathf.Max(val.tunings.throwSettings.maxForce, val.tunings.lowThrowSettings.maxForce) * YeetConfig.ForceMultiplier.Value; } private static bool HandleRpc(RpcMessage message) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (message.functionHash != 23015) { return true; } if (!ReadHeader(message.payload, out var reader, out var packetType)) { return false; } switch (packetType) { case 2: return HandleKickRpc(reader); default: return false; case 1: { if (!ReadThrow(reader, out var victimNetId, out var carrierVelocity, out var force)) { return false; } YeetController.QueueLaunch(victimNetId, carrierVelocity, force); return false; } } } private static void RelayToAll(uint victimNetId, Vector3 carrierVelocity, Vector3 force) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (_bufferRpc == null) { return; } RpcMessage val = new RpcMessage { netId = victimNetId, componentIndex = 0, functionHash = 23015, payload = new ArraySegment((Il2CppArrayBase)(object)BuildPayload(victimNetId, carrierVelocity, force)) }; Enumerator enumerator = NetworkServer.connections.Values.GetEnumerator(); bool flag = default(bool); while (enumerator.MoveNext()) { NetworkConnectionToClient current = enumerator.Current; if (!((NetworkConnection)current).isReady) { continue; } try { _bufferRpc.Invoke(current, new object[2] { val, Channels.Reliable }); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("BigYeet: relay to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((NetworkConnection)current).connectionId); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } logger.LogWarning(val2); } } if (NetworkClient.active) { YeetController.QueueLaunch(victimNetId, carrierVelocity, force); } } internal static void SendKick(uint kickerNetId, uint targetNetId, bool targetIsPlayer, float windUp, Vector3 kickerVelocity, Vector3 force, Vector3 torque) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { ApplyKickOnHost(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque); } else if (NetworkClient.active && NetworkClient.connection != null) { NetworkWriterPooled val = NetworkWriterPool.Get(); try { NetworkWriterExtensions.WriteUShort((NetworkWriter)(object)val, NetworkMessages.GetId()); NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, kickerNetId); ((NetworkWriter)val).WriteByte((byte)0); NetworkWriterExtensions.WriteUShort((NetworkWriter)(object)val, (ushort)23015); NetworkWriterExtensions.WriteBytesAndSize((NetworkWriter)(object)val, BuildKickPayload(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque)); NetworkClient.connection.Send(((NetworkWriter)val).ToArraySegment(), Channels.Reliable); } finally { NetworkWriterPool.Return(val); } } } private static Il2CppStructArray BuildKickPayload(uint kickerNetId, uint targetNetId, bool targetIsPlayer, float windUp, Vector3 kickerVelocity, Vector3 force, Vector3 torque) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkWriterPooled val = NetworkWriterPool.Get(); try { NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, 1497711956u); ((NetworkWriter)val).WriteByte((byte)1); ((NetworkWriter)val).WriteByte((byte)2); NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, kickerNetId); NetworkWriterExtensions.WriteUInt((NetworkWriter)(object)val, targetNetId); ((NetworkWriter)val).WriteByte(targetIsPlayer ? ((byte)1) : ((byte)0)); NetworkWriterExtensions.WriteFloat((NetworkWriter)(object)val, windUp); NetworkWriterExtensions.WriteVector3((NetworkWriter)(object)val, kickerVelocity); NetworkWriterExtensions.WriteVector3((NetworkWriter)(object)val, force); NetworkWriterExtensions.WriteVector3((NetworkWriter)(object)val, torque); return ((NetworkWriter)val).ToArray(); } finally { NetworkWriterPool.Return(val); } } private static bool ReadKick(NetworkReader reader, out uint kickerNetId, out uint targetNetId, out bool targetIsPlayer, out float windUp, out Vector3 kickerVelocity, out Vector3 force, out Vector3 torque) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) kickerNetId = 0u; targetNetId = 0u; targetIsPlayer = false; windUp = 0f; kickerVelocity = Vector3.zero; force = Vector3.zero; torque = Vector3.zero; if (reader.Remaining < 49) { return false; } kickerNetId = NetworkReaderExtensions.ReadUInt(reader); targetNetId = NetworkReaderExtensions.ReadUInt(reader); targetIsPlayer = reader.ReadByte() != 0; windUp = NetworkReaderExtensions.ReadFloat(reader); kickerVelocity = NetworkReaderExtensions.ReadVector3(reader); force = NetworkReaderExtensions.ReadVector3(reader); torque = NetworkReaderExtensions.ReadVector3(reader); return true; } private static bool HandleKickCommand(NetworkConnectionToClient conn, CommandMessage msg, NetworkReader reader) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) if (!ReadKick(reader, out var kickerNetId, out var targetNetId, out var targetIsPlayer, out var windUp, out var kickerVelocity, out var force, out var torque)) { return false; } NetworkIdentity identity = ((NetworkConnection)conn).identity; if ((Object)identity == (Object)null || identity.netId != msg.netId || kickerNetId != msg.netId) { return false; } if (!float.IsFinite(force.x) || !float.IsFinite(force.y) || !float.IsFinite(force.z)) { return false; } ApplyKickOnHost(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque); return false; } private static void ApplyKickOnHost(uint kickerNetId, uint targetNetId, bool targetIsPlayer, float windUp, Vector3 kickerVelocity, Vector3 force, Vector3 torque) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) float num = 0f; NetworkIdentity val = default(NetworkIdentity); if (NetworkServer.spawned.TryGetValue(kickerNetId, ref val) && (Object)val != (Object)null) { PlayerNetworking component = ((Component)val).GetComponent(); PlayerCharacter val2 = (((Object)(object)component == (Object)null) ? null : component.playerCharacter); if ((Object)val2 != (Object)null) { num = val2.tunings.kickSettings.maxForce * YeetConfig.KickForceMultiplier.Value; } } if (num <= 0f || (targetIsPlayer && windUp < 0.35f)) { return; } if (!targetIsPlayer) { num *= 2f; } if (((Vector3)(ref force)).magnitude > num) { force = ((Vector3)(ref force)).normalized * num; } NetworkIdentity val3 = default(NetworkIdentity); if (!targetIsPlayer && NetworkServer.spawned.TryGetValue(targetNetId, ref val3) && (Object)val3 != (Object)null) { Prop component2 = ((Component)val3).GetComponent(); if ((Object)component2 != (Object)null && (Object)component2.rb != (Object)null) { if (!YeetController.IsKickable(component2)) { return; } if ((Object)component2.currentHome != (Object)null) { component2.ServerSetUnpinned(); } component2.SetLoose(); component2.houseNetworkTransform.StartLocalCooldown(); component2.rb.AddForce(force * component2.launchMultiplier, (ForceMode)1); component2.rb.AddTorque(torque, (ForceMode)1); } } RelayKickToAll(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque); } private static void RelayKickToAll(uint kickerNetId, uint targetNetId, bool targetIsPlayer, float windUp, Vector3 kickerVelocity, Vector3 force, Vector3 torque) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (_bufferRpc == null) { return; } RpcMessage val = new RpcMessage { netId = targetNetId, componentIndex = 0, functionHash = 23015, payload = new ArraySegment((Il2CppArrayBase)(object)BuildKickPayload(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque)) }; Enumerator enumerator = NetworkServer.connections.Values.GetEnumerator(); bool flag = default(bool); while (enumerator.MoveNext()) { NetworkConnectionToClient current = enumerator.Current; if (!((NetworkConnection)current).isReady) { continue; } try { _bufferRpc.Invoke(current, new object[2] { val, Channels.Reliable }); } catch (Exception ex) { ManualLogSource logger = Plugin.Logger; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(32, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("BigYeet: kick relay to "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((NetworkConnection)current).connectionId); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" failed: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } logger.LogWarning(val2); } } if (NetworkClient.active) { HandleKickLocal(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque); } } private static bool HandleKickRpc(NetworkReader reader) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!ReadKick(reader, out var kickerNetId, out var targetNetId, out var targetIsPlayer, out var windUp, out var kickerVelocity, out var force, out var torque)) { return false; } HandleKickLocal(kickerNetId, targetNetId, targetIsPlayer, windUp, kickerVelocity, force, torque); return false; } private static void HandleKickLocal(uint kickerNetId, uint targetNetId, bool targetIsPlayer, float windUp, Vector3 kickerVelocity, Vector3 force, Vector3 torque) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (kickerNetId != 0) { PlayerCharacter val = YeetController.FindPlayerByNetId(kickerNetId); if (YeetController.IsAlive(val) && !((NetworkBehaviour)val).isLocalPlayer) { val.myAnimator.SetFloat(PlayerAnimationConsts.paramLaunchStrength, windUp); val.myAnimator.SetTrigger(PlayerAnimationConsts.paramOnLaunch); if ((Object)(object)val.playerAudio != (Object)null && (Object)(object)val.playerAudio.kickSound != (Object)null) { val.playerAudio.kickSound.Play(val.kernal.position, (Object)null, (IAudioRTPCXProvider)null, true, (Transform)null, 0.0, -1f, (AudioClip)null, (FuncOneOut)null, (List)null, (Func)null); } } } if (targetIsPlayer) { PlayerCharacter val2 = YeetController.FindPlayerByNetId(targetNetId); if (YeetController.IsAlive(val2)) { YeetController.BeginFlight(val2, kickerVelocity, force, isKick: true, windUp); } } } } }