using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Peak.Afflictions; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.UI; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using Zorro.Core; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("FlagSurvival")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("FlagSurvival")] [assembly: AssemblyTitle("FlagSurvival")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 FlagSurvival { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.characteriddiag", "Character ID Diag", "1.0.0")] public class FlagCharacterIdDiagPlugin : BaseUnityPlugin { private void Awake() { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[CharIdDiag] F10 → 본 캐릭터 GameObject 진단"); } } private void Update() { try { if (Keyboard.current != null && ((ButtonControl)Keyboard.current.f10Key).wasPressedThisFrame) { DumpCharacter(); } } catch { } } private void DumpCharacter() { //IL_00e2: 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_00f8: 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_010e: Unknown result type (might be due to invalid IL or missing references) Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CharIdDiag] Character.localCharacter == null"); } return; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"===== F10 CHARACTER ID DIAG START ====="); } ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[CharIdDiag] === 본 캐릭터 GameObject ==="); } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)("[CharIdDiag] Name: '" + ((Object)((Component)localCharacter).gameObject).name + "'")); } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[CharIdDiag] InstanceID: {((Object)((Component)localCharacter).gameObject).GetInstanceID()}"); } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$"[CharIdDiag] Active(self/hier): {((Component)localCharacter).gameObject.activeSelf}/{((Component)localCharacter).gameObject.activeInHierarchy}"); } Vector3 position = ((Component)localCharacter).transform.position; ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)$"[CharIdDiag] Position: ({position.x:F2}, {position.y:F2}, {position.z:F2})"); } ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)$"[CharIdDiag] Layer: {LayerMask.LayerToName(((Component)localCharacter).gameObject.layer)} ({((Component)localCharacter).gameObject.layer})"); } ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)("[CharIdDiag] Tag: '" + ((Component)localCharacter).gameObject.tag + "'")); } try { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)("[CharIdDiag] PhotonViewID: " + (((Object)(object)((MonoBehaviourPun)localCharacter).photonView != (Object)null) ? ((MonoBehaviourPun)localCharacter).photonView.ViewID.ToString() : "null"))); } ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogWarning((object)$"[CharIdDiag] IsLocal: {localCharacter.IsLocal}"); } } catch (Exception ex) { ManualLogSource log12 = FlagSurvivalPlugin.Log; if (log12 != null) { log12.LogError((object)("[CharIdDiag] Photon 진단 예외: " + ex.Message)); } } ManualLogSource log13 = FlagSurvivalPlugin.Log; if (log13 != null) { log13.LogWarning((object)"[CharIdDiag] === 부모 체인 (root까지) ==="); } Transform parent = ((Component)localCharacter).transform.parent; int num = 0; while ((Object)(object)parent != (Object)null && num < 10) { ManualLogSource log14 = FlagSurvivalPlugin.Log; if (log14 != null) { log14.LogInfo((object)$"[CharIdDiag] parent[{num}]: '{((Object)parent).name}'"); } parent = parent.parent; num++; } if (num == 0) { ManualLogSource log15 = FlagSurvivalPlugin.Log; if (log15 != null) { log15.LogInfo((object)"[CharIdDiag] (root GameObject - 부모 없음)"); } } ManualLogSource log16 = FlagSurvivalPlugin.Log; if (log16 != null) { log16.LogWarning((object)"[CharIdDiag] === 자식 hierarchy (depth ≤ 3) ==="); } DumpChildren(((Component)localCharacter).transform, 0, 3); ManualLogSource log17 = FlagSurvivalPlugin.Log; if (log17 != null) { log17.LogWarning((object)"[CharIdDiag] === 본 캐릭터 컴포넌트 ==="); } Component[] components = ((Component)localCharacter).gameObject.GetComponents(); foreach (Component val in components) { if (!((Object)(object)val == (Object)null)) { ManualLogSource log18 = FlagSurvivalPlugin.Log; if (log18 != null) { log18.LogInfo((object)("[CharIdDiag] - " + ((object)val).GetType().Name)); } } } ManualLogSource log19 = FlagSurvivalPlugin.Log; if (log19 != null) { log19.LogWarning((object)"[CharIdDiag] === local.refs 진단 ==="); } try { if (localCharacter.refs != null) { FieldInfo[] fields = ((object)localCharacter.refs).GetType().GetFields(); foreach (FieldInfo fieldInfo in fields) { try { object value = fieldInfo.GetValue(localCharacter.refs); if (value != null) { GameObject val2 = (GameObject)((value is GameObject) ? value : null); string text; if (val2 != null) { text = $"GameObject '{((Object)val2).name}' (active={val2.activeInHierarchy})"; } else { Component val3 = (Component)((value is Component) ? value : null); text = ((val3 == null) ? value.GetType().Name : $"{((object)val3).GetType().Name} on '{((Object)val3.gameObject).name}' (active={val3.gameObject.activeInHierarchy})"); } ManualLogSource log20 = FlagSurvivalPlugin.Log; if (log20 != null) { log20.LogInfo((object)("[CharIdDiag] refs." + fieldInfo.Name + " = " + text)); } } } catch { } } } } catch (Exception ex2) { ManualLogSource log21 = FlagSurvivalPlugin.Log; if (log21 != null) { log21.LogError((object)("[CharIdDiag] refs 진단 예외: " + ex2.Message)); } } ManualLogSource log22 = FlagSurvivalPlugin.Log; if (log22 != null) { log22.LogWarning((object)"===== F10 CHARACTER ID DIAG END ====="); } } private void DumpChildren(Transform parent, int depth, int maxDepth) { if (depth > maxDepth) { return; } for (int i = 0; i < parent.childCount; i++) { Transform child = parent.GetChild(i); string text = new string(' ', depth * 2); string text2 = (((Component)child).gameObject.activeSelf ? "✓" : "✗"); string text3 = ""; Component[] components = ((Component)child).GetComponents(); int num = 0; Component[] array = components; foreach (Component val in array) { if ((Object)(object)val == (Object)null || val is Transform) { continue; } num++; if (num <= 5) { if (text3.Length > 0) { text3 += ", "; } text3 += ((object)val).GetType().Name; } } if (num > 5) { text3 += $", +{num - 5}"; } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)("[CharIdDiag] " + text + "[" + text2 + "] " + ((Object)child).name + " | " + text3)); } if (depth < maxDepth) { DumpChildren(child, depth + 1, maxDepth); } } } } public static class FlagCOOPHUD { private static readonly Dictionary _cachedColumnTmps = new Dictionary(); public static void BuildFixedHUDTexts(bool isKorean, out string leaderInfo, out string myDistText, out string myRankText, out string pointsText) { leaderInfo = ExtractCurrentBiomeColumn("Pct"); myDistText = ExtractCurrentBiomeColumn("Star"); string text = FlagSurvivalMulti.GetCurrentBiomeTitle() ?? ""; string text2 = FlagSurvivalMulti.GetCurrentBiome() ?? ""; if (isKorean) { if (!string.IsNullOrEmpty(text)) { myRankText = text; } else if (!string.IsNullOrEmpty(text2)) { myRankText = text2; } else { myRankText = "???"; } } else if (!string.IsNullOrEmpty(text2)) { myRankText = text2; } else if (!string.IsNullOrEmpty(text)) { myRankText = text; } else { myRankText = "???"; } pointsText = ExtractCurrentBiomeColumn("Count"); } public static string ExtractCurrentBiomeColumn(string suffix) { try { if (string.IsNullOrEmpty(suffix)) { return ""; } _cachedColumnTmps.TryGetValue(suffix, out var value); if ((Object)(object)value == (Object)null) { string text = "FlagSurvival_FlagCountText_" + suffix; TextMeshProUGUI[] array = Object.FindObjectsOfType(true); if (array == null) { return ""; } TextMeshProUGUI[] array2 = array; foreach (TextMeshProUGUI val in array2) { if (!((Object)(object)val == (Object)null) && ((Object)((Component)val).gameObject).name == text) { value = val; _cachedColumnTmps[suffix] = val; break; } } if ((Object)(object)value == (Object)null) { return ""; } } string text2 = ((TMP_Text)value).text; if (string.IsNullOrEmpty(text2)) { return ""; } int num = FlagSurvivalMulti.GetCurrentSegmentIndex(); if (num < 0) { return ""; } if (num > 4) { num = 4; } string[] array3 = text2.Split('\n'); if (num >= array3.Length) { return ""; } string text3 = array3[num]; if (text3.StartsWith("'); if (num2 > 0 && num2 + 1 < text3.Length) { text3 = text3.Substring(num2 + 1); } } return text3; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCOOPHUD][v3] ExtractCurrentBiomeColumn(" + suffix + ") 예외: " + ex.Message)); } return ""; } } public static string ExtractScoreRow(string suffix, int rowIndex) { try { if (string.IsNullOrEmpty(suffix)) { return ""; } if (rowIndex < 0) { return ""; } _cachedColumnTmps.TryGetValue(suffix, out var value); if ((Object)(object)value == (Object)null) { string text = "FlagSurvival_FlagCountText_" + suffix; TextMeshProUGUI[] array = Object.FindObjectsOfType(true); if (array == null) { return ""; } TextMeshProUGUI[] array2 = array; foreach (TextMeshProUGUI val in array2) { if (!((Object)(object)val == (Object)null) && ((Object)((Component)val).gameObject).name == text) { value = val; _cachedColumnTmps[suffix] = val; break; } } if ((Object)(object)value == (Object)null) { return ""; } } string text2 = ((TMP_Text)value).text; if (string.IsNullOrEmpty(text2)) { return ""; } string[] array3 = text2.Split('\n'); if (rowIndex >= array3.Length) { return ""; } string text3 = array3[rowIndex]; if (text3.StartsWith("'); if (num > 0 && num + 1 < text3.Length) { text3 = text3.Substring(num + 1); } } return text3; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)$"[FlagCOOPHUD][v4] ExtractScoreRow({suffix},{rowIndex}) 예외: {ex.Message}"); } return ""; } } public static int GetCoopLeaderboardRowCount() { try { _cachedColumnTmps.TryGetValue("ScoreName", out var value); if ((Object)(object)value == (Object)null) { ExtractScoreRow("ScoreName", 0); _cachedColumnTmps.TryGetValue("ScoreName", out value); if ((Object)(object)value == (Object)null) { return 0; } } string text = ((TMP_Text)value).text; if (string.IsNullOrEmpty(text)) { return 0; } return text.Split('\n').Length; } catch { return 0; } } public static bool BuildCoopLeaderboardRow(int rowIndex, bool isKorean, out string nick, out string scoreText) { nick = ""; scoreText = ""; try { string text = ExtractScoreRow("ScoreName", rowIndex); if (string.IsNullOrEmpty(text)) { return false; } nick = StripSizeTags(text); int num = ParseCountFromScoreCell(ExtractScoreRow("ScoreCount", rowIndex)); int num2 = SumAllScoreCounts(); int num3 = ((num2 > 0) ? Mathf.Clamp(Mathf.RoundToInt((float)num * 100f / (float)num2), 0, 100) : 0); string arg = (isKorean ? $"{num}개" : $"{num}ea"); scoreText = $"{arg} {num3}%"; return true; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)$"[FlagCOOPHUD][v5] BuildCoopLeaderboardRow({rowIndex}) 예외: {ex.Message}"); } return false; } } private static int ParseCountFromScoreCell(string countRaw) { if (string.IsNullOrEmpty(countRaw)) { return 0; } int num = countRaw.IndexOf('개'); if (!int.TryParse(((num > 0) ? countRaw.Substring(0, num) : countRaw).Trim(), out var result)) { return 0; } return result; } private static int SumAllScoreCounts() { try { _cachedColumnTmps.TryGetValue("ScoreCount", out var value); if ((Object)(object)value == (Object)null) { ExtractScoreRow("ScoreCount", 0); _cachedColumnTmps.TryGetValue("ScoreCount", out value); if ((Object)(object)value == (Object)null) { return 0; } } string text = ((TMP_Text)value).text; if (string.IsNullOrEmpty(text)) { return 0; } int num = 0; string[] array = text.Split('\n'); foreach (string countRaw in array) { num += ParseCountFromScoreCell(countRaw); } return num; } catch { return 0; } } private static string StripSizeTags(string text) { if (string.IsNullOrEmpty(text)) { return text; } while (true) { int num = text.IndexOf("', num); if (num2 < 0) { break; } text = text.Remove(num, num2 - num + 1); } text = text.Replace("", "").Replace("", ""); return text; } public static bool ShouldShowLeaderboard() { return true; } } [HarmonyPatch(typeof(Campfire), "Light_Rpc")] public static class Patch_Campfire_Light_CoopStarReward { private const float FALLBACK_HEIGHT_OFFSET = 1.5f; [HarmonyPostfix] public static void Postfix(Campfire __instance) { //IL_0077: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00c1: Unknown result type (might be due to invalid IL or missing references) try { if (!PhotonNetwork.IsMasterClient || FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP || (Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).transform == (Object)null) { return; } int num = ComputeCurrentBiomePctCoop(); int num2 = ComputeStarCount(num); if (num2 < 3) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[v172.coop1] 모닥불 점화 — pct={num}%, 별={num2}개 (★★★ 미달, 보석 미지급)"); } return; } Vector3 val = ((Component)__instance).transform.position + Vector3.up * 1.5f; try { if ((Object)(object)PhotonNetwork.Instantiate("0_Items/Strange Gem", val, Quaternion.identity, (byte)0, (object[])null) != (Object)null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[v172.coop1] ★★★ 보상! pct={num}% — 보석 스폰 @ {val}"); } } else { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[v172.coop1] PhotonNetwork.Instantiate 결과 null — prefab 경로 확인 필요"); } } } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[v172.coop1] 보석 스폰 실패: " + ex.Message)); } } } catch (Exception ex2) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)("[v172.coop1] Patch_Campfire_Light_CoopStarReward 예외: " + ex2.Message)); } } } private static int ComputeCurrentBiomePctCoop() { try { int totalFlagCount = FlagSurvivalMulti.GetTotalFlagCount(); if (totalFlagCount <= 0) { return 0; } int num = 0; Dictionary flagCounts = FlagSurvivalMulti.GetFlagCounts(); if (flagCounts != null) { foreach (int value in flagCounts.Values) { num += value; } } if (num <= 0) { return 0; } int playerCount = 1; try { Player[] playerList = PhotonNetwork.PlayerList; if (playerList != null && playerList.Length != 0) { playerCount = playerList.Length; } } catch { } float coopTargetRatio = FlagSurvivalMulti.GetCoopTargetRatio(playerCount); float num2 = Mathf.Clamp(196f / ((float)totalFlagCount + 200f), 0.25f, 1f); int num3 = ApplyTargetBonus(Mathf.Max(1, Mathf.RoundToInt((float)totalFlagCount * coopTargetRatio * num2))); return Mathf.Clamp(Mathf.RoundToInt((float)num / (float)num3 * 100f), 0, 100); } catch { return 0; } } private static int ApplyTargetBonus(int targetCount) { if (targetCount <= 10) { return targetCount + 1; } if (targetCount <= 20) { return targetCount + 3; } if (targetCount <= 30) { return targetCount + 2; } if (targetCount <= 50) { return targetCount + 1; } return targetCount; } private static int ComputeStarCount(int pct) { if (pct >= 100) { return 3; } if (pct >= 67) { return 2; } if (pct >= 34) { return 1; } return 0; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.coordsrowthrottle", "Coords Row Throttle", "1.0.0")] public class FlagCoordsRowThrottlePlugin : BaseUnityPlugin { private void Awake() { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[CoordsThrottle] v2 활성: CoordsRunner.Update 0.05초 throttle (60Hz → 20Hz, 3배 절감)"); } } } [HarmonyPatch] public static class Patch_CoordsRunner_Update_Throttle { private const float THROTTLE_INTERVAL = 0.05f; private static float _lastTime = -1f; public static MethodBase TargetMethod() { Type type = AccessTools.TypeByName("FlagSurvival.FlagPlayerCoordsRowPlugin+CoordsRunner"); if (type == null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CoordsThrottle] CoordsRunner 타입 못 찾음 — FlagPlayerCoordsRow 모듈 누락? 패치 skip."); } return null; } MethodInfo methodInfo = AccessTools.Method(type, "Update", (Type[])null, (Type[])null); if (methodInfo == null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)"[CoordsThrottle] Update 메서드 못 찾음 — CoordsRunner 시그니처 변경?"); } return null; } return methodInfo; } [HarmonyPrefix] public static bool Prefix() { float realtimeSinceStartup = Time.realtimeSinceStartup; if (_lastTime > 0f && realtimeSinceStartup - _lastTime < 0.05f) { return false; } _lastTime = realtimeSinceStartup; return true; } } public static class FlagCountUI { private class UITick : MonoBehaviour { private float _nextUpdate; private void Update() { try { bool num = Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305); bool key = Input.GetKey((KeyCode)289); bool flag = num && key; if (flag != _uiTabHeld) { _uiTabHeld = flag; ApplyTabVisibility(); } } catch { } if (Time.realtimeSinceStartup < _nextUpdate) { return; } _nextUpdate = Time.realtimeSinceStartup + 0.5f; try { FlagSegmentScoring.HostUpdate(); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCountUI.Tick] [v172.s1] FlagSegmentScoring.HostUpdate 예외: " + ex.Message)); } } try { FlagTowingSystem.HostUpdate(); } catch (Exception ex2) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[FlagCountUI.Tick] [v172.t1] FlagTowingSystem.HostUpdate 예외: " + ex2.Message)); } } try { FlagFixedHUD.Update(); } catch (Exception ex3) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[FlagCountUI.Tick] [v172.hud1] FlagFixedHUD.Update 예외: " + ex3.Message)); } } if ((Object)(object)_uiObject == (Object)null || (Object)(object)_textName == (Object)null) { Transform val = null; if ((Object)(object)_ownCanvas != (Object)null) { val = ((Component)_ownCanvas).transform; } else if ((Object)(object)_lastGuiManagerTransform != (Object)null) { val = _lastGuiManagerTransform; } if ((Object)(object)val != (Object)null) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)"[FlagCountUI.Tick] UI destroy됨 — 재생성"); } CreateUI(val); } } else { Refresh(); } } } private const float UPDATE_INTERVAL = 0.5f; private const float FONT_SIZE = 33f; private const float FONT_SIZE_STAR = 27f; private const float FONT_SIZE_KR = 30f; private const float ANCHOR_X = -20f; private const float OFFSET_Y = 80f; private const float BOX_WIDTH = 900f; private const float BOX_HEIGHT = 240f; private const float BOX_GAP = 50f; private const float SCORE_BOX_HEIGHT = 240f; private const float SCORE_BOX_WIDTH = 1300f; private const float COL_X_SCORE_NAME = 0f; private const float COL_X_SCORE_COUNT = 280f; private const float COL_X_SCORE_PCT = 480f; private const float COL_X_SCORE_STAR = 600f; private const float COL_X_SCORE_MYDIST = 700f; private const float COL_X_SCORE_LEADGAP = 850f; private const float COL_X_SCORE_TOTAL = 1000f; private const float COL_X_SCORE_BONUS = 1150f; private const float COL_X_NAME = 0f; private const float COL_X_TOP = 200f; private const float COL_X_COUNT = 480f; private const float COL_X_PCT = 600f; private const float COL_X_STAR = 680f; private const float COL_X_DEBUG = 800f; private static GameObject _uiObject; private static GameObject _scoreObject; private static bool _uiAllowedByTrigger = false; private static bool _uiTabHeld = false; private static TextMeshProUGUI _textName; private static TextMeshProUGUI _textCount; private static TextMeshProUGUI _textPct; private static TextMeshProUGUI _textStar; private static TextMeshProUGUI _textTop; private static TextMeshProUGUI _textDebug; private static TextMeshProUGUI _scoreName; private static TextMeshProUGUI _scoreCount; private static TextMeshProUGUI _scorePct; private static TextMeshProUGUI _scoreStar; private static TextMeshProUGUI _scoreMyDist; private static TextMeshProUGUI _scoreLeadGap; private static TextMeshProUGUI _scoreTotal; private static TextMeshProUGUI _scoreBonus; private static bool _segmentRankHandlerRegistered = false; private static int _lastTrackedSegmentForReset = -1; private static UITick _tickInstance; private static int _lastSig = -1; private static Transform _lastGuiManagerTransform; private static Canvas _ownCanvas; private static readonly Vector3 PEAK_SUMMIT_POSITION = new Vector3(19.5f, 1228.7f, 2242.5f); public static void OnGUIManagerStarted(MonoBehaviour guiManager) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) try { Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name == "Airport") { FlagEndCutsceneState.IsActive = false; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[FlagCountUI] Airport 씬 — UI 그대로 유지 (1등 결과 보존) + 엔드 컷씬 UI 숨김 해제"); } } else { if ((Object)(object)guiManager == (Object)null) { return; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)("[FlagCountUI] OnGUIManagerStarted 진입 — scene=" + name + " (트리거 발동까지 UI 숨김 유지)")); } try { FlagSurvivalMulti.ResetFlagRegistry(); } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[FlagCountUI] [v83] FlagSurvivalMulti.ResetFlagRegistry 실패: " + ex.Message)); } } try { FlagSegmentScoring.ResetAllScores(); FlagTowingSystem.ResetAllBonuses(); FlagWinnerCalculator.ClearCachedWinners(); FlagWinnerCalculator.ClearCachedLoserSlots(); FlagDeathRespawn.ResetAll(); ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogInfo((object)"[FlagCountUI] [v172.s4] 새 게임 진입 — 점수/winner/loser/부활 캐시 강제 리셋"); } } catch (Exception ex2) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)("[FlagCountUI] [v172.s4] 점수 리셋 실패: " + ex2.Message)); } } try { FlagSurvivalNetwork.ResetShoreState(); ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogInfo((object)"[FlagCountUI] [v172] 해안 게이팅 상태 리셋 (ResetShoreState 호출) — 다음 게임 ready 신호 정상 수신 보장"); } } catch (Exception ex3) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)("[FlagCountUI] [v172] FlagSurvivalNetwork.ResetShoreState 실패: " + ex3.Message)); } } if (!_segmentRankHandlerRegistered) { try { FlagSurvivalNetwork.OnSegmentRankReceived = (Action)Delegate.Combine(FlagSurvivalNetwork.OnSegmentRankReceived, (Action)delegate(int seg, int actor, int rank) { FlagSegmentScoring.SetSegmentRank(seg, actor, rank); }); _segmentRankHandlerRegistered = true; ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogInfo((object)"[FlagCountUI] [v172.s1] OnSegmentRankReceived 핸들러 등록 완료"); } } catch (Exception ex4) { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogError((object)("[FlagCountUI] [v172.s1] OnSegmentRankReceived 핸들러 등록 실패: " + ex4.Message)); } } } _lastGuiManagerTransform = ((Component)guiManager).transform; SetUIVisible(visible: false); } } catch (Exception ex5) { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogError((object)("[FlagCountUI] OnGUIManagerStarted 실패: " + ex5.Message + "\n" + ex5.StackTrace)); } } } public static void OnTriggerReachedShowUI() { try { _uiAllowedByTrigger = true; if ((Object)(object)_uiObject == (Object)null) { if ((Object)(object)_lastGuiManagerTransform == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[FlagCountUI] OnTriggerReachedShowUI — _lastGuiManagerTransform 없음 (자체 캔버스로 생성)"); } } CreateUI(_lastGuiManagerTransform); EnsureTickInstance(); ApplyTabVisibility(); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[FlagCountUI] 첫 트리거 — UI 생성 (Tab 누름 시 표시)"); } } else { ApplyTabVisibility(); ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[FlagCountUI] 트리거 — UI 재사용 (Tab 누름 시 표시)"); } } } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[FlagCountUI] OnTriggerReachedShowUI 실패: " + ex.Message)); } } } public static void SetUIHidden() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) try { Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "Airport") { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[FlagCountUI] Airport 씬 — SetUIHidden 무시 (UI 유지, 1등 결과 보존)"); } return; } } catch { } SetUIVisible(visible: false); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)"[FlagCountUI] 시작 저주 부여 — UI 숨김"); } } private static void SetUIVisible(bool visible) { if ((Object)(object)_uiObject != (Object)null) { _uiObject.SetActive(visible); } if ((Object)(object)_scoreObject != (Object)null) { _scoreObject.SetActive(visible); } } private static void ApplyTabVisibility() { //IL_001c: 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) if (!((Object)(object)_uiObject == (Object)null) || !((Object)(object)_scoreObject == (Object)null)) { bool flag; try { Scene activeScene = SceneManager.GetActiveScene(); flag = ((((Scene)(ref activeScene)).name == "Airport") ? _uiTabHeld : (_uiAllowedByTrigger && _uiTabHeld)); } catch { flag = _uiTabHeld; } if ((Object)(object)_uiObject != (Object)null && _uiObject.activeSelf != flag) { _uiObject.SetActive(flag); } if ((Object)(object)_scoreObject != (Object)null && _scoreObject.activeSelf != flag) { _scoreObject.SetActive(flag); } } } private static TextMeshProUGUI FindEnglishTextTMP() { TextMeshProUGUI[] array = Object.FindObjectsOfType(); if (array == null || array.Length == 0) { return null; } TextMeshProUGUI val = null; TextMeshProUGUI[] array2 = array; foreach (TextMeshProUGUI val2 in array2) { if ((Object)(object)val2 == (Object)null || (Object)(object)((TMP_Text)val2).font == (Object)null) { continue; } string text = ((TMP_Text)val2).text; if (string.IsNullOrEmpty(text)) { if ((Object)(object)val == (Object)null) { val = val2; } continue; } bool flag = true; string text2 = text; for (int j = 0; j < text2.Length; j++) { if (text2[j] > '\u007f') { flag = false; break; } } if (flag) { return val2; } if ((Object)(object)val == (Object)null) { val = val2; } } return val; } private static void CreateUI(Transform parent) { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_013a: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01f6: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_uiObject != (Object)null) { Object.Destroy((Object)(object)_uiObject); _uiObject = null; } if ((Object)(object)_scoreObject != (Object)null) { Object.Destroy((Object)(object)_scoreObject); _scoreObject = null; } _textName = (_textCount = (_textPct = (_textStar = null))); _textTop = (_textDebug = null); TextMeshProUGUI val = FindEnglishTextTMP(); if ((Object)(object)val == (Object)null) { val = Object.FindObjectOfType(); } if ((Object)(object)val == (Object)null || (Object)(object)((TMP_Text)val).font == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[FlagCountUI] 폰트 빌려올 TMP 없음"); } return; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)("[FlagCountUI] 폰트 빌려옴: " + ((Object)((TMP_Text)val).font).name + " (from " + ((Object)val).name + ", text='" + ((TMP_Text)val).text + "')")); } Canvas componentInParent = ((Component)parent).GetComponentInParent(); Transform val2; int layer; if ((Object)(object)componentInParent != (Object)null) { val2 = parent; layer = ((Component)componentInParent).gameObject.layer; } else { if ((Object)(object)_ownCanvas == (Object)null) { GameObject val3 = new GameObject("FlagSurvival_FlagCountCanvas"); Object.DontDestroyOnLoad((Object)val3); _ownCanvas = val3.AddComponent(); _ownCanvas.renderMode = (RenderMode)0; _ownCanvas.sortingOrder = 100; val3.AddComponent(); val3.AddComponent(); int num = LayerMask.NameToLayer("UI"); val3.layer = ((num >= 0) ? num : 5); } val2 = ((Component)_ownCanvas).transform; layer = ((Component)_ownCanvas).gameObject.layer; } _uiObject = new GameObject("FlagSurvival_FlagCountContainer", new Type[1] { typeof(RectTransform) }); _uiObject.transform.SetParent(val2, false); _uiObject.layer = layer; RectTransform component = _uiObject.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = new Vector2(-20f, -80f); component.sizeDelta = new Vector2(900f, 240f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; CreateBoxBorder(component, layer, "BiomeBoxBorder"); _textName = CreateColumnTMP("Name", component, val, layer, 0f, 30f); _textCount = CreateColumnTMP("Count", component, val, layer, 480f, 33f); _textPct = CreateColumnTMP("Pct", component, val, layer, 600f, 33f); _textStar = CreateColumnTMP("Star", component, val, layer, 680f, 27f); _textTop = CreateColumnTMP("Top", component, val, layer, 200f, 30f); _textDebug = CreateColumnTMP("Debug", component, val, layer, 800f, 33f); _scoreObject = new GameObject("FlagSurvival_ScoreContainer", new Type[1] { typeof(RectTransform) }); _scoreObject.transform.SetParent(val2, false); _scoreObject.layer = layer; RectTransform component2 = _scoreObject.GetComponent(); component2.anchorMin = new Vector2(1f, 1f); component2.anchorMax = new Vector2(1f, 1f); component2.pivot = new Vector2(1f, 1f); component2.anchoredPosition = new Vector2(-20f, -370f); component2.sizeDelta = new Vector2(1300f, 240f); ((Transform)component2).localScale = Vector3.one; ((Transform)component2).localRotation = Quaternion.identity; CreateBoxBorder(component2, layer, "ScoreBoxBorder"); _scoreName = CreateColumnTMP("ScoreName", component2, val, layer, 0f, 30f); _scoreCount = CreateColumnTMP("ScoreCount", component2, val, layer, 280f, 33f); _scorePct = CreateColumnTMP("ScorePct", component2, val, layer, 480f, 33f); _scoreStar = CreateColumnTMP("ScoreStar", component2, val, layer, 600f, 27f); _scoreMyDist = CreateColumnTMP("ScoreMyDist", component2, val, layer, 700f, 33f); _scoreLeadGap = CreateColumnTMP("ScoreLeadGap", component2, val, layer, 850f, 33f); _scoreTotal = CreateColumnTMP("ScoreTotal", component2, val, layer, 1000f, 33f); _scoreBonus = CreateColumnTMP("ScoreBonus", component2, val, layer, 1150f, 33f); _lastSig = -1; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[FlagCountUI] UI 생성 완료 — 박스1(바이옴)={900f}×{240f}, 박스2(스코어)={1300f}×{240f}, parent={((Object)val2).name}"); } try { FlagFixedHUD.OnGUIManagerStarted(val); } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[FlagCountUI] [v172.hud1] FlagFixedHUD 초기화 실패: " + ex.Message)); } } } private static void CreateBoxBorder(RectTransform parent, int layer, string nameSuffix) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) //IL_005f: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(1f, 1f, 1f, 0.6f); CreateBorderEdge(parent, layer, nameSuffix + "_Top", new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), 0f, 2f, color); CreateBorderEdge(parent, layer, nameSuffix + "_Bottom", new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 0f), 0f, 2f, color); CreateBorderEdge(parent, layer, nameSuffix + "_Left", new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(0f, 0.5f), 2f, 0f, color); CreateBorderEdge(parent, layer, nameSuffix + "_Right", new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(1f, 0.5f), 2f, 0f, color); } private static void CreateBorderEdge(RectTransform parent, int layer, string name, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, float widthPx, float heightPx, Color color) { //IL_002e: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0055: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }); val.transform.SetParent((Transform)(object)parent, false); val.layer = layer; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; component.pivot = pivot; component.anchoredPosition = Vector2.zero; component.sizeDelta = new Vector2(widthPx, heightPx); ((Transform)component).localScale = Vector3.one; Image component2 = val.GetComponent(); ((Graphic)component2).color = color; ((Graphic)component2).raycastTarget = false; } private static TextMeshProUGUI CreateColumnTMP(string suffix, RectTransform parent, TextMeshProUGUI sourceTmp, int layer, float xOffset, float fontSize) { //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00b3: 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) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FlagSurvival_FlagCountText_" + suffix, new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI) }); val.transform.SetParent((Transform)(object)parent, false); val.layer = layer; RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 1f); component.anchoredPosition = new Vector2(xOffset, 0f); component.sizeDelta = new Vector2(900f, 240f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; TextMeshProUGUI component2 = val.GetComponent(); ((TMP_Text)component2).font = ((TMP_Text)sourceTmp).font; ((TMP_Text)component2).fontSize = fontSize; ((TMP_Text)component2).alignment = (TextAlignmentOptions)513; ((Graphic)component2).color = ((Graphic)sourceTmp).color; try { Material fontMaterial = ((TMP_Text)sourceTmp).fontMaterial; if ((Object)(object)fontMaterial != (Object)null) { if (suffix == "Name") { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("[FlagCountUI] 머티리얼='" + ((Object)fontMaterial).name + "', shader='" + ((Object)fontMaterial.shader).name + "'\n"); if (fontMaterial.HasProperty("_OutlineColor")) { stringBuilder.Append(string.Format(" _OutlineColor={0}\n", fontMaterial.GetColor("_OutlineColor"))); } if (fontMaterial.HasProperty("_OutlineWidth")) { stringBuilder.Append(string.Format(" _OutlineWidth={0}\n", fontMaterial.GetFloat("_OutlineWidth"))); } if (fontMaterial.HasProperty("_UnderlayColor")) { stringBuilder.Append(string.Format(" _UnderlayColor={0}\n", fontMaterial.GetColor("_UnderlayColor"))); } if (fontMaterial.HasProperty("_UnderlayOffsetX")) { stringBuilder.Append(string.Format(" _UnderlayOffsetX={0}\n", fontMaterial.GetFloat("_UnderlayOffsetX"))); } if (fontMaterial.HasProperty("_UnderlayOffsetY")) { stringBuilder.Append(string.Format(" _UnderlayOffsetY={0}\n", fontMaterial.GetFloat("_UnderlayOffsetY"))); } if (fontMaterial.HasProperty("_UnderlayDilate")) { stringBuilder.Append(string.Format(" _UnderlayDilate={0}\n", fontMaterial.GetFloat("_UnderlayDilate"))); } if (fontMaterial.HasProperty("_UnderlaySoftness")) { stringBuilder.Append(string.Format(" _UnderlaySoftness={0}\n", fontMaterial.GetFloat("_UnderlaySoftness"))); } if (fontMaterial.HasProperty("_Bevel")) { stringBuilder.Append(string.Format(" _Bevel={0}\n", fontMaterial.GetFloat("_Bevel"))); } if (fontMaterial.HasProperty("_GlowColor")) { stringBuilder.Append(string.Format(" _GlowColor={0}\n", fontMaterial.GetColor("_GlowColor"))); } stringBuilder.Append(" shaderKeywords=[" + string.Join(", ", fontMaterial.shaderKeywords) + "]"); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)stringBuilder.ToString()); } } ((TMP_Text)component2).outlineColor = Color32.op_Implicit(new Color(0.596f, 0.58f, 0.549f, 1f)); ((TMP_Text)component2).outlineWidth = 0.05f; if ((Object)(object)((TMP_Text)component2).font != (Object)null && ((TMP_Text)component2).font.fallbackFontAssetTable != null) { foreach (TMP_FontAsset item in ((TMP_Text)component2).font.fallbackFontAssetTable) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((TMP_Asset)item).material == (Object)null)) { if (((TMP_Asset)item).material.HasProperty("_OutlineColor")) { ((TMP_Asset)item).material.SetColor("_OutlineColor", new Color(0.596f, 0.58f, 0.549f, 1f)); } if (((TMP_Asset)item).material.HasProperty("_OutlineWidth")) { ((TMP_Asset)item).material.SetFloat("_OutlineWidth", 0.1f); } } } } if (((TMP_Text)component2).fontMaterial.HasProperty("_UnderlayColor")) { ((TMP_Text)component2).fontMaterial.SetColor("_UnderlayColor", new Color(0f, 0f, 0f, 0.4f)); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlayOffsetX", 0f); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlayOffsetY", 0f); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlayDilate", 0.1f); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlaySoftness", 0.4f); ((TMP_Text)component2).fontMaterial.EnableKeyword("UNDERLAY_ON"); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)("[FlagCountUI.Col-" + suffix + "] underlay 적용 (PEAK 중앙 발산 스타일)")); } } else { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)("[FlagCountUI.Col-" + suffix + "] 머티리얼이 underlay 미지원 — 그림자 효과 X")); } } } } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)("[FlagCountUI.Col-" + suffix + "] outline 추출 실패: " + ex.Message)); } } ((TMP_Text)component2).text = ""; ((Graphic)component2).raycastTarget = false; ((TMP_Text)component2).enableWordWrapping = false; ((TMP_Text)component2).enableAutoSizing = false; ((TMP_Text)component2).autoSizeTextContainer = false; ((TMP_Text)component2).paragraphSpacing = 0f; ((TMP_Text)component2).lineSpacing = 0f; return component2; } private static void EnsureTickInstance() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown if ((Object)(object)_tickInstance != (Object)null) { return; } try { GameObject val = new GameObject("FlagSurvival_FlagCountUI_Tick"); Object.DontDestroyOnLoad((Object)val); _tickInstance = val.AddComponent(); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCountUI] Tick 생성 실패: " + ex.Message)); } } } private static void Refresh() { if ((Object)(object)_textName == (Object)null || (Object)(object)_textCount == (Object)null || (Object)(object)_textPct == (Object)null || (Object)(object)_textStar == (Object)null || (Object)(object)_textTop == (Object)null || (Object)(object)_uiObject == (Object)null) { return; } string[] array = new string[5] { "해안", "뿌리숲/열대", "메사/고산", "칼데라", "가마" }; Dictionary dictionary = new Dictionary(); foreach (FlagSurvivalMulti.BiomeStats allBiomeStat in FlagSurvivalMulti.GetAllBiomeStats()) { dictionary[allBiomeStat.segmentIndex] = allBiomeStat; } int currentSegmentIndex = FlagSurvivalMulti.GetCurrentSegmentIndex(); string currentBiome = FlagSurvivalMulti.GetCurrentBiome(); string currentBiomeTitle = FlagSurvivalMulti.GetCurrentBiomeTitle(); int totalFlagCount = FlagSurvivalMulti.GetTotalFlagCount(); int reachableFlagCount = FlagSurvivalMulti.GetReachableFlagCount(); Dictionary flagCounts = FlagSurvivalMulti.GetFlagCounts(); int num = 0; foreach (KeyValuePair item3 in flagCounts) { num += item3.Value; } List<(string, int)> list = new List<(string, int)>(); try { Player[] playerList = PhotonNetwork.PlayerList; if (playerList != null && playerList.Length != 0) { Player[] array2 = playerList; foreach (Player val in array2) { if (val != null) { flagCounts.TryGetValue(val.ActorNumber, out var value); string item = (string.IsNullOrEmpty(val.NickName) ? $"P{val.ActorNumber}" : val.NickName); list.Add((item, value)); } } } else { int key = ((PhotonNetwork.LocalPlayer == null) ? 1 : PhotonNetwork.LocalPlayer.ActorNumber); flagCounts.TryGetValue(key, out var value2); string item2 = ((PhotonNetwork.LocalPlayer != null && !string.IsNullOrEmpty(PhotonNetwork.LocalPlayer.NickName)) ? PhotonNetwork.LocalPlayer.NickName : "나"); list.Add((item2, value2)); } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCountUI] 플레이어 데이터 수집 실패: " + ex.Message)); } } list.Sort(delegate((string name, int count) a, (string name, int count) b) { int num18 = b.count.CompareTo(a.count); return (num18 != 0) ? num18 : string.Compare(a.name, b.name, StringComparison.Ordinal); }); string text = ""; int num2 = 0; if (flagCounts.Count > 0) { int num3 = 0; List list2 = new List(); foreach (KeyValuePair item4 in flagCounts) { if (item4.Value > num3) { num3 = item4.Value; list2.Clear(); list2.Add(item4.Key); } else if (item4.Value == num3 && num3 > 0) { list2.Add(item4.Key); } } num2 = num3; if (num3 > 0) { List list3 = new List(); try { Player[] playerList2 = PhotonNetwork.PlayerList; if (playerList2 != null) { foreach (int item5 in list2) { Player[] array2 = playerList2; foreach (Player val2 in array2) { if (val2 != null && val2.ActorNumber == item5) { list3.Add(string.IsNullOrEmpty(val2.NickName) ? $"P{item5}" : val2.NickName); break; } } } } } catch { } text = string.Join(",", list3); } } int num4 = 17; num4 = num4 * 31 + currentSegmentIndex; num4 = num4 * 31 + totalFlagCount; num4 = num4 * 31 + reachableFlagCount; num4 = num4 * 31 + num; num4 = num4 * 31 + text.GetHashCode(); num4 = num4 * 31 + num2; num4 = num4 * 31 + currentBiomeTitle.GetHashCode(); num4 = (int)(num4 * 31 + FlagSurvivalNetwork.CurrentMultiplayerMode); int num5 = 1; try { Player[] playerList3 = PhotonNetwork.PlayerList; if (playerList3 != null) { num5 = playerList3.Length; } } catch { } num4 = num4 * 31 + num5; foreach (KeyValuePair item6 in dictionary) { num4 = num4 * 31 + item6.Key + item6.Value.totalConsumed; } foreach (var item7 in list) { num4 = num4 * 31 + item7.Item1.GetHashCode() + item7.Item2; } try { Dictionary dictionary2 = ComputeCampfireDistances(); if (dictionary2 != null) { foreach (float value10 in dictionary2.Values) { num4 = num4 * 31 + (int)(value10 * 10f); } } } catch { } try { if (PhotonNetwork.PlayerList != null) { Player[] array2 = PhotonNetwork.PlayerList; foreach (Player val3 in array2) { if (val3 != null) { num4 = num4 * 31 + (int)(FlagSegmentScoring.GetTotalScoreFloat(val3.ActorNumber) * 10f); num4 = num4 * 31 + (int)(FlagTowingSystem.GetAppliedBonusPercent(val3.ActorNumber) * 10f); } } } } catch { } if (num4 == _lastSig) { return; } _lastSig = num4; StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder2 = new StringBuilder(); StringBuilder stringBuilder3 = new StringBuilder(); StringBuilder stringBuilder4 = new StringBuilder(); StringBuilder stringBuilder5 = new StringBuilder(); StringBuilder stringBuilder6 = new StringBuilder(); for (int j = 0; j < 5; j++) { if (j > 0) { stringBuilder.Append('\n'); stringBuilder2.Append('\n'); stringBuilder3.Append('\n'); stringBuilder4.Append('\n'); stringBuilder5.Append('\n'); stringBuilder6.Append('\n'); } stringBuilder4.Append(""); int num6 = 0; string text2 = ""; int num7 = 0; bool flag = false; int pct = 0; string text3; int num8; int num9; if (j == currentSegmentIndex) { text3 = ((!string.IsNullOrEmpty(currentBiomeTitle)) ? currentBiomeTitle : ((!string.IsNullOrEmpty(currentBiome)) ? currentBiome : array[j])); num8 = totalFlagCount; num9 = num; text2 = text; num6 = num2; if (num8 > 0) { int num10 = Mathf.Max(1, Mathf.RoundToInt((float)num8 * 0.2f)); pct = Mathf.Clamp(Mathf.RoundToInt((float)num2 / (float)num10 * 100f), 0, 100); } } else { if (!dictionary.TryGetValue(j, out var value3)) { stringBuilder.Append("???"); stringBuilder2.Append("0/??"); stringBuilder3.Append("0%"); stringBuilder4.Append(GetStars(0)); stringBuilder5.Append("???"); stringBuilder6.Append("?"); continue; } text3 = ((!string.IsNullOrEmpty(value3.title)) ? value3.title : ((!string.IsNullOrEmpty(value3.biomeName)) ? value3.biomeName : array[j])); num8 = value3.totalFlags; num9 = value3.totalConsumed; text2 = value3.topPlayerName ?? ""; num7 = value3.pctAtBackup; flag = true; if (value3.playerCounts != null && value3.playerCounts.Count > 0) { int num11 = 0; foreach (int value11 in value3.playerCounts.Values) { if (value11 > num11) { num11 = value11; } } num6 = num11; if (value3.playerPctsAtBackup != null) { int num12 = -1; foreach (KeyValuePair playerCount in value3.playerCounts) { if (playerCount.Value == num11) { num12 = playerCount.Key; break; } } if (num12 >= 0 && value3.playerPctsAtBackup.TryGetValue(num12, out var value4)) { pct = value4; } } } } bool num13 = FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP; if (!flag) { num7 = ComputeBiomePct(num9, num8, num6); } stringBuilder.Append(WrapByLang(text3)); if (num13) { stringBuilder2.Append(num6).Append('개'); stringBuilder4.Append(GetStars(pct)); } else { int value6; if (flag && dictionary.TryGetValue(j, out var value5)) { value6 = value5.targetCountAtBackup; } else { float num14 = ComputeWeightRatio(num8); float coopBaseRatio = GetCoopBaseRatio(); value6 = ApplyTargetBonus(Mathf.Max(1, Mathf.RoundToInt((float)num8 * coopBaseRatio * num14))); } stringBuilder2.Append(num9).Append('/').Append(value6); stringBuilder4.Append(GetStars(num7)); } stringBuilder3.Append(num7).Append('%'); string text4 = (string.IsNullOrEmpty(text2) ? "???" : text2); stringBuilder5.Append(WrapByLang(text4)); stringBuilder6.Append(num8); } StringBuilder stringBuilder7 = new StringBuilder(64); StringBuilder stringBuilder8 = new StringBuilder(64); StringBuilder stringBuilder9 = new StringBuilder(64); StringBuilder stringBuilder10 = new StringBuilder(64); StringBuilder stringBuilder11 = new StringBuilder(64); StringBuilder stringBuilder12 = new StringBuilder(64); StringBuilder stringBuilder13 = new StringBuilder(64); StringBuilder stringBuilder14 = new StringBuilder(64); Dictionary dictionary3 = ComputeCampfireDistances(); float num15 = 0f; bool flag2 = dictionary3.Count > 0; if (flag2) { num15 = float.MaxValue; foreach (float value12 in dictionary3.Values) { if (value12 < num15) { num15 = value12; } } } Dictionary dictionary4 = new Dictionary(); try { if (PhotonNetwork.PlayerList != null) { Player[] array2 = PhotonNetwork.PlayerList; foreach (Player val4 in array2) { if (val4 != null) { string key2 = (string.IsNullOrEmpty(val4.NickName) ? $"P{val4.ActorNumber}" : val4.NickName); dictionary4[key2] = val4.ActorNumber; } } } } catch { } for (int k = 0; k < list.Count; k++) { if (k > 0) { stringBuilder7.Append('\n'); stringBuilder8.Append('\n'); stringBuilder9.Append('\n'); stringBuilder10.Append('\n'); stringBuilder11.Append('\n'); stringBuilder12.Append('\n'); stringBuilder13.Append('\n'); stringBuilder14.Append('\n'); } stringBuilder10.Append(""); int num16 = ComputePlayerPct(list[k].Item2, totalFlagCount); stringBuilder7.Append(WrapByLang(list[k].Item1)); stringBuilder8.Append(list[k].Item2).Append('개'); stringBuilder9.Append(num16).Append('%'); stringBuilder10.Append(GetStars(num16)); if (flag2 && dictionary4.TryGetValue(list[k].Item1, out var value7) && dictionary3.TryGetValue(value7, out var value8)) { float num17 = num15 - value8; stringBuilder11.Append(value8.ToString("F1")).Append('m'); if (Mathf.Abs(num17) < 0.05f) { stringBuilder12.Append('0'); } else { stringBuilder12.Append(num17.ToString("F1")).Append('m'); } stringBuilder13.Append(FlagSegmentScoring.GetTotalScoreFloat(value7).ToString("F1")); float appliedBonusPercent = FlagTowingSystem.GetAppliedBonusPercent(value7); if (appliedBonusPercent < 0.05f) { stringBuilder14.Append('0'); } else { stringBuilder14.Append('+').Append(appliedBonusPercent.ToString("F1")).Append('%'); } continue; } stringBuilder11.Append('-'); stringBuilder12.Append('-'); if (dictionary4.TryGetValue(list[k].Item1, out var value9)) { stringBuilder13.Append(FlagSegmentScoring.GetTotalScoreFloat(value9).ToString("F1")); float appliedBonusPercent2 = FlagTowingSystem.GetAppliedBonusPercent(value9); if (appliedBonusPercent2 < 0.05f) { stringBuilder14.Append('0'); } else { stringBuilder14.Append('+').Append(appliedBonusPercent2.ToString("F1")).Append('%'); } } else { stringBuilder13.Append('-'); stringBuilder14.Append('-'); } } ((TMP_Text)_textName).text = stringBuilder.ToString(); ((TMP_Text)_textCount).text = stringBuilder2.ToString(); ((TMP_Text)_textPct).text = stringBuilder3.ToString(); ((TMP_Text)_textStar).text = stringBuilder4.ToString(); ((TMP_Text)_textTop).text = stringBuilder5.ToString(); ((TMP_Text)_textDebug).text = stringBuilder6.ToString(); ((TMP_Text)_scoreName).text = stringBuilder7.ToString(); ((TMP_Text)_scoreCount).text = stringBuilder8.ToString(); ((TMP_Text)_scorePct).text = stringBuilder9.ToString(); ((TMP_Text)_scoreStar).text = stringBuilder10.ToString(); if ((Object)(object)_scoreMyDist != (Object)null) { ((TMP_Text)_scoreMyDist).text = stringBuilder11.ToString(); } if ((Object)(object)_scoreLeadGap != (Object)null) { ((TMP_Text)_scoreLeadGap).text = stringBuilder12.ToString(); } if ((Object)(object)_scoreTotal != (Object)null) { ((TMP_Text)_scoreTotal).text = stringBuilder13.ToString(); } if ((Object)(object)_scoreBonus != (Object)null) { ((TMP_Text)_scoreBonus).text = stringBuilder14.ToString(); } ApplyDynamicColumnLayout(80f); ApplyScoreColumnLayout(80f); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[FlagCountUI.Refresh] 박스1(바이옴5행) + 박스2(스코어{list.Count}행) 갱신: currentSeg={currentSegmentIndex}({currentBiome}), top={text}"); } } private static void ApplyDynamicColumnLayout(float gap) { if ((Object)(object)_textName == (Object)null || (Object)(object)_textTop == (Object)null || (Object)(object)_textCount == (Object)null || (Object)(object)_textPct == (Object)null || (Object)(object)_textStar == (Object)null) { return; } try { ((TMP_Text)_textName).ForceMeshUpdate(false, false); ((TMP_Text)_textTop).ForceMeshUpdate(false, false); ((TMP_Text)_textCount).ForceMeshUpdate(false, false); ((TMP_Text)_textPct).ForceMeshUpdate(false, false); if ((Object)(object)_textStar != (Object)null) { ((TMP_Text)_textStar).ForceMeshUpdate(false, false); } float num = 0f; float num2 = num + ((TMP_Text)_textName).preferredWidth + gap; float num3 = num2 + ((TMP_Text)_textTop).preferredWidth + gap; float num4 = num3 + ((TMP_Text)_textCount).preferredWidth + gap; float num5 = num4 + ((TMP_Text)_textPct).preferredWidth + gap; float x = num5 + (((Object)(object)_textStar != (Object)null) ? ((TMP_Text)_textStar).preferredWidth : 0f) + gap; SetColumnX(_textName, num, 900f, 240f); SetColumnX(_textTop, num2, 900f, 240f); SetColumnX(_textCount, num3, 900f, 240f); SetColumnX(_textPct, num4, 900f, 240f); SetColumnX(_textStar, num5, 900f, 240f); if ((Object)(object)_textDebug != (Object)null) { SetColumnX(_textDebug, x, 900f, 240f); } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCountUI] 동적 컬럼 레이아웃 실패: " + ex.Message)); } } } private static void ApplyScoreColumnLayout(float gap) { if ((Object)(object)_scoreName == (Object)null || (Object)(object)_scoreCount == (Object)null || (Object)(object)_scorePct == (Object)null || (Object)(object)_scoreStar == (Object)null) { return; } try { ((TMP_Text)_scoreName).ForceMeshUpdate(false, false); ((TMP_Text)_scoreCount).ForceMeshUpdate(false, false); ((TMP_Text)_scorePct).ForceMeshUpdate(false, false); float num = 0f; float num2 = num + ((TMP_Text)_scoreName).preferredWidth + gap; float num3 = num2 + ((TMP_Text)_scoreCount).preferredWidth + gap; float num4 = num3 + ((TMP_Text)_scorePct).preferredWidth + gap; SetColumnX(_scoreName, num, 1300f, 240f); SetColumnX(_scoreCount, num2, 1300f, 240f); SetColumnX(_scorePct, num3, 1300f, 240f); SetColumnX(_scoreStar, num4, 1300f, 240f); if (!((Object)(object)_scoreMyDist != (Object)null) || !((Object)(object)_scoreLeadGap != (Object)null)) { return; } ((TMP_Text)_scoreStar).ForceMeshUpdate(false, false); ((TMP_Text)_scoreMyDist).ForceMeshUpdate(false, false); float num5 = num4 + ((TMP_Text)_scoreStar).preferredWidth + gap; float num6 = num5 + ((TMP_Text)_scoreMyDist).preferredWidth + gap; SetColumnX(_scoreMyDist, num5, 1300f, 240f); SetColumnX(_scoreLeadGap, num6, 1300f, 240f); if ((Object)(object)_scoreTotal != (Object)null) { ((TMP_Text)_scoreLeadGap).ForceMeshUpdate(false, false); float num7 = num6 + ((TMP_Text)_scoreLeadGap).preferredWidth + gap; SetColumnX(_scoreTotal, num7, 1300f, 240f); if ((Object)(object)_scoreBonus != (Object)null) { ((TMP_Text)_scoreTotal).ForceMeshUpdate(false, false); float x = num7 + ((TMP_Text)_scoreTotal).preferredWidth + gap; SetColumnX(_scoreBonus, x, 1300f, 240f); } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCountUI] 스코어보드 컬럼 레이아웃 실패: " + ex.Message)); } } } private static Dictionary ComputeCampfireDistances() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_00a1: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); try { Campfire val = null; try { val = MapHandler.CurrentCampfire; } catch { val = null; } Vector3 val2 = ((!((Object)(object)val != (Object)null) || !((Object)(object)((Component)val).transform != (Object)null)) ? PEAK_SUMMIT_POSITION : ((Component)val).transform.position); List allCharacters = Character.AllCharacters; if (allCharacters == null) { return dictionary; } foreach (Character item in allCharacters) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((MonoBehaviourPun)item).photonView == (Object)null) && ((MonoBehaviourPun)item).photonView.Owner != null) { int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; float value = Vector3.Distance(val2, item.Center) * CharacterStats.unitsToMeters; dictionary[actorNumber] = value; } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagCountUI] [v172] 모닥불 거리 산출 실패: " + ex.Message)); } } return dictionary; } private static void SetColumnX(TextMeshProUGUI tmp, float x, float boxWidth, float boxHeight) { //IL_0022: 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) if (!((Object)(object)tmp == (Object)null)) { RectTransform rectTransform = ((TMP_Text)tmp).rectTransform; if (!((Object)(object)rectTransform == (Object)null)) { rectTransform.anchoredPosition = new Vector2(x, 0f); rectTransform.sizeDelta = new Vector2(boxWidth, boxHeight); } } } private static string GetStars(int pct) { if (pct >= 100) { return "★★★"; } if (pct >= 67) { return "★★☆"; } if (pct >= 34) { return "★☆☆"; } return "☆☆☆"; } private static string WrapByLang(string text) { if (string.IsNullOrEmpty(text)) { return text; } bool flag = false; foreach (char c in text) { if ((c >= '가' && c <= '힣') || (c >= 'ᄀ' && c <= 'ᇿ') || (c >= '\u3130' && c <= '\u318f')) { flag = true; break; } } if (flag) { return text; } return "" + text + ""; } private static float ComputeWeightRatio(int totalFlags) { if (totalFlags <= 0) { return 1f; } return Mathf.Clamp(196f / ((float)totalFlags + 200f), 0.25f, 1f); } private static int ApplyTargetBonus(int targetCount) { if (targetCount <= 10) { return targetCount + 1; } if (targetCount <= 20) { return targetCount + 3; } if (targetCount <= 30) { return targetCount + 2; } if (targetCount <= 50) { return targetCount + 1; } return targetCount; } private static float GetCoopBaseRatio() { int playerCount = 1; try { Player[] playerList = PhotonNetwork.PlayerList; if (playerList != null && playerList.Length != 0) { playerCount = playerList.Length; } } catch { } return FlagSurvivalMulti.GetCoopTargetRatio(playerCount); } private static int ComputeBiomePct(int consumed, int totalFlags, int topCount = 0) { if (totalFlags <= 0) { return 0; } if (FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP) { if (consumed <= 0) { return 0; } return Mathf.Clamp(Mathf.RoundToInt((float)topCount / (float)consumed * 100f), 0, 100); } float num = ComputeWeightRatio(totalFlags); float coopBaseRatio = GetCoopBaseRatio(); int num2 = ApplyTargetBonus(Mathf.Max(1, Mathf.RoundToInt((float)totalFlags * coopBaseRatio * num))); return Mathf.Clamp(Mathf.RoundToInt((float)consumed / (float)num2 * 100f), 0, 100); } private static int ComputePlayerPct(int playerConsumed, int totalFlags) { if (totalFlags <= 0) { return 0; } float num = ComputeWeightRatio(totalFlags); int num2 = ApplyTargetBonus(Mathf.Max(1, Mathf.RoundToInt((float)totalFlags * 0.2f * num))); return Mathf.Clamp(Mathf.RoundToInt((float)playerConsumed / (float)num2 * 100f), 0, 100); } } [HarmonyPatch(typeof(GUIManager), "Start")] public class GUIManagerStartPatcher { [HarmonyPostfix] public static void Postfix(GUIManager __instance) { FlagCountUI.OnGUIManagerStarted((MonoBehaviour)(object)__instance); } } [HarmonyPatch(typeof(PeakHandler), "SummonHelicopter")] public static class Patch_SummonHelicopter_BackupKiln { [HarmonyPrefix] public static void Prefix() { try { int currentSegmentIndex = FlagSurvivalMulti.GetCurrentSegmentIndex(); if (currentSegmentIndex != 4) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[가마백업] SummonHelicopter Prefix — curSeg={currentSegmentIndex} (가마/정상 아님, SKIP)"); } return; } string arg = FlagSurvivalMulti.GetCurrentBiome() ?? ""; string arg2 = FlagSurvivalMulti.GetCurrentBiomeTitle() ?? ""; FlagSurvivalMulti.BackupBiomeStats(4, "TheKiln", "가마"); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)("[가마백업] SummonHelicopter Prefix — 가마 데이터 강제 백업 완료 " + $"(curSeg={currentSegmentIndex}, GetCurrentBiome='{arg}', GetCurrentBiomeTitle='{arg2}', " + "백업 라벨=가마/TheKiln)")); } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[가마백업] SummonHelicopter Prefix 예외: " + ex.Message + "\n" + ex.StackTrace)); } } } } [HarmonyPatch(typeof(PeakHandler), "EndCutscene")] public static class Patch_EndCutscene_HideUI { [HarmonyPrefix] public static void Prefix() { try { FlagEndCutsceneState.IsActive = true; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v_cs2] EndCutscene Prefix — 엔드 컷씬 시작, FixedHUD/LeaderboardHUD 숨김 플래그 set (헬기 로프 잡고 컷씬 진입 시점, Airport 도착 시 자동 해제)"); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v_cs2] EndCutscene Prefix 예외: " + ex.Message)); } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.animatorprotect", "Cutscene Animator Protect", "1.0.0")] public class FlagCutsceneAnimatorProtectPlugin : BaseUnityPlugin { [HarmonyPatch(typeof(PeakHandler), "EndCutscene")] public static class Patch_EndCutscene_ProtectLocalAnimator { [HarmonyPostfix] public static void Postfix() { //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return; } try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || localCharacter.refs == null) { return; } FieldInfo field = ((object)localCharacter.refs).GetType().GetField("animator"); if (field == null) { return; } object? value = field.GetValue(localCharacter.refs); Component val = (Component)((value is Component) ? value : null); if ((Object)(object)val == (Object)null) { return; } GameObject gameObject = val.gameObject; Transform parent = gameObject.transform.parent; string text = (((Object)(object)parent != (Object)null) ? ((Object)parent).name : "null"); if ((Object)(object)parent != (Object)(object)((Component)localCharacter).transform) { gameObject.transform.SetParent(((Component)localCharacter).transform, true); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)("[AnimatorProtect] [v19] Scout.parent 복원: " + text + " → " + (((Object)(object)gameObject.transform.parent != (Object)null) ? ((Object)gameObject.transform.parent).name : "null"))); } } gameObject.SetActive(true); Behaviour val2 = (Behaviour)(object)((val is Behaviour) ? val : null); if ((Object)(object)val2 != (Object)null && !val2.enabled) { val2.enabled = true; } try { MethodInfo method = ((object)val).GetType().GetMethod("Rebind", Type.EmptyTypes); if (method != null) { method.Invoke(val, null); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[AnimatorProtect] [v119] Animator.Rebind() — PlayableGraph 재초기화 (정상 모션 복원)"); } } else { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[AnimatorProtect] [v119] Animator.Rebind 메서드 못 찾음"); } } } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[AnimatorProtect] [v119] Rebind 예외: " + ex.Message)); } } int num = 0; foreach (Transform item in gameObject.transform) { Transform val3 = item; if ((Object)(object)val3 != (Object)null && (Object)(object)((Component)val3).gameObject != (Object)null && !((Component)val3).gameObject.activeSelf) { ((Component)val3).gameObject.SetActive(true); num++; } } SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren(true); int num2 = 0; int num3 = 0; SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer val4 in array) { if ((Object)(object)val4 != (Object)null && !((Renderer)val4).enabled) { ((Renderer)val4).enabled = true; num2++; } if (!((Object)(object)val4 != (Object)null) || ((Renderer)val4).materials == null) { continue; } Material[] materials = ((Renderer)val4).materials; foreach (Material val5 in materials) { if ((Object)(object)val5 != (Object)null && val5.HasProperty("_VertexGhost")) { val5.SetFloat("_VertexGhost", 0f); num3++; } } } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)($"[AnimatorProtect] EndCutscene Postfix — Scout 활성, 자식 {num}개 활성, " + $"SkinnedMeshRenderer {num2}/{componentsInChildren.Length}개 enabled=true, " + $"_VertexGhost=0 {num3}개 강제")); } try { CharacterRagdoll componentInChildren = ((Component)localCharacter).GetComponentInChildren(true); if (!((Object)(object)componentInChildren != (Object)null)) { return; } componentInChildren.ToggleKinematic(false); int num4 = 0; if (componentInChildren.partList != null) { foreach (Bodypart part in componentInChildren.partList) { if ((Object)(object)part != (Object)null && (Object)(object)part.Rig != (Object)null) { part.Rig.useGravity = true; num4++; } } } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$"[AnimatorProtect] [v16] ToggleKinematic(false) + useGravity=true {num4}개 강제 — 정상 물리 복원"); } } catch (Exception ex2) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)("[AnimatorProtect] v16 예외: " + ex2.Message)); } } } catch (Exception ex3) { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogError((object)("[AnimatorProtect] Postfix 예외: " + ex3.Message + "\n" + ex3.StackTrace)); } } } } [HarmonyPatch(typeof(PeakHandler), "EndCutscene")] public static class Patch_EndCutscene_Diag { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private PeakHandler 5__2; private int 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: 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_030c: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = Singleton.Instance; 5__3 = 150; 5__4 = 0; break; case 2: <>1__state = -1; 5__4++; break; } if (5__4 < 5__3) { float num = (float)5__4 * 0.2f; Character localCharacter = Character.localCharacter; if ((Object)(object)5__2 != (Object)null) { string text = ""; if ((Object)(object)5__2.peakSequence != (Object)null) { Vector3 position = 5__2.peakSequence.transform.position; text += $"peakSeq=({position.x:F1},{position.y:F1},{position.z:F1}) "; } if ((Object)(object)5__2.endCutscene != (Object)null) { Vector3 position2 = 5__2.endCutscene.transform.position; text += $"endCut=({position2.x:F1},{position2.y:F1},{position2.z:F1}) "; } if ((Object)(object)5__2.firstCutsceneScout != (Object)null) { Vector3 position3 = ((Component)5__2.firstCutsceneScout).transform.position; text += $"fakeScout=({position3.x:F1},{position3.y:F1},{position3.z:F1})"; } if (!string.IsNullOrEmpty(text)) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Diag t={num:F1}s] {text}"); } } } if ((Object)(object)localCharacter != (Object)null && (Object)(object)((Component)localCharacter).transform != (Object)null) { Transform transform = ((Component)localCharacter).transform; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[Diag t={num:F1}s] localChar pos=({transform.position.x:F1},{transform.position.y:F1},{transform.position.z:F1})"); } try { CharacterRagdoll componentInChildren = ((Component)localCharacter).GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.partDict != null && componentInChildren.partDict.TryGetValue((BodypartType)0, out var value) && (Object)(object)value != (Object)null && (Object)(object)value.Rig != (Object)null) { Transform transform2 = ((Component)value).transform; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)($"[Diag t={num:F1}s] hip pos=({transform2.position.x:F1},{transform2.position.y:F1},{transform2.position.z:F1}) " + $"vel=({value.Rig.linearVelocity.x:F1},{value.Rig.linearVelocity.y:F1},{value.Rig.linearVelocity.z:F1}) " + $"kinematic={value.Rig.isKinematic} gravity={value.Rig.useGravity}")); } } } catch { } } <>2__current = (object)new WaitForSecondsRealtime(0.2f); <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPostfix] public static void Postfix(PeakHandler __instance) { if (!((Object)(object)__instance == (Object)null) && FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP) { ((MonoBehaviour)__instance).StartCoroutine(DiagAfterCutscene()); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator DiagAfterCutscene() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0); } } [HarmonyPatch(typeof(CharacterRagdoll), "FixedUpdate")] public static class Patch_CharacterRagdoll_FixedUpdate { private static FieldInfo _firstFrameField; private static FieldInfo _characterField; private static MethodInfo _setPhysicsMats; private static MethodInfo _rotateCharacter; private static MethodInfo _saveAdditional; private static MethodInfo _resetRotation; private static FieldInfo _ikRigBuilderField; private static MethodInfo _ikSyncLayers; private static MethodInfo _ikEvaluate; private static FieldInfo _animationsField; private static MethodInfo _prepIK; private static MethodInfo _configureIK; [HarmonyPrefix] public static bool Prefix(CharacterRagdoll __instance) { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance != (Object)null && instance.isPlayingCinematic && (Object)(object)__instance != (Object)null) { if (_characterField == null) { _characterField = typeof(CharacterRagdoll).GetField("character", BindingFlags.Instance | BindingFlags.NonPublic); } object? obj = _characterField?.GetValue(__instance); Character val = (Character)((obj is Character) ? obj : null); if ((Object)(object)val != (Object)null && (Object)(object)val == (Object)(object)Character.localCharacter) { return true; } } PeakHandler instance2 = Singleton.Instance; if ((Object)(object)instance2 == (Object)null || !instance2.isPlayingCinematic) { return true; } if ((Object)(object)__instance == (Object)null) { return true; } try { if (_firstFrameField == null) { Type typeFromHandle = typeof(CharacterRagdoll); _firstFrameField = typeFromHandle.GetField("firstFrame", BindingFlags.Instance | BindingFlags.NonPublic); _characterField = typeFromHandle.GetField("character", BindingFlags.Instance | BindingFlags.NonPublic); _setPhysicsMats = typeFromHandle.GetMethod("SetPhysicsMats", BindingFlags.Instance | BindingFlags.NonPublic); _rotateCharacter = typeFromHandle.GetMethod("RotateCharacter", BindingFlags.Instance | BindingFlags.NonPublic); _saveAdditional = typeFromHandle.GetMethod("SaveAdditionalTransformPositions", BindingFlags.Instance | BindingFlags.NonPublic); _resetRotation = typeFromHandle.GetMethod("ResetRotation", BindingFlags.Instance | BindingFlags.NonPublic); } object? obj2 = _characterField?.GetValue(__instance); Character val2 = (Character)((obj2 is Character) ? obj2 : null); if ((Object)(object)val2 == (Object)null || (Object)(object)val2 != (Object)(object)Character.localCharacter) { return true; } _setPhysicsMats?.Invoke(__instance, null); if ((bool)(_firstFrameField?.GetValue(__instance) ?? ((object)false))) { _firstFrameField?.SetValue(__instance, false); return false; } if (val2.refs != null && (Object)(object)val2.data != (Object)null && (Object)(object)val2.data.currentItem != (Object)null) { if (_animationsField == null) { _animationsField = ((object)val2.refs).GetType().GetField("animations"); } object obj3 = _animationsField?.GetValue(val2.refs); if (obj3 != null) { if (_prepIK == null) { _prepIK = obj3.GetType().GetMethod("PrepIK"); } _prepIK?.Invoke(obj3, null); } } _rotateCharacter?.Invoke(__instance, null); if (val2.refs != null) { if (_ikRigBuilderField == null) { _ikRigBuilderField = ((object)val2.refs).GetType().GetField("ikRigBuilder"); } object obj4 = _ikRigBuilderField?.GetValue(val2.refs); if (obj4 != null) { if (_ikSyncLayers == null) { _ikSyncLayers = obj4.GetType().GetMethod("SyncLayers"); _ikEvaluate = obj4.GetType().GetMethod("Evaluate", new Type[1] { typeof(float) }); } _ikSyncLayers?.Invoke(obj4, null); _ikEvaluate?.Invoke(obj4, new object[1] { Time.fixedDeltaTime }); } } if (_animationsField != null && val2.refs != null) { object value = _animationsField.GetValue(val2.refs); if (value != null) { if (_configureIK == null) { _configureIK = value.GetType().GetMethod("ConfigureIK"); } _configureIK?.Invoke(value, null); } } if (__instance.partList != null) { for (int i = 0; i < __instance.partList.Count; i++) { if ((Object)(object)__instance.partList[i] != (Object)null) { __instance.partList[i].SaveAnimationData(); } } } _saveAdditional?.Invoke(__instance, null); _resetRotation?.Invoke(__instance, null); if (__instance.partList != null) { for (int j = 0; j < __instance.partList.Count; j++) { if ((Object)(object)__instance.partList[j] != (Object)null) { __instance.partList[j].ResetTransform(); } } } return false; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[Patch_CharacterRagdoll_FixedUpdate] 예외 → 원본 fallback: " + ex.GetType().Name + ": " + ex.Message)); } return true; } } } [HarmonyPatch(typeof(CharacterMovement), "FixedUpdate")] public static class Patch_CharacterMovement_FixedUpdate { private static FieldInfo _charField; [HarmonyPostfix] public static void Postfix(CharacterMovement __instance) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { return; } try { if (_charField == null) { _charField = typeof(CharacterMovement).GetField("character", BindingFlags.Instance | BindingFlags.NonPublic); } object? obj = _charField?.GetValue(__instance); Character val = (Character)((obj is Character) ? obj : null); if ((Object)(object)val == (Object)null || (Object)(object)val != (Object)(object)Character.localCharacter || val.refs == null || (Object)(object)val.refs.ragdoll == (Object)null || val.refs.ragdoll.partList == null) { return; } Vector3 val2 = Physics.gravity / 2f; foreach (Bodypart part in val.refs.ragdoll.partList) { if (!((Object)(object)part == (Object)null) && !((Object)(object)part.Rig == (Object)null) && !part.Rig.isKinematic) { part.Rig.useGravity = false; part.Rig.AddForce(val2, (ForceMode)5); } } } catch { } } } public class TransformProtectTick : MonoBehaviour { private static TransformProtectTick _instance; private FieldInfo _animatorField; private int _parentFixCount; private int _scoutParentFixCount; private int _velocityClampCount; private float _logTimer; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_TransformProtect"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[TransformProtect] v24 활성 — 매 프레임 상속 끊기 + velocity.y 양수 차단"); } } } private void LateUpdate() { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { return; } List allCharacters = Character.AllCharacters; if (allCharacters == null) { return; } try { foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null || (Object)(object)((Component)item).transform == (Object)null) { continue; } if ((Object)(object)((Component)item).transform.parent != (Object)null) { ((Component)item).transform.SetParent((Transform)null, true); _parentFixCount++; } if (item.refs != null) { if (_animatorField == null) { _animatorField = ((object)item.refs).GetType().GetField("animator"); } object? obj = _animatorField?.GetValue(item.refs); Component val = (Component)((obj is Component) ? obj : null); if ((Object)(object)val != (Object)null && (Object)(object)val.transform.parent != (Object)(object)((Component)item).transform) { val.transform.SetParent(((Component)item).transform, true); _scoutParentFixCount++; } } } _logTimer += Time.unscaledDeltaTime; if (!(_logTimer >= 1f)) { return; } if (_parentFixCount > 0 || _scoutParentFixCount > 0 || _velocityClampCount > 0) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)($"[TransformProtect] 1초 누적: parent끊기 {_parentFixCount}회, " + $"Scout.parent복원 {_scoutParentFixCount}회, velocity.y차단 {_velocityClampCount}회")); } } _parentFixCount = 0; _scoutParentFixCount = 0; _velocityClampCount = 0; _logTimer = 0f; } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[TransformProtect] 예외: " + ex.Message)); } } } } [HarmonyPatch(typeof(PeakHandler), "EndCutscene")] public static class Patch_EndCutscene_PreventLocalAnimatorDisable { private static MethodInfo _setCosmeticsMethod; private static MethodInfo _openEndscreenMethod; [HarmonyPrefix] public static bool Prefix(PeakHandler __instance) { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v120] localCharacter null — 원본 fallback"); } return true; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[v120] ★ EndCutscene 가로채기 시작 — 본 캐릭터 animator 보호 ★"); } __instance.isPlayingCinematic = true; int num = 0; int num2 = 0; foreach (Character allCharacter in Character.AllCharacters) { if ((Object)(object)allCharacter == (Object)null || allCharacter.refs == null) { continue; } num++; if ((Object)(object)allCharacter == (Object)(object)localCharacter) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)"[v120/v171] 본 캐릭터 animator SetActive(false) SKIP — Active Ragdoll 흐름 보존"); } continue; } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { PhotonView photonView = ((MonoBehaviourPun)allCharacter).photonView; int? obj; if (photonView == null) { obj = null; } else { Player owner = photonView.Owner; obj = ((owner != null) ? new int?(owner.ActorNumber) : null); } log4.LogInfo((object)$"[v171] 비본인 캐릭터 SetActive(false) SKIP — PhotonView sync 보존 (actor={obj})"); } } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogInfo((object)$"[v120/v171] foreach 완료 — 전원 SKIP {num}개 (비활성 {num2}개)"); } if ((Object)(object)MainCamera.instance != (Object)null && (Object)(object)((Component)MainCamera.instance).gameObject != (Object)null) { ((Component)MainCamera.instance).gameObject.SetActive(false); } MenuWindow.CloseAllWindows(); object? obj2 = typeof(PeakHandler).GetField("peakSequence", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); GameObject val = (GameObject)((obj2 is GameObject) ? obj2 : null); if ((Object)(object)val != (Object)null) { val.SetActive(false); } if ((Object)(object)GUIManager.instance != (Object)null) { if ((Object)(object)GUIManager.instance.letterboxCanvas != (Object)null) { ((Component)GUIManager.instance.letterboxCanvas).gameObject.SetActive(true); } if ((Object)(object)GUIManager.instance.hudCanvas != (Object)null) { ((Behaviour)GUIManager.instance.hudCanvas).enabled = false; } } object? obj3 = typeof(PeakHandler).GetField("endCutscene", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); GameObject val2 = (GameObject)((obj3 is GameObject) ? obj3 : null); if ((Object)(object)val2 != (Object)null) { val2.SetActive(true); } if (_setCosmeticsMethod == null) { _setCosmeticsMethod = typeof(PeakHandler).GetMethod("SetCosmetics", BindingFlags.Instance | BindingFlags.NonPublic); } _setCosmeticsMethod?.Invoke(__instance, new object[1] { Character.AllCharacters }); if (_openEndscreenMethod == null) { MethodInfo[] methods = typeof(PeakHandler).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name.Contains("OpenEndscreen")) { _openEndscreenMethod = methodInfo; ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogInfo((object)("[v120] OpenEndscreen 메서드 캐싱: " + methodInfo.Name)); } break; } } } if (_openEndscreenMethod != null) { if (_openEndscreenMethod.Invoke(__instance, null) is IEnumerator enumerator2) { ((MonoBehaviour)__instance).StartCoroutine(enumerator2); } else { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)"[v120] OpenEndscreen 반환값 IEnumerator 캐스팅 실패"); } } } else { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogError((object)"[v120] OpenEndscreen 메서드 못 찾음 — 엔드스크린 안 열림"); } } ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)"[v120] ★ EndCutscene 가로채기 완료 ★"); } return false; } catch (Exception ex) { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogError((object)("[v120] EndCutscene 가로채기 예외 → 원본 fallback: " + ex.GetType().Name + ": " + ex.Message + "\n" + ex.StackTrace)); } return true; } } } public class AnimatorEnableTick : MonoBehaviour { private static AnimatorEnableTick _instance; private FieldInfo _animField; private int _enableForceCount; private float _logTimer; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_AnimatorEnable"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[AnimatorEnable] v128 활성 — 매 프레임 본 캐릭터 Animator.enabled=true 강제"); } } } private void LateUpdate() { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { return; } List allCharacters = Character.AllCharacters; if (allCharacters == null) { return; } try { foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null || item.refs == null) { continue; } if (_animField == null) { _animField = ((object)item.refs).GetType().GetField("animator"); } object? obj = _animField?.GetValue(item.refs); Component val = (Component)((obj is Component) ? obj : null); if (!((Object)(object)val == (Object)null)) { Behaviour val2 = (Behaviour)(object)((val is Behaviour) ? val : null); if ((Object)(object)val2 != (Object)null && !val2.enabled) { val2.enabled = true; _enableForceCount++; } } } _logTimer += Time.unscaledDeltaTime; if (!(_logTimer >= 1f)) { return; } if (_enableForceCount > 0) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[AnimatorEnable] 1초 누적: enabled=true 강제 {_enableForceCount}회"); } } _enableForceCount = 0; _logTimer = 0f; } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[AnimatorEnable] 예외: " + ex.Message)); } } } } public class DiagnosticTick : MonoBehaviour { private static DiagnosticTick _instance; private FieldInfo _animatorField; private FieldInfo _playableGraphField; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_Diagnostic"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[Diagnostic] v126 활성 — F8 키로 본 캐릭터 리깅 진단 출력"); } } } private void Update() { if (Input.GetKeyDown((KeyCode)289)) { DumpDiagnostic(); } } private void DumpDiagnostic() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0766: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_0808: Unknown result type (might be due to invalid IL or missing references) //IL_080d: Unknown result type (might be due to invalid IL or missing references) //IL_0822: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_08c1: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08d6: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_0912: Unknown result type (might be due to invalid IL or missing references) //IL_0917: Unknown result type (might be due to invalid IL or missing references) //IL_091c: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[F8 Diag] localCharacter null"); } return; } PeakHandler instance = Singleton.Instance; bool flag = (Object)(object)instance != (Object)null && instance.isPlayingCinematic; string arg = (flag ? "★컷씬중★" : "본게임중"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"\n========== [F8 Diag] {arg} (Time={Time.time:F2}) =========="); Vector3 val = (((Object)(object)((Component)localCharacter).transform != (Object)null) ? ((Component)localCharacter).transform.position : Vector3.zero); stringBuilder.AppendLine("[위치]"); stringBuilder.AppendLine($" root.position = ({val.x:F2}, {val.y:F2}, {val.z:F2})"); object obj; Vector3 val2; if (!((Object)(object)((Component)localCharacter).transform != (Object)null)) { obj = "null"; } else { val2 = ((Component)localCharacter).transform.eulerAngles; obj = ((Vector3)(ref val2)).ToString("F1"); } stringBuilder.AppendLine(" root.rotation = " + (string?)obj); stringBuilder.AppendLine(" root.parent = " + (((Object)(object)((Component)localCharacter).transform != (Object)null && (Object)(object)((Component)localCharacter).transform.parent != (Object)null) ? ((Object)((Component)localCharacter).transform.parent).name : "null")); if (_animatorField == null && localCharacter.refs != null) { _animatorField = ((object)localCharacter.refs).GetType().GetField("animator"); } object? obj2 = _animatorField?.GetValue(localCharacter.refs); Component val3 = (Component)((obj2 is Component) ? obj2 : null); stringBuilder.AppendLine("[Animator (Scout)]"); if ((Object)(object)val3 != (Object)null) { Vector3 position = val3.transform.position; stringBuilder.AppendLine($" Scout.position = ({position.x:F2}, {position.y:F2}, {position.z:F2})"); val2 = val3.transform.eulerAngles; stringBuilder.AppendLine(" Scout.rotation = " + ((Vector3)(ref val2)).ToString("F1")); stringBuilder.AppendLine(" Scout.parent = " + (((Object)(object)val3.transform.parent != (Object)null) ? ((Object)val3.transform.parent).name : "null")); stringBuilder.AppendLine($" Scout.activeInHierarchy = {val3.gameObject.activeInHierarchy}"); Behaviour val4 = (Behaviour)(object)((val3 is Behaviour) ? val3 : null); stringBuilder.AppendLine($" Animator.enabled = {(Object)(object)val4 != (Object)null && val4.enabled}"); try { Type type = ((object)val3).GetType(); PropertyInfo property = type.GetProperty("speed"); PropertyInfo property2 = type.GetProperty("runtimeAnimatorController"); PropertyInfo property3 = type.GetProperty("isInitialized"); PropertyInfo property4 = type.GetProperty("hasBoundPlayables"); float num = ((property != null) ? ((float)property.GetValue(val3)) : (-1f)); object obj3 = property2?.GetValue(val3); bool flag2 = property3 != null && (bool)property3.GetValue(val3); bool flag3 = property4 != null && (bool)property4.GetValue(val3); stringBuilder.AppendLine($" Animator.speed = {num:F2}"); stringBuilder.AppendLine(" Animator.controller = " + ((obj3 != null) ? ((Object)obj3).name : "null")); stringBuilder.AppendLine($" Animator.isInitialized = {flag2}"); stringBuilder.AppendLine($" Animator.hasBoundPlayables = {flag3}"); object obj4 = type.GetProperty("playableGraph")?.GetValue(val3); if (obj4 != null) { MethodInfo method = obj4.GetType().GetMethod("IsValid"); MethodInfo method2 = obj4.GetType().GetMethod("IsPlaying"); bool flag4 = method != null && (bool)method.Invoke(obj4, null); bool flag5 = flag4 && method2 != null && (bool)method2.Invoke(obj4, null); stringBuilder.AppendLine($" PlayableGraph.IsValid = {flag4}"); stringBuilder.AppendLine($" PlayableGraph.IsPlaying = {flag5}"); } } catch (Exception ex) { stringBuilder.AppendLine(" Animator reflection 예외: " + ex.Message); } } else { stringBuilder.AppendLine(" animator field null"); } stringBuilder.AppendLine("[data]"); if ((Object)(object)localCharacter.data != (Object)null) { stringBuilder.AppendLine($" dead = {localCharacter.data.dead}"); stringBuilder.AppendLine($" fullyPassedOut = {localCharacter.data.fullyPassedOut}"); stringBuilder.AppendLine($" fullyConscious = {localCharacter.data.fullyConscious}"); stringBuilder.AppendLine($" fallSeconds = {localCharacter.data.fallSeconds:F2}"); stringBuilder.AppendLine($" isClimbing = {localCharacter.data.isClimbing}"); stringBuilder.AppendLine($" isRopeClimbing = {localCharacter.data.isRopeClimbing}"); stringBuilder.AppendLine($" currentStamina = {localCharacter.data.currentStamina:F3}"); stringBuilder.AppendLine($" staminaMod = {localCharacter.data.staminaMod:F3}"); stringBuilder.AppendLine(" lookDirection_Flat = " + ((Vector3)(ref localCharacter.data.lookDirection_Flat)).ToString("F2")); stringBuilder.AppendLine(" climbNormal = " + ((Vector3)(ref localCharacter.data.climbNormal)).ToString("F2")); stringBuilder.AppendLine(" carrier = " + (((Object)(object)localCharacter.data.carrier != (Object)null) ? ((Object)localCharacter.data.carrier).name : "null")); stringBuilder.AppendLine($" sinceClimbJump = {localCharacter.data.sinceClimbJump:F2}"); } stringBuilder.AppendLine("[Bodypart]"); if (localCharacter.refs != null && (Object)(object)localCharacter.refs.ragdoll != (Object)null && localCharacter.refs.ragdoll.partList != null) { List partList = localCharacter.refs.ragdoll.partList; if (localCharacter.refs.ragdoll.partDict != null && localCharacter.refs.ragdoll.partDict.TryGetValue((BodypartType)0, out var value) && (Object)(object)value != (Object)null && (Object)(object)value.Rig != (Object)null) { val2 = value.Rig.position; stringBuilder.AppendLine(" hip.position = " + ((Vector3)(ref val2)).ToString("F2")); Quaternion rotation = value.Rig.rotation; val2 = ((Quaternion)(ref rotation)).eulerAngles; stringBuilder.AppendLine(" hip.rotation = " + ((Vector3)(ref val2)).ToString("F1")); val2 = value.Rig.linearVelocity; string arg2 = ((Vector3)(ref val2)).ToString("F2"); val2 = value.Rig.linearVelocity; stringBuilder.AppendLine($" hip.linearVelocity = {arg2} (mag={((Vector3)(ref val2)).magnitude:F2})"); val2 = value.Rig.angularVelocity; string arg3 = ((Vector3)(ref val2)).ToString("F2"); val2 = value.Rig.angularVelocity; stringBuilder.AppendLine($" hip.angularVelocity = {arg3} (mag={((Vector3)(ref val2)).magnitude:F2})"); stringBuilder.AppendLine($" hip.isKinematic = {value.Rig.isKinematic}, useGravity = {value.Rig.useGravity}, mass = {value.Rig.mass:F2}"); } Vector3 val5 = Vector3.zero; Vector3 val6 = Vector3.zero; int num2 = 0; foreach (Bodypart item in partList) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Rig == (Object)null)) { val5 += item.Rig.angularVelocity; val6 += item.Rig.linearVelocity; num2++; } } if (num2 > 0) { Vector3 val7 = val5 / (float)num2; Vector3 val8 = val6 / (float)num2; stringBuilder.AppendLine(string.Format(" Bodypart 평균 angVel = {0} (mag={1:F2})", ((Vector3)(ref val7)).ToString("F2"), ((Vector3)(ref val7)).magnitude)); stringBuilder.AppendLine(string.Format(" Bodypart 평균 linVel = {0} (mag={1:F2})", ((Vector3)(ref val8)).ToString("F2"), ((Vector3)(ref val8)).magnitude)); stringBuilder.AppendLine($" Bodypart 개수 = {num2}"); } } stringBuilder.AppendLine("[PEAK]"); stringBuilder.AppendLine($" isPlayingCinematic = {flag}"); stringBuilder.AppendLine($" Time.timeScale = {Time.timeScale:F2}"); stringBuilder.AppendLine("=========================================================="); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)stringBuilder.ToString()); } try { string text = Path.Combine(Paths.BepInExRootPath, "FlagSurvival_Diag"); Directory.CreateDirectory(text); string arg4 = (flag ? "cinematic" : "play"); string path = $"flag_diag_F8_{arg4}_{DateTime.Now:yyyyMMdd_HHmmss}.txt"; string text2 = Path.Combine(text, path); File.WriteAllText(text2, stringBuilder.ToString()); ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)("[F8 Diag] ★ 파일 저장: " + text2 + " ★")); } } catch (Exception ex2) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[F8 Diag] 파일 저장 예외: " + ex2.Message)); } } } catch (Exception ex3) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)("[F8 Diag] 예외: " + ex3.Message + "\n" + ex3.StackTrace)); } } } } public static class CameraCStartTracker_v129 { public static float EndScreenCompleteTime = -1f; public const float CAMERA_C_DELAY_SYNC = 14.5f; } [HarmonyPatch(typeof(PeakHandler), "EndScreenComplete")] public static class Patch_EndScreenComplete_RecordTime_v129 { [HarmonyPostfix] public static void Postfix() { if (FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP) { CameraCStartTracker_v129.EndScreenCompleteTime = Time.time; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)($"[v129] EndScreenComplete 시간 기록: {CameraCStartTracker_v129.EndScreenCompleteTime:F2} " + $"(카메라 C 활성: +{14.5f:F1}s 후 기절 모션 트리거)")); } } } } public class FaintTick : MonoBehaviour { private const float FAINT_TIMING = 12f; private static FaintTick _instance; private bool _faintTriggered; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_Faint"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Faint] v131 활성 — 마지막 텔레포트 시점({12f}s)부터 기절 모션 트리거"); } } } private void Update() { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { if (_faintTriggered) { _faintTriggered = false; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[Faint] 컷씬 종료 → 트리거 reset"); } } } else { if (_faintTriggered || CameraCStartTracker_v129.EndScreenCompleteTime < 0f || Time.time - CameraCStartTracker_v129.EndScreenCompleteTime < 12f) { return; } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null) { return; } try { if (localCharacter.refs != null && (Object)(object)localCharacter.refs.afflictions != (Object)null) { localCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 1f, false, true, true); } localCharacter.data.passedOut = true; localCharacter.data.fullyPassedOut = true; _faintTriggered = true; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[v166] ★ 강제 기절 (3번째 텔레포트 +{12f}s) — fullyPassedOut=true + Curse=100% (speed=0 제거) Time.time={Time.time:F2} ★"); } ForcedFaintMaintainTick.EnsureInstance(); ForcedFaintMaintainTick.Active = true; } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[v159] 트리거 예외: " + ex.Message)); } } } } } public class NoFaintTick : MonoBehaviour { private const float CUTOFF_SEC = 12f; private static NoFaintTick _instance; private FieldInfo _unPassOutField; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_NoFaint"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[NoFaint] v145 활성 — 0~{12f}s 디버프 0 + 기절 방지"); } } } private void Update() { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic || CameraCStartTracker_v129.EndScreenCompleteTime < 0f || Time.time - CameraCStartTracker_v129.EndScreenCompleteTime >= 12f) { return; } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null || localCharacter.refs == null) { return; } try { localCharacter.data.passedOut = false; localCharacter.data.fullyPassedOut = false; localCharacter.data.dead = false; localCharacter.data.deathTimer = 0f; localCharacter.data.lastPassedOut = 0f; if (_unPassOutField == null) { _unPassOutField = typeof(Character).GetField("UnPassOutCalled", BindingFlags.Instance | BindingFlags.NonPublic); } _unPassOutField?.SetValue(localCharacter, false); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[v145 NoFaint] 예외: " + ex.Message)); } } } } public class NoDeadTick : MonoBehaviour { private static NoDeadTick _instance; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_NoDead"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[NoDead] v157 활성 — EndScreenComplete ~ Airport 사이 dead=false 강제"); } } } private void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (CameraCStartTracker_v129.EndScreenCompleteTime < 0f) { return; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "Airport") { return; } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null) { return; } try { if (localCharacter.data.dead) { localCharacter.data.dead = false; } if (localCharacter.data.deathTimer > 0f) { localCharacter.data.deathTimer = 0f; } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[v157 NoDead] 예외: " + ex.Message)); } } } } public class StatusCleanupTick : MonoBehaviour { private const float CLEANUP_TIMING = 22.6f; private static StatusCleanupTick _instance; private bool _cleaned; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_StatusCleanup"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[StatusCleanup] v159 활성 — {22.6f}s 시점 모든 디버프 회복 (carry over 차단)"); } } } private void Update() { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { _cleaned = false; } else { if (_cleaned || CameraCStartTracker_v129.EndScreenCompleteTime < 0f || Time.time - CameraCStartTracker_v129.EndScreenCompleteTime < 22.6f) { return; } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || localCharacter.refs == null || (Object)(object)localCharacter.refs.afflictions == (Object)null) { return; } try { localCharacter.refs.afflictions.ClearAllStatus(false); _cleaned = true; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[v159] 카메라 C 끝 + 0.1초 ({22.6f}s) → 모든 디버프 회복 (다음 씬 바둥거림 보장)"); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v159 StatusCleanup] 예외: " + ex.Message)); } } } } } public class FlailMotionTracker_v160 : MonoBehaviour { private static FlailMotionTracker_v160 _instance; private List _records = new List(); private bool _recording; private FieldInfo _animField; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_FlailMotionTracker"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[FlailMotionTracker] v160/v161 활성 — F1 토글 (시작/종료) 매 프레임 record + JSON dump"); } } } private void Update() { if (Input.GetKeyDown((KeyCode)282)) { if (!_recording) { _records.Clear(); _recording = true; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v160 F1] ★ 녹화 시작 — 파닥 모션 발생시켜 보세요. F1 다시 누르면 저장."); } } else { _recording = false; DumpJson(); } } else { if (!_recording) { return; } if (_records.Count < 3000) { try { Character localCharacter = Character.localCharacter; if (!((Object)(object)localCharacter == (Object)null) && !((Object)(object)localCharacter.data == (Object)null)) { if (_animField == null && localCharacter.refs != null) { _animField = ((object)localCharacter.refs).GetType().GetField("animator"); } object? obj = _animField?.GetValue(localCharacter.refs); Component val = (Component)((obj is Component) ? obj : null); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("{\"time\":").Append(Time.time.ToString("F3")); stringBuilder.Append(",\"data\":{"); stringBuilder.Append("\"curStam\":").Append(localCharacter.data.currentStamina.ToString("F4")); stringBuilder.Append(",\"extStam\":").Append(localCharacter.data.extraStamina.ToString("F4")); stringBuilder.Append(",\"isClimbing\":").Append(localCharacter.data.isClimbing ? "true" : "false"); stringBuilder.Append(",\"isRopeClimbing\":").Append(localCharacter.data.isRopeClimbing ? "true" : "false"); stringBuilder.Append(",\"isGrounded\":").Append(localCharacter.data.isGrounded ? "true" : "false"); stringBuilder.Append(",\"sinceGrounded\":").Append(localCharacter.data.sinceGrounded.ToString("F2")); stringBuilder.Append(",\"fallSeconds\":").Append(localCharacter.data.fallSeconds.ToString("F2")); stringBuilder.Append(",\"passedOut\":").Append(localCharacter.data.passedOut ? "true" : "false"); stringBuilder.Append(",\"fullyPassedOut\":").Append(localCharacter.data.fullyPassedOut ? "true" : "false"); stringBuilder.Append(",\"dead\":").Append(localCharacter.data.dead ? "true" : "false"); stringBuilder.Append("}"); if ((Object)(object)val != (Object)null) { Type type = ((object)val).GetType(); bool flag = false; Behaviour val2 = (Behaviour)(object)((val is Behaviour) ? val : null); if ((Object)(object)val2 != (Object)null) { flag = val2.enabled; } float num = 0f; PropertyInfo property = type.GetProperty("speed"); if (property != null) { num = (float)property.GetValue(val); } stringBuilder.Append(",\"anim\":{"); stringBuilder.Append("\"enabled\":").Append(flag ? "true" : "false"); stringBuilder.Append(",\"speed\":").Append(num.ToString("F2")); try { MethodInfo method = type.GetMethod("GetCurrentAnimatorStateInfo", new Type[1] { typeof(int) }); if (method != null) { object obj2 = method.Invoke(val, new object[1] { 0 }); if (obj2 != null) { Type type2 = obj2.GetType(); int value = (int)(type2.GetProperty("fullPathHash")?.GetValue(obj2) ?? ((object)0)); float num2 = (float)(type2.GetProperty("normalizedTime")?.GetValue(obj2) ?? ((object)0f)); stringBuilder.Append(",\"stateHash\":").Append(value); stringBuilder.Append(",\"stateNormTime\":").Append(num2.ToString("F3")); } } } catch { } stringBuilder.Append(",\"params\":{"); try { if (type.GetProperty("parameters")?.GetValue(val) is Array array) { bool flag2 = true; for (int i = 0; i < array.Length; i++) { object value2 = array.GetValue(i); if (value2 != null) { Type type3 = value2.GetType(); string value3 = type3.GetProperty("name")?.GetValue(value2) as string; int num3 = (int)(type3.GetProperty("nameHash")?.GetValue(value2) ?? ((object)0)); object obj4 = type3.GetProperty("type")?.GetValue(value2); int num4 = ((obj4 != null) ? ((int)obj4) : 0); if (!string.IsNullOrEmpty(value3)) { if (!flag2) { stringBuilder.Append(","); } flag2 = false; stringBuilder.Append("\"").Append(value3).Append("\":"); try { switch (num4) { case 4: { bool flag3 = (bool)type.GetMethod("GetBool", new Type[1] { typeof(int) }).Invoke(val, new object[1] { num3 }); stringBuilder.Append(flag3 ? "true" : "false"); break; } case 1: stringBuilder.Append(((float)type.GetMethod("GetFloat", new Type[1] { typeof(int) }).Invoke(val, new object[1] { num3 })).ToString("F3")); break; case 3: { int value4 = (int)type.GetMethod("GetInteger", new Type[1] { typeof(int) }).Invoke(val, new object[1] { num3 }); stringBuilder.Append(value4); break; } default: stringBuilder.Append("\"trigger\""); break; } } catch { stringBuilder.Append("\"err\""); } } } } } } catch { } stringBuilder.Append("}"); stringBuilder.Append("}"); } stringBuilder.Append("}"); _records.Add(stringBuilder.ToString()); } return; } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v160] record 예외: " + ex.Message)); } return; } } _recording = false; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[v160] record 한계 도달 (3000) — 자동 저장"); } DumpJson(); } } private void DumpJson() { try { if (_records.Count == 0) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v160] record 0개 — 저장 X"); } return; } string text = DateTime.Now.ToString("yyyyMMdd_HHmmss"); string path = "flag_flail_motion_" + text + ".json"; string text2 = Path.Combine(Paths.BepInExRootPath, path); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("{"); stringBuilder.Append(" \"timestamp\":\"").Append(text).AppendLine("\","); stringBuilder.Append(" \"recordCount\":").Append(_records.Count).AppendLine(","); stringBuilder.AppendLine(" \"records\":["); for (int i = 0; i < _records.Count; i++) { stringBuilder.Append(" ").Append(_records[i]); if (i < _records.Count - 1) { stringBuilder.Append(","); } stringBuilder.AppendLine(); } stringBuilder.AppendLine(" ]"); stringBuilder.AppendLine("}"); File.WriteAllText(text2, stringBuilder.ToString()); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[v160 F1] JSON 저장 완료 — record {_records.Count}개 → {text2}"); } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[v160] dump 예외: " + ex.Message)); } } } } public class ForcedFaintMaintainTick : MonoBehaviour { public static bool Active; private static ForcedFaintMaintainTick _instance; private FieldInfo _animField; private FieldInfo _unPassOutField; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_ForcedFaintMaintain"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[ForcedFaintMaintain] v135 활성 — 매 프레임 강제 기절 유지"); } } } private void LateUpdate() { if (!Active) { return; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null && (Object)(object)localCharacter.data != (Object)null) { localCharacter.data.passedOut = false; localCharacter.data.fullyPassedOut = false; localCharacter.data.dead = false; localCharacter.data.deathTimer = 0f; localCharacter.data.lastPassedOut = 0f; if (localCharacter.refs != null && (Object)(object)localCharacter.refs.afflictions != (Object)null) { localCharacter.refs.afflictions.SubtractStatus((STATUSTYPE)5, 1f, false, false); } if (_unPassOutField == null) { _unPassOutField = typeof(Character).GetField("UnPassOutCalled", BindingFlags.Instance | BindingFlags.NonPublic); } _unPassOutField?.SetValue(localCharacter, false); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v143] 컷씬 종료 → 본 캐릭터 모든 강제 reset (fullyPassedOut/passedOut/dead/Curse/deathTimer/UnPassOutCalled)"); } } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v143] 컷씬 종료 reset 예외: " + ex.Message)); } } Active = false; return; } Character localCharacter2 = Character.localCharacter; if ((Object)(object)localCharacter2 == (Object)null || (Object)(object)localCharacter2.data == (Object)null || localCharacter2.refs == null) { return; } try { localCharacter2.data.passedOut = true; localCharacter2.data.fullyPassedOut = true; localCharacter2.data.deathTimer = 0f; localCharacter2.data.dead = false; if (_unPassOutField == null) { _unPassOutField = typeof(Character).GetField("UnPassOutCalled", BindingFlags.Instance | BindingFlags.NonPublic); } _unPassOutField?.SetValue(localCharacter2, true); localCharacter2.data.lastPassedOut = Time.time; } catch (Exception ex2) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[ForcedFaintMaintain] 예외: " + ex2.Message)); } } } } public class BellyUpTick_v167 : MonoBehaviour { private const float ACTIVATE_SEC = 9.4f; private static BellyUpTick_v167 _instance; private bool _firstApplyLogged; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_BellyUp"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[BellyUp] v167 활성 — 9.4초+ 등 아래 자세 강제"); } } } private void LateUpdate() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { _firstApplyLogged = false; } else { if (CameraCStartTracker_v129.EndScreenCompleteTime < 0f) { return; } float num = Time.time - CameraCStartTracker_v129.EndScreenCompleteTime; if (num < 9.4f) { return; } List allCharacters = Character.AllCharacters; if (allCharacters == null) { return; } try { foreach (Character item in allCharacters) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((Component)item).transform == (Object)null)) { Vector3 forward = ((Component)item).transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.01f) { forward = Vector3.forward; } ((Vector3)(ref forward)).Normalize(); ((Component)item).transform.rotation = Quaternion.LookRotation(Vector3.up, forward); } } if (!_firstApplyLogged) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[v167/v172 BellyUp] 등 아래 자세 강제 시작 (elapsed={num:F2}s, 캐릭터 {allCharacters.Count}명)"); } _firstApplyLogged = true; } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v167 BellyUp] 예외: " + ex.Message)); } } } } } [HarmonyPatch] public static class Patch_CheckFallDamage_Climbing_v151 { private static MethodBase TargetMethod() { Type type = AccessTools.TypeByName("CharacterClimbing"); if (type == null) { return null; } return AccessTools.Method(type, "CheckFallDamage", (Type[])null, (Type[])null); } [HarmonyPrefix] public static bool Prefix() { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } return ShouldAllowFallDamage(); } } [HarmonyPatch] public static class Patch_CheckFallDamage_Movement_v153 { private static MethodBase TargetMethod() { Type type = AccessTools.TypeByName("CharacterMovement"); if (type == null) { return null; } return AccessTools.Method(type, "CheckFallDamage", (Type[])null, (Type[])null); } [HarmonyPrefix] public static bool Prefix() { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } return ShouldAllowFallDamage(); } } [HarmonyPatch] public static class Patch_AddStatus_NoInjury_v152 { private static MethodBase TargetMethod() { return AccessTools.Method(typeof(CharacterAfflictions), "AddStatus", new Type[5] { typeof(STATUSTYPE), typeof(float), typeof(bool), typeof(bool), typeof(bool) }, (Type[])null); } [HarmonyPrefix] public static bool Prefix(CharacterAfflictions __instance, STATUSTYPE statusType) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } if ((int)statusType != 0) { return true; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { return true; } if (CameraCStartTracker_v129.EndScreenCompleteTime < 0f) { return true; } float num = Time.time - CameraCStartTracker_v129.EndScreenCompleteTime; if (num >= 12f) { return true; } try { object? obj = typeof(CharacterAfflictions).GetField("character", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(__instance); if ((Object)((obj is Character) ? obj : null) != (Object)(object)Character.localCharacter) { return true; } } catch { return true; } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[v152] AddStatus(Injury) 차단 (elapsed={num:F2}s)"); } return false; } } [HarmonyPatch] public static class Patch_CheckFallDamage_Movement_v154 { private static MethodBase TargetMethod() { Type type = AccessTools.TypeByName("CharacterMovement"); if (type == null) { return null; } return AccessTools.Method(type, "CheckFallDamage", (Type[])null, (Type[])null); } [HarmonyPrefix] public static bool Prefix() { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { return true; } if (CameraCStartTracker_v129.EndScreenCompleteTime < 0f) { return true; } if (Time.time - CameraCStartTracker_v129.EndScreenCompleteTime < 12f) { return false; } return true; } } [HarmonyPatch(typeof(Character), "SetRotation")] public static class Patch_Character_SetRotation_BellyUp_v168 { [HarmonyPostfix] public static void Postfix(Character __instance) { //IL_007d: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_009d: 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) if ((Object)(object)__instance == (Object)null || FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic || CameraCStartTracker_v129.EndScreenCompleteTime < 0f || Time.time - CameraCStartTracker_v129.EndScreenCompleteTime < 9.4f || __instance.refs == null || (Object)(object)__instance.refs.rigCreator == (Object)null || (Object)(object)__instance.data == (Object)null) { return; } try { Vector3 val = __instance.data.lookDirection_Flat; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); ((Component)__instance.refs.rigCreator).transform.rotation = Quaternion.LookRotation(Vector3.up, val); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[v168 SetRotation BellyUp] 예외: " + ex.Message)); } } } } public class StatusDamageTracker_v149 : MonoBehaviour { private static StatusDamageTracker_v149 _instance; private List _records = new List(); private float[] _prevStatuses = new float[12]; private bool _initialized; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_StatusDamageTracker"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[StatusDamageTracker] v150 활성 — 0~5초 record 누적, F8 시 JSON dump"); } } } private void Update() { if (Input.GetKeyDown((KeyCode)289)) { DumpJson(); return; } PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { if (_initialized) { _initialized = false; } } else { if (CameraCStartTracker_v129.EndScreenCompleteTime < 0f) { return; } float num = Time.time - CameraCStartTracker_v129.EndScreenCompleteTime; if (num > 12f) { return; } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || localCharacter.refs == null || (Object)(object)localCharacter.refs.afflictions == (Object)null) { return; } CharacterAfflictions afflictions = localCharacter.refs.afflictions; float[] array = new float[12]; for (int i = 0; i < 12; i++) { array[i] = afflictions.GetCurrentStatus((STATUSTYPE)i); } float statusSum = afflictions.statusSum; float maxStamina = localCharacter.GetMaxStamina(); float num2 = (((Object)(object)localCharacter.data != (Object)null) ? localCharacter.data.currentStamina : 0f); if (!_initialized) { _records.Clear(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("{\"type\":\"INIT\",\"elapsed\":").Append(num.ToString("F3")); stringBuilder.Append(",\"statusSum\":").Append(statusSum.ToString("F4")); stringBuilder.Append(",\"maxStam\":").Append(maxStamina.ToString("F4")); stringBuilder.Append(",\"curStam\":").Append(num2.ToString("F4")); stringBuilder.Append(",\"statuses\":{"); for (int j = 0; j < 12; j++) { if (j > 0) { stringBuilder.Append(","); } stringBuilder.Append("\"").Append((object)(STATUSTYPE)j).Append("\":") .Append(array[j].ToString("F4")); _prevStatuses[j] = array[j]; } stringBuilder.Append("}}"); _records.Add(stringBuilder.ToString()); _initialized = true; return; } for (int k = 0; k < 12; k++) { float num3 = array[k] - _prevStatuses[k]; if (Mathf.Abs(num3) > 0.001f) { StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append("{\"type\":\"CHANGE\",\"elapsed\":").Append(num.ToString("F3")); stringBuilder2.Append(",\"status\":\"").Append((object)(STATUSTYPE)k).Append("\""); stringBuilder2.Append(",\"prev\":").Append(_prevStatuses[k].ToString("F4")); stringBuilder2.Append(",\"cur\":").Append(array[k].ToString("F4")); stringBuilder2.Append(",\"delta\":").Append(num3.ToString("F4")); stringBuilder2.Append(",\"statusSum\":").Append(statusSum.ToString("F4")); stringBuilder2.Append(",\"maxStam\":").Append(maxStamina.ToString("F4")); stringBuilder2.Append(",\"curStam\":").Append(num2.ToString("F4")); stringBuilder2.Append("}"); _records.Add(stringBuilder2.ToString()); _prevStatuses[k] = array[k]; } } } } private void DumpJson() { try { if (_records.Count == 0) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v150 F8] record 0개 — 컷씬 진행 중에 F8 눌러야 합니다."); } return; } string text = DateTime.Now.ToString("yyyyMMdd_HHmmss"); string path = "flag_status_dmg_" + text + ".json"; string text2 = Path.Combine(Paths.BepInExRootPath, path); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("{"); stringBuilder.Append(" \"timestamp\":\"").Append(text).AppendLine("\","); stringBuilder.Append(" \"recordCount\":").Append(_records.Count).AppendLine(","); stringBuilder.AppendLine(" \"records\": ["); for (int i = 0; i < _records.Count; i++) { stringBuilder.Append(" ").Append(_records[i]); if (i < _records.Count - 1) { stringBuilder.Append(","); } stringBuilder.AppendLine(); } stringBuilder.AppendLine(" ]"); stringBuilder.AppendLine("}"); File.WriteAllText(text2, stringBuilder.ToString()); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[v150 F8] JSON 저장 완료 — record {_records.Count}개 → {text2}"); } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[v150 F8] JSON 저장 예외: " + ex.Message)); } } } } public class DeathFieldTracker : MonoBehaviour { private static DeathFieldTracker _instance; private bool _prevFullyPassed; private bool _prevPassed; private bool _prevDead; public static void EnsureInstance() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_instance != (Object)null)) { GameObject val = new GameObject("FlagSurvival_DeathFieldTracker"); Object.DontDestroyOnLoad((Object)val); _instance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[DeathFieldTracker] v142 활성 — fullyPassedOut/passedOut/dead 변경 추적"); } } } private void Update() { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null) { return; } PeakHandler instance = Singleton.Instance; if (!((Object)(object)instance != (Object)null) || !instance.isPlayingCinematic) { return; } bool fullyPassedOut = localCharacter.data.fullyPassedOut; bool passedOut = localCharacter.data.passedOut; bool dead = localCharacter.data.dead; if (fullyPassedOut != _prevFullyPassed || passedOut != _prevPassed || dead != _prevDead) { float endScreenCompleteTime = CameraCStartTracker_v129.EndScreenCompleteTime; float num = ((endScreenCompleteTime > 0f) ? (Time.time - endScreenCompleteTime) : (-1f)); string arg = ((num >= 0f) ? $"+{num:F2}s" : "?"); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)($"[v142 DeathTracker] (Time={Time.time:F2} EndScreen{arg}) " + $"fullyPassedOut: {_prevFullyPassed}→{fullyPassedOut}, " + $"passedOut: {_prevPassed}→{passedOut}, " + $"dead: {_prevDead}→{dead}")); } StackTrace stackTrace = new StackTrace(fNeedFileInfo: true); string text = ((stackTrace.FrameCount <= 1) ? "?" : (stackTrace.GetFrame(1)?.GetMethod()?.DeclaringType?.FullName ?? "?")); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)("[v142 DeathTracker] caller hint: " + text)); } _prevFullyPassed = fullyPassedOut; _prevPassed = passedOut; _prevDead = dead; } } } private void Awake() { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[AnimatorProtect] v29: 중력 가속도 1/3 (-3.27 m/s²) — 더 천천히 떨어짐"); } TransformProtectTick.EnsureInstance(); DiagnosticTick.EnsureInstance(); AnimatorEnableTick.EnsureInstance(); FaintTick.EnsureInstance(); DeathFieldTracker.EnsureInstance(); NoFaintTick.EnsureInstance(); NoDeadTick.EnsureInstance(); StatusCleanupTick.EnsureInstance(); StatusDamageTracker_v149.EnsureInstance(); FlailMotionTracker_v160.EnsureInstance(); BellyUpTick_v167.EnsureInstance(); } private static bool ShouldAllowFallDamage() { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || !instance.isPlayingCinematic) { return true; } if (CameraCStartTracker_v129.EndScreenCompleteTime < 0f) { return true; } if (Time.time - CameraCStartTracker_v129.EndScreenCompleteTime < 12f) { return false; } return true; } } [HarmonyPatch(typeof(PeakHandler), "EndScreenComplete")] public static class Patch_EndScreenComplete_CameraC { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PeakHandler ph; private float 5__2; private GameObject 5__3; private List 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Expected O, but got Unknown //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: 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_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: 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_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = Time.time; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[CameraC] ▶ Coroutine 시작 — Time.time={5__2:F3}, WaitForSecondsRealtime({13.5f}) 시작"); } <>2__current = (object)new WaitForSecondsRealtime(13.5f); <>1__state = 1; return true; } case 1: { <>1__state = -1; float num = Time.time - 5__2; ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[CameraC] ◆ Wait 종료 — 실제 경과 {num:F3}초 (목표 {13.5f}초), Time.time={Time.time:F3}"); } Camera val = null; string text = "?"; try { object? obj = typeof(PeakHandler).GetField("peakSequence", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(ph); GameObject val2 = (GameObject)((obj is GameObject) ? obj : null); if ((Object)(object)val2 != (Object)null) { val = val2.GetComponentInChildren(true); if ((Object)(object)val != (Object)null) { text = "peakSequence"; } Transform[] componentsInChildren = val2.GetComponentsInChildren(true); ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)string.Format("[CameraC] peakSequence 자식 {0}개. 카메라: {1}", componentsInChildren.Length, ((Object)(object)val != (Object)null) ? ((Object)((Component)val).gameObject).name : "null")); } } else { ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)"[CameraC] peakSequence GameObject 없음"); } } } catch (Exception ex) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)("[CameraC] peakSequence 검색 예외: " + ex.Message)); } } Camera val3; if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null) { 5__3 = Object.Instantiate(((Component)val).gameObject); ((Object)5__3).name = "FlagSurvival_CameraC_Cloned"; 5__3.transform.SetParent((Transform)null, false); 5__3.SetActive(true); val3 = 5__3.GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = 5__3.GetComponentInChildren(true); } } else { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)"[CameraC] peakSequence 카메라 못 찾음 — 새 카메라 생성 fallback"); } 5__3 = new GameObject("FlagSurvival_CameraC_New"); 5__3.transform.SetParent((Transform)null, false); val3 = 5__3.AddComponent(); val3.clearFlags = (CameraClearFlags)1; val3.cullingMask = -1; } if ((Object)(object)val3 == (Object)null) { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogError((object)"[CameraC] Camera 컴포넌트 없음 — 종료"); } return false; } val3.depth = 100f; val3.fieldOfView = 15f; val3.targetTexture = null; ((Behaviour)val3).enabled = true; CameraCController cameraCController = 5__3.AddComponent(); cameraCController.startPos = CAMERA_C_START_POS; cameraCController.endPos = CAMERA_C_START_POS + CAMERA_C_END_OFFSET; cameraCController.lookAtTarget = LOOK_AT_TARGET; cameraCController.duration = 11f; cameraCController.fovStart = 15f; cameraCController.fovRestore = 60f; cameraCController.fovRestoreAt = 13.5f; cameraCController.startDelay = 0f; cameraCController.cam = val3; AudioSource[] componentsInChildren2 = 5__3.GetComponentsInChildren(true); foreach (AudioSource val4 in componentsInChildren2) { if ((Object)(object)val4 != (Object)null) { val4.Stop(); Object.Destroy((Object)(object)val4); } } 5__3.transform.position = CAMERA_C_START_POS; 5__3.transform.LookAt(LOOK_AT_TARGET); 5__4 = new List(); Camera[] allCameras = Camera.allCameras; foreach (Camera val5 in allCameras) { if ((Object)(object)val5 != (Object)null && (Object)(object)val5 != (Object)(object)val3 && ((Behaviour)val5).enabled) { ((Behaviour)val5).enabled = false; 5__4.Add(val5); } } ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)$"[CameraC] B 카메라 ({text}) 생성 — pos=({CAMERA_C_START_POS.x},{CAMERA_C_START_POS.y},{CAMERA_C_START_POS.z}), look=({LOOK_AT_TARGET.x:F1},{LOOK_AT_TARGET.y:F1},{LOOK_AT_TARGET.z:F1}), FOV={15f}, 다른 카메라 {5__4.Count}개 비활성"); } Vector3 val6 = CAMERA_C_START_POS + CAMERA_C_END_OFFSET; ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogWarning((object)$"[CameraC] 카메라 무빙 시작 — duration={11f}초, FOV {15f}→{60f} ({13.5f}초), 끝 위치=({val6.x:F1},{val6.y:F1},{val6.z:F1})"); } <>2__current = (object)new WaitForSecondsRealtime(11f); <>1__state = 2; return true; } case 2: { <>1__state = -1; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CameraC] 카메라 무빙 종료"); } foreach (Camera item in 5__4) { if ((Object)(object)item != (Object)null) { ((Behaviour)item).enabled = true; } } Object.Destroy((Object)(object)5__3); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[CameraC] B 카메라 제거 — 다른 카메라 {5__4.Count}개 복구 + 엔딩 크레딧"); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const float CAMERA_C_DELAY = 13.5f; private const float CAMERA_C_DURATION = 11f; private const float FOV_RESTORE_AT = 13.5f; private const float DUMMY_DESTROY_AFTER = 30f; private const float CAMERA_C_FOV = 15f; private const float CAMERA_C_FOV_RESTORE = 60f; private static readonly Vector3 CAMERA_C_START_POS = new Vector3(6.9f, 1193f, 2185.5f); private static readonly Vector3 CAMERA_C_END_OFFSET = new Vector3(5f, 2.5f, 0f); private static readonly Vector3 LOOK_AT_TARGET = new Vector3(6.82f, 1185.4f, 2185.52f); private static readonly Vector3[] DUMMY_5_POSITIONS = (Vector3[])(object)new Vector3[5] { new Vector3(5.7f, 1185.4f, 2183.8f), new Vector3(7.8f, 1185.7f, 2183.6f), new Vector3(9.1f, 1185.5f, 2186.2f), new Vector3(6.6f, 1185.2f, 2188f), new Vector3(4.9f, 1185.1f, 2186f) }; public static void Postfix(PeakHandler __instance) { if ((Object)(object)__instance == (Object)null) { return; } if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[v155] PvE 모드 — CameraC Postfix SKIP (PEAK 자연 컷씬)"); } return; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[CameraC] ★ Postfix 호출 — Time.time={Time.time:F3}, frameCount={Time.frameCount}, timeScale={Time.timeScale:F2}"); } ((MonoBehaviour)__instance).StartCoroutine(CameraCSequence(__instance)); } [IteratorStateMachine(typeof(d__11))] private static IEnumerator CameraCSequence(PeakHandler ph) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { ph = ph }; } } public class CameraCController : MonoBehaviour { public Vector3 startPos; public Vector3 endPos; public Vector3 lookAtTarget; public float duration; public float fovStart; public float fovRestore; public float fovRestoreAt; public float startDelay; public Camera cam; private float waited; private float t; private bool fovRestored; private void LateUpdate() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) if (waited < startDelay) { ((Component)this).transform.position = startPos; ((Component)this).transform.LookAt(lookAtTarget); waited += Time.deltaTime; } else if (!(t >= duration)) { float num = ((duration > 0f) ? (t / duration) : 0f); float num2 = num * num; ((Component)this).transform.position = Vector3.Lerp(startPos, endPos, num2); ((Component)this).transform.LookAt(lookAtTarget); if ((Object)(object)cam != (Object)null) { float num3 = ((fovRestoreAt > 0f) ? Mathf.Clamp01(t / fovRestoreAt) : 1f); float num4 = 1f - (1f - num3) * (1f - num3); cam.fieldOfView = Mathf.Lerp(fovStart, fovRestore, num4); } t += Time.deltaTime; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.cutscenedebug", "Flag Survival Cutscene Debug", "1.0.0")] public class FlagCutsceneDebugPlugin : BaseUnityPlugin { private void Awake() { FlagCutsceneDebug.Initialize(); } } public static class FlagCutsceneDebug { private class DebugTick : MonoBehaviour { private void Update() { Keyboard current = Keyboard.current; if (current != null) { bool flag = ((ButtonControl)current.leftCtrlKey).isPressed || ((ButtonControl)current.rightCtrlKey).isPressed; bool flag2 = ((ButtonControl)current.leftShiftKey).isPressed || ((ButtonControl)current.rightShiftKey).isPressed; if (((ButtonControl)current.f7Key).wasPressedThisFrame && flag && flag2) { ForceEndCutscene(); } if (((ButtonControl)current.f9Key).wasPressedThisFrame && flag && !flag2) { ForceSummonHelicopter(); } if (((ButtonControl)current.f10Key).wasPressedThisFrame && flag && !flag2) { ForceEndCutsceneDirect(); } } } } private static DebugTick _tickInstance; public static void Initialize() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_tickInstance != (Object)null)) { GameObject val = new GameObject("FlagCutsceneDebug_Tick"); Object.DontDestroyOnLoad((Object)val); _tickInstance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[CutsceneDebug] v5 활성: Ctrl+Shift+F7=강제컷씬(RPCEndGame_ForceWin), Ctrl+F9=SummonHelicopter, Ctrl+F10=EndCutscene 직접"); } } } public static void ForceSummonHelicopter() { try { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CutsceneDebug] PeakHandler 없음 (인게임 X)"); } return; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[CutsceneDebug] ★ Ctrl+F9 SummonHelicopter 호출 ★"); } instance.SummonHelicopter(); } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[CutsceneDebug] SummonHelicopter 예외: " + ex.Message)); } } } public static void ForceEndCutsceneDirect() { try { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CutsceneDebug] PeakHandler 없음 (인게임 X)"); } return; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[CutsceneDebug] ★ Ctrl+F10 EndCutscene 직접 호출 ★"); } instance.EndCutscene(); } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[CutsceneDebug] EndCutscene 예외: " + ex.Message)); } } } public static void ForceEndCutscene() { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CutsceneDebug] localCharacter 없음 — 게임 진입 후 다시 시도"); } return; } if ((Object)(object)((MonoBehaviourPun)localCharacter).photonView == (Object)null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[CutsceneDebug] localCharacter.photonView 없음"); } return; } bool flag = false; try { flag = PhotonNetwork.IsMasterClient; } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[CutsceneDebug] PhotonNetwork.IsMasterClient 접근 실패: " + ex.Message)); } return; } if (!flag) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)"[CutsceneDebug] ⚠ 호스트만 강제 컷씬 호출 가능. 게스트 무시."); } return; } try { PhotonView photonView = ((MonoBehaviourPun)localCharacter).photonView; string arg = "?"; try { arg = ((photonView.Owner != null) ? photonView.Owner.NickName : "(null Owner)"); } catch { } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogInfo((object)$"[CutsceneDebug][v3진단] photonView ViewID={photonView.ViewID}, IsMine={photonView.IsMine}, Owner={arg}"); } bool flag2 = false; try { flag2 = (Object)(object)Singleton.Instance != (Object)null; } catch { } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogInfo((object)$"[CutsceneDebug][v3진단] PeakHandler.Instance 존재={flag2}"); } int num = Character.AllCharacters?.Count ?? (-1); ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogInfo((object)$"[CutsceneDebug][v3진단] Character.AllCharacters.Count={num}"); } if (num > 0) { Character obj3 = Character.AllCharacters[0]; bool flag3 = obj3?.refs != null; bool flag4 = (Object)(object)obj3?.refs?.stats != (Object)null; ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogInfo((object)$"[CutsceneDebug][v3진단] AllCharacters[0].refs={flag3}, refs.stats={flag4}"); } } } catch (Exception ex2) { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogError((object)("[CutsceneDebug][v3진단] dump 예외: " + ex2.Message)); } } try { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)"[CutsceneDebug] ★ 강제 컷씬 호출 (RPCEndGame_ForceWin) ★"); } ((MonoBehaviourPun)localCharacter).photonView.RPC("RPCEndGame_ForceWin", (RpcTarget)0, Array.Empty()); } catch (Exception ex3) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(ex3.GetType().Name + ": " + ex3.Message); Exception innerException = ex3.InnerException; int num2 = 0; while (innerException != null && num2 < 5) { stringBuilder.Append($"\n └─ Inner[{num2}] {innerException.GetType().Name}: {innerException.Message}"); if (!string.IsNullOrEmpty(innerException.StackTrace)) { string[] array = innerException.StackTrace.Split('\n'); int num3 = Math.Min(6, array.Length); for (int i = 0; i < num3; i++) { stringBuilder.Append("\n " + array[i].TrimEnd()); } } innerException = innerException.InnerException; num2++; } ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogError((object)$"[CutsceneDebug] RPC 호출 실패:\n{stringBuilder}"); } } } } [HarmonyPatch(typeof(CharacterStats), "Win")] internal static class Patch_CharacterStats_Win_Prefix { private static void Prefix(CharacterStats __instance) { try { if ((Object)(object)__instance == (Object)null || __instance.timelineInfo == null) { return; } IList timelineInfo = __instance.timelineInfo; if (timelineInfo == null || timelineInfo.Count > 0) { return; } Type[] genericArguments = __instance.timelineInfo.GetType().GetGenericArguments(); if (genericArguments != null && genericArguments.Length != 0) { Type type = genericArguments[0]; object value = Activator.CreateInstance(type); timelineInfo.Add(value); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)("[CutsceneDebug] CharacterStats.Win Prefix: timelineInfo 비어있음 → 더미 1개 추가 (" + type.Name + ")")); } } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[CutsceneDebug] Win Prefix 예외: " + ex.GetType().Name + ": " + ex.Message)); } } } } internal static class CutsceneMusicHelper { private static PeakHandler _cachedPh; private static int _cacheFrame = -1; public static bool _postEndScreenBlock = false; public static bool IsCutscenePlaying() { if ((Object)(object)_cachedPh == (Object)null || _cacheFrame != Time.frameCount) { _cachedPh = Object.FindObjectOfType(); _cacheFrame = Time.frameCount; } if ((Object)(object)_cachedPh != (Object)null) { return _cachedPh.isPlayingCinematic; } return false; } public static bool IsBlocked() { if (!IsCutscenePlaying()) { return _postEndScreenBlock; } return true; } } [HarmonyPatch(typeof(BiomeMusicCheck), "Update")] public static class Patch_BiomeMusicCheck_SkipDuringCutscene { public static bool Prefix() { return !CutsceneMusicHelper.IsBlocked(); } } [HarmonyPatch(typeof(EnableMusic), "Update")] public static class Patch_EnableMusic_SkipDuringCutscene { public static bool Prefix() { return !CutsceneMusicHelper.IsBlocked(); } } [HarmonyPatch(typeof(DayNightManager), "BlendProfiles")] public static class Patch_DayNightManager_BlendProfiles_SkipBlocked { public static bool Prefix() { if (CutsceneMusicHelper.IsBlocked()) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[Environment] DayNightManager.BlendProfiles SKIP (차단 상태)"); } return false; } return true; } } [HarmonyPatch(typeof(MapHandler), "JumpToSegmentLogic")] public static class Patch_MapHandler_JumpToSegmentLogic_SkipBlocked { public static bool Prefix(Segment segment) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (CutsceneMusicHelper.IsBlocked()) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[Environment] JumpToSegmentLogic SKIP — segment={segment} (차단 상태)"); } return false; } return true; } } [HarmonyPatch(typeof(LavaRising), "Update")] public static class Patch_LavaRising_Update_SkipBlocked { public static bool Prefix() { return !CutsceneMusicHelper.IsBlocked(); } } [HarmonyPatch(typeof(PeakHandler), "EndScreenComplete")] public static class Patch_EndScreenComplete_BlockFlag { public static void Postfix() { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[v155] PvE 모드 — Environment EndScreenComplete BlockFlag SKIP (PEAK 자연 흐름)"); } return; } CutsceneMusicHelper._postEndScreenBlock = true; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[Environment] ★ 차단 플래그 set — 다음 버튼 ~ Airport 진입까지 음악/배경 변경 X ★"); } try { MapHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null || instance.segments == null) { return; } int num = 4; if (num < 0 || num >= instance.segments.Length) { return; } MapSegment val = instance.segments[num]; if (val == null || (Object)(object)val.segmentParent == (Object)null) { return; } int num2 = 0; AudioSource[] componentsInChildren = val.segmentParent.GetComponentsInChildren(true); foreach (AudioSource val2 in componentsInChildren) { if (!((Object)(object)val2 == (Object)null)) { if (val2.isPlaying) { val2.Stop(); } ((Behaviour)val2).enabled = false; num2++; } } if ((Object)(object)val.segmentCampfire != (Object)null) { componentsInChildren = val.segmentCampfire.GetComponentsInChildren(true); foreach (AudioSource val3 in componentsInChildren) { if (!((Object)(object)val3 == (Object)null)) { if (val3.isPlaying) { val3.Stop(); } ((Behaviour)val3).enabled = false; num2++; } } } ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[Environment] 가마 segment AudioSource {num2}개 Stop"); } val.segmentParent.SetActive(false); if ((Object)(object)val.segmentCampfire != (Object)null) { val.segmentCampfire.SetActive(false); } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)"[Environment] 가마 segment GameObject 비활성 (segmentParent + segmentCampfire)"); } } catch (Exception ex) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)("[Environment] 가마 AudioSource Stop 예외: " + ex.Message)); } } try { LavaRising instance2 = Singleton.Instance; if (!((Object)(object)instance2 != (Object)null) || !((Object)(object)((Component)instance2).gameObject != (Object)null)) { return; } int num3 = 0; AudioSource[] componentsInChildren = ((Component)instance2).GetComponentsInChildren(true); foreach (AudioSource val4 in componentsInChildren) { if (!((Object)(object)val4 == (Object)null)) { if (val4.isPlaying) { val4.Stop(); } ((Behaviour)val4).enabled = false; num3++; } } ((Component)instance2).gameObject.SetActive(false); ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$"[Environment] LavaRising 비활성 (AudioSource {num3}개 Stop + GameObject SetActive(false))"); } } catch (Exception ex2) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)("[Environment] LavaRising 비활성 예외: " + ex2.Message)); } } } } [HarmonyPatch(typeof(AirportCheckInKiosk), "Start")] public static class Patch_AirportCheckInKiosk_Start_ClearFlag { public static void Postfix() { if (CutsceneMusicHelper._postEndScreenBlock) { CutsceneMusicHelper._postEndScreenBlock = false; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[Environment] ★ Airport 진입 — 차단 플래그 reset (다음 게임 정상 작동) ★"); } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.cutsceneteleport", "Flag Survival Cutscene Teleport", "1.0.0")] public class FlagCutsceneTeleportPlugin : BaseUnityPlugin { private void Awake() { SceneManager.sceneLoaded += OnSceneLoaded; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[CutsceneTeleport] Phase B v36: AnimatorProtect 사용 + v28 Bodypart OFF + WarpPlayerRPC만"); } } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (((Scene)(ref scene)).name == null || !((Scene)(ref scene)).name.Contains("Airport")) { return; } try { int num = 0; Scoutmaster[] array = Resources.FindObjectsOfTypeAll(); foreach (Scoutmaster val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null)) { Scene scene2 = ((Component)val).gameObject.scene; if (((Scene)(ref scene2)).IsValid()) { ((Component)val).gameObject.SetActive(true); num++; } } } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[CutsceneTeleport] Airport 씬 진입 ({((Scene)(ref scene)).name}) — ScoutMaster {num}개 활성 복원"); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[CutsceneTeleport] Airport ScoutMaster 복원 예외: " + ex.Message)); } } } } [HarmonyPatch(typeof(PeakHandler), "EndScreenComplete")] internal static class Patch_EndScreenComplete_Postfix { [CompilerGenerated] private sealed class d__42 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PeakHandler peakHandler; private Character 5__2; private int 5__3; private object 5__4; private PropertyInfo 5__5; private Quaternion 5__6; private GameObject 5__7; private Camera 5__8; private Vector3 5__9; private int 5__10; private float 5__11; private Object 5__12; private float 5__13; private int 5__14; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__42(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__4 = null; 5__5 = null; 5__7 = null; 5__8 = null; 5__12 = null; <>1__state = -2; } private bool MoveNext() { //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Expected O, but got Unknown //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Expected O, but got Unknown //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_0886: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Expected O, but got Unknown //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) ManualLogSource log12; int num6; ManualLogSource log13; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = Character.localCharacter; Camera main = Camera.main; if ((Object)(object)5__2 == (Object)null || (Object)(object)main == (Object)null || 5__2.refs == null || (Object)(object)5__2.refs.ragdoll == (Object)null || 5__2.refs.ragdoll.partList == null) { ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)"[CameraDescent] 시작 실패 — local/cam/ragdoll 없음"); } return false; } 5__3 = Time.frameCount; ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)$"[CameraDescent] ★ 시작 frame={5__3} ★"); } 5__4 = null; 5__5 = null; try { 5__4 = typeof(PeakHandler).GetField("endCutsceneAnimator", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(peakHandler); if (5__4 != null) { 5__5 = 5__4.GetType().GetProperty("speed"); 5__5?.SetValue(5__4, 0f); ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)"[CameraDescent] 1. A Animator 정지 (speed=0)"); } } else { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)"[CameraDescent] A Animator field 없음 — 정지 못 함, 진행"); } } } catch (Exception ex) { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)("[CameraDescent] A Animator reflection 예외: " + ex.Message)); } } Vector3 position = ((Component)main).transform.position; float y = ((Component)main).transform.eulerAngles.y; Vector3 val = position + Vector3.up * 10f; Vector3 val2 = position; 5__6 = Quaternion.Euler(-15f, y, 0f); 5__7 = new GameObject("FlagSurvival_BCam"); 5__8 = 5__7.AddComponent(); 5__8.depth = 100f; 5__8.fieldOfView = 60f; 5__8.clearFlags = (CameraClearFlags)1; 5__8.cullingMask = main.cullingMask; 5__7.transform.position = val; 5__7.transform.rotation = 5__6; ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogWarning((object)$"[CameraDescent] 2. B 카메라 생성 — pos=({val.x:F1},{val.y:F1},{val.z:F1}) → ({val2.x:F1},{val2.y:F1},{val2.z:F1}), pitch={-15f}°, FOV={60f}°"); } <>2__current = (object)new WaitForSecondsRealtime(0.5f); <>1__state = 1; return true; } case 1: { <>1__state = -1; 5__9 = 5__8.ViewportToWorldPoint(new Vector3(0.5f, 1.3f, 1.5f)); int num = 0; foreach (Bodypart part in 5__2.refs.ragdoll.partList) { if (!((Object)(object)part == (Object)null) && !((Object)(object)part.Rig == (Object)null)) { part.Rig.position = 5__9; part.Rig.linearVelocity = Vector3.zero; if ((Object)(object)((Component)part).transform != (Object)null) { ((Component)part).transform.position = 5__9; } num++; } } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[CameraDescent] 2.5. 캐릭터 시작 위치 → ({5__9.x:F1},{5__9.y:F1},{5__9.z:F1}), {num}개 BodyPart"); } 5__10 = Time.frameCount; ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[CameraDescent] 3. B 카메라 추적 시작 — vp.y {1.3f} → {-0.3f}, {4f}초, 중력 ×{0.3f}"); } float num2 = MathF.PI / 3f; 5__11 = 1.5f * Mathf.Tan(num2 * 0.5f); 5__12 = null; try { if (5__2.refs.ragdoll.partDict != null && 5__2.refs.ragdoll.partDict.TryGetValue((BodypartType)0, out var value) && (Object)(object)value != (Object)null) { 5__12 = (Object)(object)((Component)value).transform; } } catch { } 5__13 = 0f; 5__14 = 0; goto IL_076b; } case 2: <>1__state = -1; goto IL_076b; case 3: { <>1__state = -1; Object.Destroy((Object)(object)5__7); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CameraDescent] 5. B 카메라 제거 → A 카메라 복귀"); } try { if (5__5 != null && 5__4 != null) { 5__5.SetValue(5__4, 1f); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[CameraDescent] 6. A Animator 재개 (speed=1)"); } } } catch { } int frameCount = Time.frameCount; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[CameraDescent] ★ 종료 frame={frameCount} ({frameCount - 5__3}f) ★"); } return false; } IL_076b: if (5__13 < 4f) { float num3 = 5__13 / 4f; float num4 = Mathf.Lerp(1.3f, -0.3f, num3); Object obj3 = 5__12; Transform val3 = (Transform)(object)((obj3 is Transform) ? obj3 : null); Vector3 val4 = ((val3 != null && (Object)(object)val3 != (Object)null) ? val3.position : ((5__2.refs.ragdoll.partList.Count <= 0 || !((Object)(object)5__2.refs.ragdoll.partList[0] != (Object)null) || !((Object)(object)((Component)5__2.refs.ragdoll.partList[0]).transform != (Object)null)) ? 5__9 : ((Component)5__2.refs.ragdoll.partList[0]).transform.position)); float num5 = (num4 - 0.5f) * 2f * 5__11; 5__7.transform.rotation = 5__6; Vector3 forward = 5__7.transform.forward; Vector3 up = 5__7.transform.up; Vector3 position2 = val4 - forward * 1.5f - up * num5; 5__7.transform.position = position2; foreach (Bodypart part2 in 5__2.refs.ragdoll.partList) { if (!((Object)(object)part2 == (Object)null) && !((Object)(object)part2.Rig == (Object)null) && !part2.Rig.isKinematic) { part2.Rig.AddForce(Physics.gravity * -0.7f, (ForceMode)5); } } 5__14++; 5__13 += Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } log12 = FlagSurvivalPlugin.Log; if (log12 != null) { log12.LogWarning((object)$"[CameraDescent] 3. B 카메라 추적 종료 — frame={Time.frameCount} ({Time.frameCount - 5__10}f), {5__14}회 적용"); } num6 = 0; foreach (Bodypart part3 in 5__2.refs.ragdoll.partList) { if (!((Object)(object)part3 == (Object)null) && !((Object)(object)part3.Rig == (Object)null)) { part3.Rig.position = CDS_HIDE; part3.Rig.linearVelocity = Vector3.zero; if ((Object)(object)((Component)part3).transform != (Object)null) { ((Component)part3).transform.position = CDS_HIDE; } num6++; } } log13 = FlagSurvivalPlugin.Log; if (log13 != null) { log13.LogWarning((object)$"[CameraDescent] 4. 캐릭터 숨김 — {num6}개 BodyPart"); } <>2__current = (object)new WaitForSecondsRealtime(0.5f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PeakHandler ph; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(3.5f); <>1__state = 1; return true; case 1: <>1__state = -1; try { object obj = typeof(PeakHandler).GetField("endCutsceneAnimator", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(ph); if (obj != null) { PropertyInfo property = obj.GetType().GetProperty("speed"); if (property != null) { property.SetValue(obj, 1f); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[CutsceneSpeed] {3.5f}초 후 endCutsceneAnimator.speed = {1f} (감속)"); } } } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[CutsceneSpeed] 예외: " + ex.Message)); } } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__56 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public PeakHandler peakHandler; private Character 5__2; private Component 5__3; private float 5__4; private int 5__5; private Character 5__6; private Component 5__7; private float 5__8; private int 5__9; private int 5__10; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__56(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__6 = null; 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0b82: Unknown result type (might be due to invalid IL or missing references) //IL_0b87: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_0ac8: Unknown result type (might be due to invalid IL or missing references) //IL_0ace: Unknown result type (might be due to invalid IL or missing references) //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0ad5: Unknown result type (might be due to invalid IL or missing references) //IL_0ada: Unknown result type (might be due to invalid IL or missing references) //IL_0adc: Unknown result type (might be due to invalid IL or missing references) //IL_0ae1: Unknown result type (might be due to invalid IL or missing references) //IL_0ae3: Unknown result type (might be due to invalid IL or missing references) //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_0c8b: Unknown result type (might be due to invalid IL or missing references) //IL_0c97: Unknown result type (might be due to invalid IL or missing references) //IL_0ca3: Unknown result type (might be due to invalid IL or missing references) //IL_0cbc: Unknown result type (might be due to invalid IL or missing references) //IL_0cc8: Unknown result type (might be due to invalid IL or missing references) //IL_0cd4: Unknown result type (might be due to invalid IL or missing references) //IL_0ced: Unknown result type (might be due to invalid IL or missing references) //IL_0cf9: Unknown result type (might be due to invalid IL or missing references) //IL_0d05: Unknown result type (might be due to invalid IL or missing references) //IL_0d1e: Unknown result type (might be due to invalid IL or missing references) //IL_0d2a: Unknown result type (might be due to invalid IL or missing references) //IL_0d36: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Expected O, but got Unknown //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Expected O, but got Unknown //IL_0bc0: Unknown result type (might be due to invalid IL or missing references) //IL_0bc5: Unknown result type (might be due to invalid IL or missing references) //IL_0d58: Unknown result type (might be due to invalid IL or missing references) //IL_0d62: Expected O, but got Unknown //IL_0b21: Unknown result type (might be due to invalid IL or missing references) //IL_0b6f: Unknown result type (might be due to invalid IL or missing references) //IL_0b74: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b66: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09f4: Unknown result type (might be due to invalid IL or missing references) ManualLogSource log17; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(delay); <>1__state = 1; return true; case 1: { <>1__state = -1; int localLoserSlotIndex_Synced = GetLocalLoserSlotIndex_Synced(); ManualLogSource log18 = FlagSurvivalPlugin.Log; if (log18 != null) { log18.LogInfo((object)string.Format("[v154/v172] 2차 진입 — 자기 슬롯={0} ({1})", localLoserSlotIndex_Synced, (localLoserSlotIndex_Synced < 0) ? "winner/슬롯없음" : "패자")); } 5__2 = null; 5__3 = null; _ = Vector3.zero; bool flag2 = false; if (localLoserSlotIndex_Synced < 0) { ManualLogSource log19 = FlagSurvivalPlugin.Log; if (log19 != null) { log19.LogInfo((object)"[v154] 2차 자기 처리 SKIP — winner. RPC 순회 단계만 진행."); } flag2 = true; } if (localLoserSlotIndex_Synced >= 0) { try { if ((Object)(object)peakHandler == (Object)null) { return false; } 5__2 = Character.localCharacter; if ((Object)(object)5__2 == (Object)null) { return false; } if ((Object)(object)peakHandler.firstCutsceneScout == (Object)null) { return false; } Vector3 position = ((Component)peakHandler.firstCutsceneScout).transform.position; Vector3 val5 = LOSER_TARGETS_2ND[Mathf.Clamp(localLoserSlotIndex_Synced, 0, 4)]; ManualLogSource log20 = FlagSurvivalPlugin.Log; if (log20 != null) { log20.LogWarning((object)$"[v153] 2차 target → 패자 slot[{localLoserSlotIndex_Synced}] = ({val5.x:F1}, {val5.y:F1}, {val5.z:F1})"); } Bodypart[] componentsInChildren = ((Component)((Component)5__2).transform).GetComponentsInChildren(true); int num4 = 0; ManualLogSource log21 = FlagSurvivalPlugin.Log; if (log21 != null) { log21.LogInfo((object)"[CutsceneTeleport] [v36] v28 Bodypart 텔레포트 SKIP (AnimatorProtect 사용)"); } try { if (5__2.refs != null) { FieldInfo field2 = ((object)5__2.refs).GetType().GetField("animator"); if (field2 != null) { object? value2 = field2.GetValue(5__2.refs); Component val6 = (Component)((value2 is Component) ? value2 : null); if ((Object)(object)val6 != (Object)null) { val6.gameObject.SetActive(true); Behaviour val7 = (Behaviour)(object)((val6 is Behaviour) ? val6 : null); if ((Object)(object)val7 != (Object)null) { val7.enabled = true; } 5__3 = val6; ManualLogSource log22 = FlagSurvivalPlugin.Log; if (log22 != null) { log22.LogInfo((object)"[CutsceneTeleport] [v22] animator GameObject 활성 + Animator.enabled=true (fall 애니메이션)"); } } } } } catch (Exception ex5) { ManualLogSource log23 = FlagSurvivalPlugin.Log; if (log23 != null) { log23.LogError((object)("[CutsceneTeleport] animator 활성 예외: " + ex5.Message)); } } ManualLogSource log24 = FlagSurvivalPlugin.Log; if (log24 != null) { log24.LogWarning((object)($"[CutsceneTeleport] [v28] Bodypart 직접 텔레포트 (지연 {delay:F1}초) ★ " + $"헬기위치=({position.x:F1}, {position.y:F1}, {position.z:F1}), " + $"목표=({val5.x:F1}, {val5.y:F1}, {val5.z:F1}), Bodypart={num4}개")); } flag2 = true; } catch (Exception ex6) { ManualLogSource log25 = FlagSurvivalPlugin.Log; if (log25 != null) { log25.LogError((object)("[CutsceneTeleport] 텔레포트 예외: " + ex6.GetType().Name + ": " + ex6.Message + "\n" + ex6.StackTrace)); } } } if (!flag2) { return false; } <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 5; return true; } case 2: <>1__state = -1; try { MapHandler.JumpToSegment((Segment)4); ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogInfo((object)"[v33] JumpToSegment(TheKiln) — 가마 세그먼트로 점프"); } if ((Object)(object)peakHandler != (Object)null && (Object)(object)peakHandler.endCutscene != (Object)null) { peakHandler.endCutscene.SetActive(false); ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogInfo((object)"[v31] endCutscene.SetActive(false) — 컷씬 자산 OFF"); } } if ((Object)(object)MainCamera.instance != (Object)null && (Object)(object)((Component)MainCamera.instance).gameObject != (Object)null) { ((Component)MainCamera.instance).gameObject.SetActive(true); ManualLogSource log12 = FlagSurvivalPlugin.Log; if (log12 != null) { log12.LogInfo((object)"[v31] MainCamera.instance.gameObject.SetActive(true) — 본인 1인칭 ON"); } } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null && localCharacter.refs != null) { FieldInfo field = ((object)localCharacter.refs).GetType().GetField("animator"); if (field != null) { object? value = field.GetValue(localCharacter.refs); Component val2 = (Component)((value is Component) ? value : null); if ((Object)(object)val2 != (Object)null) { val2.gameObject.SetActive(true); ManualLogSource log13 = FlagSurvivalPlugin.Log; if (log13 != null) { log13.LogInfo((object)"[v31] 본 캐릭터 animator GameObject 활성 — mesh ON"); } } } } ManualLogSource log14 = FlagSurvivalPlugin.Log; if (log14 != null) { log14.LogWarning((object)"[v31] 카메라 변경 완료 — 본인 1인칭 시야 + 컷씬 자산 OFF"); } } catch (Exception ex4) { ManualLogSource log15 = FlagSurvivalPlugin.Log; if (log15 != null) { log15.LogError((object)("[v31] 카메라 변경 예외: " + ex4.Message)); } } return false; case 3: <>1__state = -1; try { if ((Object)(object)peakHandler.endCutscene != (Object)null) { peakHandler.endCutscene.SetActive(false); ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogInfo((object)"[v32] endCutscene OFF"); } } if ((Object)(object)MainCamera.instance != (Object)null && (Object)(object)((Component)MainCamera.instance).gameObject != (Object)null) { ((Component)MainCamera.instance).gameObject.SetActive(true); ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogInfo((object)"[v32] MainCamera 본인 1인칭 ON"); } } } catch (Exception ex3) { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogError((object)("[v32] 카메라 변경 예외: " + ex3.Message)); } } 5__8 = 0f; 5__9 = 0; 5__10 = 0; goto IL_051f; case 4: <>1__state = -1; 5__8 += 0.1f; goto IL_051f; case 5: <>1__state = -1; try { List allCharacters = Character.AllCharacters; if (allCharacters == null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v154] 2차 RPC — Character.AllCharacters null"); } } else { int num = 0; int num2 = 0; int num3 = 0; foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null || (Object)(object)((MonoBehaviourPun)item).photonView == (Object)null || ((MonoBehaviourPun)item).photonView.Owner == null) { continue; } if (!((MonoBehaviourPun)item).photonView.IsMine) { num3++; continue; } int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; int loserSlotForActor_Synced = GetLoserSlotForActor_Synced(actorNumber); if (loserSlotForActor_Synced < 0) { num2++; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[v154/v172] 2차 RPC SKIP actor={actorNumber} (winner 또는 슬롯 없음)"); } continue; } Vector3 val = LOSER_TARGETS_2ND[Mathf.Clamp(loserSlotForActor_Synced, 0, 4)]; try { ((MonoBehaviourPun)item).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, false }); ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[CutsceneTeleport][v154] ★ 2차 RPC actor={actorNumber} slot[{loserSlotForActor_Synced}] target=({val.x:F1}, {val.y:F1}, {val.z:F1}) ★"); } num++; } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)$"[v154] 2차 actor={actorNumber} RPC 예외: {ex.Message}"); } } } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[v154] 2차 RPC 완료 — 처리={num}명, winner SKIP={num2}명, not-mine SKIP={num3}명"); } } } catch (Exception ex2) { ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogError((object)("[v34/v37/v154] 2차 RPC 순회 예외: " + ex2.Message)); } } 5__4 = 0f; 5__5 = 0; break; case 6: { <>1__state = -1; 5__4 += 0.1f; break; } IL_051f: if (5__8 < 20f) { bool flag = false; Vector3 val3 = Vector3.zero; try { if ((Object)(object)5__6 == (Object)null || (Object)(object)((Component)5__6).transform == (Object)null) { flag = true; } else { if ((Object)(object)5__6.data != (Object)null) { if (5__6.data.dead) { 5__6.data.dead = false; 5__9++; } if (!5__6.data.fullyPassedOut) { 5__6.data.fullyPassedOut = true; } if (5__6.data.passedOut) { 5__6.data.passedOut = false; } if (5__6.data.deathTimer > 0f) { 5__6.data.deathTimer = 0f; } } if ((Object)(object)5__7 != (Object)null && (Object)(object)5__7.gameObject != (Object)null) { if (!5__7.gameObject.activeSelf) { 5__7.gameObject.SetActive(true); 5__10++; } Component obj = 5__7; Behaviour val4 = (Behaviour)(object)((obj is Behaviour) ? obj : null); if ((Object)(object)val4 != (Object)null && val4.enabled) { val4.enabled = false; } } if (5__6.refs != null && (Object)(object)5__6.refs.hip != (Object)null) { val3 = ((Component)5__6.refs.hip).transform.position; } } } catch { flag = true; } if (flag) { return false; } ManualLogSource log16 = FlagSurvivalPlugin.Log; if (log16 != null) { log16.LogInfo((object)$"[CutsceneTeleport] [v32 추적 t={5__8:F2}s] hip=({val3.x:F1}, {val3.y:F1}, {val3.z:F1}), dead 강제={5__9}회"); } <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 4; return true; } log17 = FlagSurvivalPlugin.Log; if (log17 != null) { log17.LogWarning((object)$"[v32] 추적 종료 ({20f:F0}초): dead 강제 {5__9}회, animator 강제 {5__10}회"); } return false; } if (5__4 < 20f) { _ = Vector3.zero; Vector3 val8 = Vector3.zero; Vector3 val9 = Vector3.zero; Vector3 val10 = Vector3.zero; Vector3 val11 = Vector3.zero; bool flag3 = false; try { if ((Object)(object)5__2 == (Object)null || (Object)(object)((Component)5__2).transform == (Object)null) { flag3 = true; } else { _ = ((Component)5__2).transform.position; if (5__2.refs != null && (Object)(object)5__2.refs.hip != (Object)null) { val8 = ((Component)5__2.refs.hip).transform.position; } try { val9 = 5__2.Center; } catch { } try { val10 = 5__2.Head; } catch { } try { if ((Object)(object)peakHandler != (Object)null && (Object)(object)peakHandler.firstCutsceneScout != (Object)null) { val11 = ((Component)peakHandler.firstCutsceneScout).transform.position; } } catch { } if ((Object)(object)5__3 != (Object)null && (Object)(object)5__3.gameObject != (Object)null) { if (!5__3.gameObject.activeSelf) { 5__3.gameObject.SetActive(true); 5__5++; } Component obj6 = 5__3; Behaviour val12 = (Behaviour)(object)((obj6 is Behaviour) ? obj6 : null); if ((Object)(object)val12 != (Object)null && val12.enabled) { val12.enabled = false; } } } } catch { flag3 = true; } if (flag3) { return false; } ManualLogSource log26 = FlagSurvivalPlugin.Log; if (log26 != null) { log26.LogInfo((object)($"[CutsceneTeleport] [추적 t={5__4:F2}s] " + $"hip=({val8.x:F1}, {val8.y:F1}, {val8.z:F1}), " + $"Torso=({val9.x:F1}, {val9.y:F1}, {val9.z:F1}), " + $"Head=({val10.x:F1}, {val10.y:F1}, {val10.z:F1}), " + $"★Scout=({val11.x:F1}, {val11.y:F1}, {val11.z:F1})")); } <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 6; return true; } ManualLogSource log27 = FlagSurvivalPlugin.Log; if (log27 != null) { log27.LogWarning((object)$"[CutsceneTeleport] 추적 종료 ({20f:F0}초): animator 강제 활성 {5__5}회"); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__55 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PeakHandler peakHandler; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(CAM_A_DELAY_Get()); <>1__state = 1; return true; case 1: <>1__state = -1; DoTeleportA(peakHandler); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PeakHandler peakHandler; private int 5__2; private int 5__3; private float 5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_018e: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; float num = CAM_A_DELAY_Get(); if (num <= 0f) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[CutsceneTeleport] 텔레포트 A 비활성 (Cfg=0)"); } return false; } float num2 = 52.8f; 5__2 = Mathf.Max(0, (int)(num * num2)); 5__3 = Time.frameCount; 5__4 = Time.unscaledTime; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[DIAG] 텔레포트A 카운트 시작 — frame={5__3}, 목표={5__2}f ({num:F2}초 × {num2:F1}FPS)"); } 5__5 = 0; break; } case 1: <>1__state = -1; 5__5++; break; } if (5__5 < 5__2) { <>2__current = null; <>1__state = 1; return true; } int frameCount = Time.frameCount; float num3 = Time.unscaledTime - 5__4; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[DIAG] 텔레포트A 카운트 종료 — frame={frameCount}, 실제={frameCount - 5__3}f / {num3:F3}초 (목표 {5__2}f)"); } Camera main = Camera.main; if ((Object)(object)main != (Object)null) { Vector3 position = ((Component)main).transform.position; Vector3 forward = ((Component)main).transform.forward; Vector3 val = position + forward * 30f; Vector3 val2 = position + forward * 50f; Vector3 val3 = position + forward * 80f; ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[CamCenter] ★ 텔레포트A 시점 카메라 — pos=({position.x:F1},{position.y:F1},{position.z:F1}) forward=({forward.x:F2},{forward.y:F2},{forward.z:F2}) FOV={main.fieldOfView:F1}° ★"); } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)"[CamCenter] 시야 중심점 (cam.pos + forward × 거리):"); } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$"[CamCenter] 30m → ({val.x:F1}, {val.y:F1}, {val.z:F1})"); } ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)$"[CamCenter] 50m → ({val2.x:F1}, {val2.y:F1}, {val2.z:F1}) ← 권장 텔레포트A 좌표 (Y +20 위로)"); } ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)$"[CamCenter] 80m → ({val3.x:F1}, {val3.y:F1}, {val3.z:F1})"); } ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)$"[CamCenter] ★ 권장 좌표 (50m 시야중심 + Y+20) = ({val2.x:F1}, {val2.y + 20f:F1}, {val2.z:F1}) — 위에서 떨어지듯 등장"); } } DoTeleportA(peakHandler); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__51 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PeakHandler peakHandler; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(9.4f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = DelayedTeleport(peakHandler, 0f); <>1__state = 2; return true; case 2: <>1__state = -1; ((MonoBehaviour)peakHandler).StartCoroutine(EnhancedGravityB()); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = EnhancedGravityCommon("A", 7f, 1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__49 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = EnhancedGravityCommon("B", 7f, 1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__50 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string tag; public float extra; public float duration; private Character 5__2; private int 5__3; private float 5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__50(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = Character.localCharacter; if ((Object)(object)5__2 == (Object)null || 5__2.refs == null || (Object)(object)5__2.refs.ragdoll == (Object)null || 5__2.refs.ragdoll.partList == null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)("[EnhancedGravity] " + tag + " 시작 실패 — ragdoll partList 없음")); } return false; } 5__3 = Time.frameCount; float num = 1f + extra; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[EnhancedGravity] {tag} 시작 — 추가 ×{extra} (총 ×{num}), {duration}초 동안, frame={5__3}"); } 5__4 = Time.unscaledTime + duration; 5__5 = 0; break; } case 1: <>1__state = -1; break; } if (Time.unscaledTime < 5__4) { if (5__2.refs.ragdoll.partList != null) { foreach (Bodypart part in 5__2.refs.ragdoll.partList) { if (!((Object)(object)part == (Object)null) && !((Object)(object)part.Rig == (Object)null) && !part.Rig.isKinematic) { part.Rig.AddForce(Physics.gravity * extra, (ForceMode)5); } } 5__5++; } <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; } int frameCount = Time.frameCount; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[EnhancedGravity] {tag} 종료 — frame={frameCount} (시작 {5__3}f, {frameCount - 5__3}f 동안), {5__5}회 적용"); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__53 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__53(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(12f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)Character.localCharacter == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[Secondary] localCharacter null — 종료"); } return false; } try { List allCharacters = Character.AllCharacters; if (allCharacters == null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[Secondary][v154] Character.AllCharacters null"); } return false; } int num = 0; int num2 = 0; int num3 = 0; foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null || (Object)(object)((MonoBehaviourPun)item).photonView == (Object)null || ((MonoBehaviourPun)item).photonView.Owner == null) { continue; } if (!((MonoBehaviourPun)item).photonView.IsMine) { num3++; continue; } int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; int loserSlotForActor_Synced = GetLoserSlotForActor_Synced(actorNumber); if (loserSlotForActor_Synced < 0) { num2++; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)$"[Secondary][v154/v172] 3차 SKIP actor={actorNumber} (winner 또는 슬롯 없음)"); } continue; } Vector3 val = LOSER_TARGETS_3RD[Mathf.Clamp(loserSlotForActor_Synced, 0, 4)]; try { ((MonoBehaviourPun)item).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, false }); ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[Secondary][v154] ★ 3차 actor={actorNumber} slot[{loserSlotForActor_Synced}] target=({val.x:F1}, {val.y:F1}, {val.z:F1}) RPC 호출 ★"); } num++; } catch (Exception ex) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)$"[Secondary][v154] 3차 actor={actorNumber} RPC 예외: {ex.Message}"); } } } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$"[Secondary][v154] 3차 완료 — 처리={num}명, winner SKIP={num2}명, not-mine SKIP={num3}명"); } } catch (Exception ex2) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)("[Secondary][v154] 3차 순회 예외: " + ex2.Message)); } } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__25 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float duration; private int 5__2; private bool 5__3; private float 5__4; private float 5__5; private int 5__6; private int 5__7; private int 5__8; private int 5__9; private int 5__10; private int 5__11; private float 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: 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_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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: 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_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Camera main = Camera.main; if ((Object)(object)main == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CamView] Camera.main null — 추적 실패"); } return false; } 5__2 = Time.frameCount; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[CamView] 추적 시작 — frame={5__2}, duration={duration:F1}초, FOV={main.fieldOfView:F1}° aspect={main.aspect:F2}"); } 5__3 = false; 5__4 = float.MaxValue; 5__5 = float.MinValue; 5__6 = -1; 5__7 = -1; 5__8 = 0; 5__9 = 0; 5__10 = 5; 5__11 = 0; 5__12 = Time.unscaledTime + duration; break; } case 1: <>1__state = -1; break; } if (Time.unscaledTime < 5__12) { Camera main = Camera.main; Character localCharacter = Character.localCharacter; if ((Object)(object)main != (Object)null && (Object)(object)localCharacter != (Object)null) { Vector3 position = ((Component)localCharacter).transform.position; try { CharacterRagdoll componentInChildren = ((Component)localCharacter).GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.partDict != null && componentInChildren.partDict.TryGetValue((BodypartType)0, out var value) && (Object)(object)value != (Object)null && (Object)(object)((Component)value).transform != (Object)null) { position = ((Component)value).transform.position; } } catch { } Vector3 val = main.WorldToViewportPoint(position); bool flag = val.x >= 0f && val.x <= 1f && val.y >= 0f && val.y <= 1f && val.z > 0f; int num = Time.frameCount - 5__2; 5__8++; Vector3 val2 = ((val.z > 0f) ? main.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, val.z)) : Vector3.zero); Vector3 val3 = ((Component)main).transform.position + ((Component)main).transform.forward * 50f; if (flag) { 5__9++; if (val.y < 5__4) { 5__4 = val.y; 5__6 = num; } if (val.y > 5__5) { 5__5 = val.y; 5__7 = num; } } if (flag && !5__3) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[CamView] ★ 시야 진입 — +{num}f, char=({position.x:F1},{position.y:F1},{position.z:F1}), vp=({val.x:F2},{val.y:F2},{val.z:F1}m)"); } } else if (!flag & 5__3) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[CamView] ★ 시야 이탈 — +{num}f, char=({position.x:F1},{position.y:F1},{position.z:F1}), vp=({val.x:F2},{val.y:F2},{val.z:F1}m)"); } } 5__3 = flag; if (5__8 % 5__10 == 0) { 5__11++; ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogInfo((object)$"[CamView] +{num,3}f char=({position.x:F1},{position.y:F1},{position.z:F1}) vp=({val.x:F2},{val.y:F2},{val.z:F1}m) inView={flag}"); } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogInfo((object)$"[CamView] viewCenter@{val.z:F0}m=({val2.x:F1},{val2.y:F1},{val2.z:F1}) viewCenter@50m=({val3.x:F1},{val3.y:F1},{val3.z:F1}) cam=({((Component)main).transform.position.x:F1},{((Component)main).transform.position.y:F1},{((Component)main).transform.position.z:F1})"); } } } <>2__current = null; <>1__state = 1; return true; } ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)$"[CamView] 추적 종료 — 총 {5__8}f, 시야안 {5__9}f ({((5__8 > 0) ? (100f * (float)5__9 / (float)5__8) : 0f):F1}%)"); } if (5__6 >= 0) { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)$"[CamView] viewport.y 최솟값(아래) = {5__4:F3} (+{5__6}f) ← 시야에서 가장 아래 위치"); } } if (5__7 >= 0) { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)$"[CamView] viewport.y 최댓값(위) = {5__5:F3} (+{5__7}f) ← 시야에서 가장 위 위치"); } } string arg = ((5__7 >= 0 && 5__6 >= 0 && 5__7 < 5__6) ? "위→아래 통과 ✓" : "위→아래 X"); ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)$"[CamView] 판단: maxY({5__5:F2})→minY({5__4:F2}) 패턴 = {arg}"); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private int 5__2; private float 5__3; private Vector3 5__4; private float 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0064: 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) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = Time.frameCount; 5__3 = Time.unscaledTime; 5__4 = Vector3.zero; Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null && (Object)(object)((Component)localCharacter).transform != (Object)null) { 5__4 = ((Component)localCharacter).transform.position; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[TrackPos] 추적 시작 — frame={5__2}, 초기 pos={5__4}"); } 5__5 = Time.unscaledTime + 30f; break; } case 1: { <>1__state = -1; Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)((Component)localCharacter).transform == (Object)null) { break; } Vector3 position = ((Component)localCharacter).transform.position; float num = Vector3.Distance(position, 5__4); if (num > 1f) { int num2 = Time.frameCount - 5__2; float num3 = Time.unscaledTime - 5__3; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)($"[TrackPos] ★ 위치 점프 — frame={num2}f / {num3:F3}s | " + $"이전=({5__4.x:F1},{5__4.y:F1},{5__4.z:F1}) → " + $"신규=({position.x:F1},{position.y:F1},{position.z:F1}), 거리={num:F2}m ★")); } } 5__4 = position; break; } } if (Time.unscaledTime < 5__5) { <>2__current = null; <>1__state = 1; return true; } ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[TrackPos] 추적 종료 (30초)"); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const float TELEPORT_HEIGHT = 30f; private const float TELEPORT_Z = 2100f; private const int TELEPORT_B_FRAMES = 720; private const float TELEPORT_DELAY = 10.426f; private const float CAM2_X = 10f; private const float CAM2_Y = 1193f; private const float CAM2_Z = 2156f; private const float TELEPORT_DELAY_CUTSCENE = 1f; private const bool USE_CAM2_ABSOLUTE = true; private const bool DISABLE_TELEPORT = false; private const bool USE_V32_FULL_TELEPORT = false; private const bool USE_V33_JUMP_TO_KILN = false; private const bool DISABLE_V28_BODYPART = true; private static readonly Vector3[] LOSER_TARGETS_2ND = (Vector3[])(object)new Vector3[7] { new Vector3(10f, 1193f, 2156f), new Vector3(11f, 1192f, 2158f), new Vector3(12f, 1199f, 2160f), new Vector3(13f, 1195f, 2158f), new Vector3(10f, 1204f, 2160f), new Vector3(11.5f, 1202f, 2159f), new Vector3(12.5f, 1203f, 2159f) }; private static readonly Vector3[] LOSER_TARGETS_3RD = (Vector3[])(object)new Vector3[7] { new Vector3(5.7f, 1185.4f, 2183.8f), new Vector3(7.8f, 1185.7f, 2183.6f), new Vector3(9.1f, 1185.5f, 2186.2f), new Vector3(6.6f, 1185.2f, 2188f), new Vector3(4.9f, 1185.1f, 2186f), new Vector3(6.3f, 1185.3f, 2185.5f), new Vector3(7.3f, 1185.3f, 2185.5f) }; private const float SPEED_CHANGE_AT = 3.5f; private const float SPEED_NEW = 1f; private const float CDS_FADE_IN = 0.5f; private const float CDS_DESCENT = 4f; private const float CDS_FADE_OUT = 0.5f; private const float CDS_BCAM_HEIGHT = 10f; private const float CDS_BCAM_PITCH = -15f; private const float CDS_BCAM_FOV = 60f; private const float CDS_DISTANCE = 1.5f; private const float CDS_VP_START = 1.3f; private const float CDS_VP_END = -0.3f; private const float CDS_GRAVITY_REDUCE = 0.7f; private static readonly Vector3 CDS_HIDE = new Vector3(-1000f, -1000f, -1000f); private const float TELEPORT_A_INITIAL_VEL_Y = -55f; private const float ENHANCED_GRAVITY_DURATION = 1.5f; private const float ENHANCED_GRAVITY_A_EXTRA = 7f; private const float ENHANCED_GRAVITY_B_EXTRA = 7f; private static readonly Vector3 SECONDARY_TARGET_TEST = new Vector3(5.7f, 1185.4f, 2183.8f); private static float CAM_A_DELAY_Get() { return 3.4f; } private static float CAM_A_X_Get() { return 18f; } private static float CAM_A_Y_Get() { return 1273f; } private static float CAM_A_Z_Get() { return 2215f; } private static bool CAM_A_Instant_Get() { return true; } private static int GetLocalLoserSlotIndex() { try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)((MonoBehaviourPun)localCharacter).photonView == (Object)null || ((MonoBehaviourPun)localCharacter).photonView.Owner == null) { return -1; } int actorNumber = ((MonoBehaviourPun)localCharacter).photonView.Owner.ActorNumber; HashSet winnerActorSet = FlagWinnerCalculator.GetWinnerActorSet(); if (winnerActorSet != null && winnerActorSet.Contains(actorNumber)) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[v153] 본인 actor={actorNumber} = winner → 텔레포트 SKIP"); } return -1; } List losersSorted_StatsWonOnly = FlagWinnerCalculator.GetLosersSorted_StatsWonOnly(); if (losersSorted_StatsWonOnly == null || losersSorted_StatsWonOnly.Count == 0) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[v153] 본인 actor={actorNumber} — 패자 리스트 빔 → SKIP"); } return -1; } for (int i = 0; i < losersSorted_StatsWonOnly.Count; i++) { Character val = losersSorted_StatsWonOnly[i]; if ((Object)(object)val == (Object)null || (Object)(object)((MonoBehaviourPun)val).photonView == (Object)null || ((MonoBehaviourPun)val).photonView.Owner == null || ((MonoBehaviourPun)val).photonView.Owner.ActorNumber != actorNumber) { continue; } if (i >= 7) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[v153] 본인 actor={actorNumber} 패자지만 slot[{i}] = 7명 초과 → SKIP"); } return -1; } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogInfo((object)$"[v153] 본인 actor={actorNumber} = 패자 slot[{i}]"); } return i; } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[v153] 본인 actor={actorNumber} — 패자 리스트에서도 못 찾음 (stats.won=false?) → SKIP"); } return -1; } catch (Exception ex) { ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogError((object)("[v153] GetLocalLoserSlotIndex 예외: " + ex.Message)); } return -1; } } private static int GetLocalLoserSlotIndex_Synced() { try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)((MonoBehaviourPun)localCharacter).photonView == (Object)null || ((MonoBehaviourPun)localCharacter).photonView.Owner == null) { return -1; } int actorNumber = ((MonoBehaviourPun)localCharacter).photonView.Owner.ActorNumber; if (FlagWinnerCalculator.HasCachedLoserSlots()) { int cachedLoserSlot = FlagWinnerCalculator.GetCachedLoserSlot(actorNumber); if (cachedLoserSlot < 0) { bool flag = FlagWinnerCalculator.GetWinnerActorSet()?.Contains(actorNumber) ?? false; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)string.Format("[v172] 본인 actor={0} 캐시 slot=-1 ({1}) → SKIP", actorNumber, flag ? "winner" : "8명초과/제외")); } return -1; } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[v172] 본인 actor={actorNumber} = 패자 slot[{cachedLoserSlot}] (sync 캐시)"); } return cachedLoserSlot; } HashSet winnerActorSet = FlagWinnerCalculator.GetWinnerActorSet(); if (winnerActorSet != null && winnerActorSet.Contains(actorNumber)) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)$"[v172 fallback] 본인 actor={actorNumber} = winner → SKIP"); } return -1; } List losersSorted_All = FlagWinnerCalculator.GetLosersSorted_All(); if (losersSorted_All == null || losersSorted_All.Count == 0) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[v172 fallback] 본인 actor={actorNumber} — 패자 리스트 빔 → SKIP"); } return -1; } for (int i = 0; i < losersSorted_All.Count; i++) { Character val = losersSorted_All[i]; if ((Object)(object)val == (Object)null || (Object)(object)((MonoBehaviourPun)val).photonView == (Object)null || ((MonoBehaviourPun)val).photonView.Owner == null || ((MonoBehaviourPun)val).photonView.Owner.ActorNumber != actorNumber) { continue; } if (i >= 7) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[v172 fallback] 본인 actor={actorNumber} slot[{i}] 7명 초과 → SKIP"); } return -1; } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogInfo((object)$"[v172 fallback] 본인 actor={actorNumber} = 패자 slot[{i}] (won 필터 X)"); } return i; } ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)$"[v172 fallback] 본인 actor={actorNumber} — 패자 리스트에서 못 찾음 → SKIP"); } return -1; } catch (Exception ex) { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogError((object)("[v172] GetLocalLoserSlotIndex_Synced 예외: " + ex.Message)); } return -1; } } private static int GetLoserSlotForActor(int actor) { try { HashSet winnerActorSet = FlagWinnerCalculator.GetWinnerActorSet(); if (winnerActorSet != null && winnerActorSet.Contains(actor)) { return -1; } List losersSorted_StatsWonOnly = FlagWinnerCalculator.GetLosersSorted_StatsWonOnly(); if (losersSorted_StatsWonOnly == null || losersSorted_StatsWonOnly.Count == 0) { return -1; } for (int i = 0; i < losersSorted_StatsWonOnly.Count; i++) { Character val = losersSorted_StatsWonOnly[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)((MonoBehaviourPun)val).photonView == (Object)null) && ((MonoBehaviourPun)val).photonView.Owner != null && ((MonoBehaviourPun)val).photonView.Owner.ActorNumber == actor) { return (i >= 7) ? (-1) : i; } } return -1; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[v154] GetLoserSlotForActor 예외: " + ex.Message)); } return -1; } } private static int GetLoserSlotForActor_Synced(int actor) { try { if (FlagWinnerCalculator.HasCachedLoserSlots()) { return FlagWinnerCalculator.GetCachedLoserSlot(actor); } HashSet winnerActorSet = FlagWinnerCalculator.GetWinnerActorSet(); if (winnerActorSet != null && winnerActorSet.Contains(actor)) { return -1; } List losersSorted_All = FlagWinnerCalculator.GetLosersSorted_All(); if (losersSorted_All == null || losersSorted_All.Count == 0) { return -1; } for (int i = 0; i < losersSorted_All.Count; i++) { Character val = losersSorted_All[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)((MonoBehaviourPun)val).photonView == (Object)null) && ((MonoBehaviourPun)val).photonView.Owner != null && ((MonoBehaviourPun)val).photonView.Owner.ActorNumber == actor) { return (i >= 7) ? (-1) : i; } } return -1; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[v172] GetLoserSlotForActor_Synced 예외: " + ex.Message)); } return -1; } } private static void Postfix(PeakHandler __instance) { //IL_0055: 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) if ((Object)(object)__instance == (Object)null) { return; } if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[v155] PvE 모드 — Teleport Postfix SKIP (PEAK 자연 컷씬)"); } return; } try { int num = 0; Scoutmaster[] array = Resources.FindObjectsOfTypeAll(); foreach (Scoutmaster val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null)) { Scene scene = ((Component)val).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { ((Component)val).gameObject.SetActive(false); num++; } } } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[CutsceneTeleport] ScoutMaster 비활성 — {num}개"); } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[CutsceneTeleport] ScoutMaster 비활성 예외: " + ex.Message)); } } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[DIAG] EndScreenComplete Postfix 시작 — frame={Time.frameCount}, time={Time.unscaledTime:F3}"); } if (CAM_A_Instant_Get()) { DoTeleportA(__instance); } else { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogInfo((object)"[CutsceneTeleport] 즉시 텔레포트 0 비활성 (Cfg_TeleportA_Instant=false)"); } } ((MonoBehaviour)__instance).StartCoroutine(DelayedTeleport_Frames(__instance)); ((MonoBehaviour)__instance).StartCoroutine(DelayedSpeedChange(__instance)); ((MonoBehaviour)__instance).StartCoroutine(SecondaryTeleport_Test(__instance)); ((MonoBehaviour)__instance).StartCoroutine(TrackLocalPosition()); ((MonoBehaviour)__instance).StartCoroutine(TrackCameraView(6f)); } [IteratorStateMachine(typeof(d__25))] private static IEnumerator TrackCameraView(float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { duration = duration }; } [IteratorStateMachine(typeof(d__26))] private static IEnumerator TrackLocalPosition() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0); } [IteratorStateMachine(typeof(d__29))] private static IEnumerator DelayedSpeedChange(PeakHandler ph) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { ph = ph }; } [IteratorStateMachine(typeof(d__30))] private static IEnumerator DelayedTeleportA_Frames(PeakHandler peakHandler) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { peakHandler = peakHandler }; } [IteratorStateMachine(typeof(d__42))] private static IEnumerator CameraDescentSequence(PeakHandler peakHandler) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__42(0) { peakHandler = peakHandler }; } private static void ApplyInitialVelocityA() { //IL_009d: 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_00b6: Unknown result type (might be due to invalid IL or missing references) Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || localCharacter.refs == null || (Object)(object)localCharacter.refs.ragdoll == (Object)null || localCharacter.refs.ragdoll.partList == null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[InitialVel] A 적용 실패 — ragdoll partList 없음"); } return; } int num = 0; foreach (Bodypart part in localCharacter.refs.ragdoll.partList) { if (!((Object)(object)part == (Object)null) && !((Object)(object)part.Rig == (Object)null) && !part.Rig.isKinematic) { Vector3 linearVelocity = part.Rig.linearVelocity; linearVelocity.y = -55f; part.Rig.linearVelocity = linearVelocity; num++; } } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[InitialVel] A 적용 완료 — {num}개 BodyPart, vel.y={-55f} m/s, frame={Time.frameCount}"); } } [IteratorStateMachine(typeof(d__48))] private static IEnumerator EnhancedGravityA() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0); } [IteratorStateMachine(typeof(d__49))] private static IEnumerator EnhancedGravityB() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__49(0); } [IteratorStateMachine(typeof(d__50))] private static IEnumerator EnhancedGravityCommon(string tag, float extra, float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__50(0) { tag = tag, extra = extra, duration = duration }; } [IteratorStateMachine(typeof(d__51))] private static IEnumerator DelayedTeleport_Frames(PeakHandler peakHandler) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__51(0) { peakHandler = peakHandler }; } [IteratorStateMachine(typeof(d__53))] private static IEnumerator SecondaryTeleport_Test(PeakHandler peakHandler) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__53(0); } private static void DoTeleportA(PeakHandler peakHandler) { //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01da: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)peakHandler == (Object)null) { return; } } catch { return; } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(CAM_A_X_Get(), CAM_A_Y_Get(), CAM_A_Z_Get()); try { List allCharacters = Character.AllCharacters; if (allCharacters == null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[v154] DoTeleportA — Character.AllCharacters null"); } return; } int num = 0; int num2 = 0; foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null || (Object)(object)((MonoBehaviourPun)item).photonView == (Object)null || ((MonoBehaviourPun)item).photonView.Owner == null) { continue; } if (!((MonoBehaviourPun)item).photonView.IsMine) { num2++; continue; } int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; try { ((MonoBehaviourPun)item).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, false }); int num3 = 0; try { CharacterRagdoll componentInChildren = ((Component)item).GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.partList != null) { foreach (Bodypart part in componentInChildren.partList) { if (!((Object)(object)part == (Object)null) && !((Object)(object)part.Rig == (Object)null)) { part.Rig.position = val; if ((Object)(object)((Component)part).transform != (Object)null) { ((Component)part).transform.position = val; } num3++; } } } } catch { } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[CutsceneTeleport][v154] ★ 1차 actor={actorNumber} frame={Time.frameCount} → ({val.x}, {val.y}, {val.z}) [BodyPart={num3}개] ★"); } num++; } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)$"[v154] 1차 actor={actorNumber} 예외: {ex.Message}"); } } } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[v154] 1차 완료 — 처리={num}명 (winner/패자 구분 없이 자기 캐릭터만), not-mine SKIP={num2}명"); } } catch (Exception ex2) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)("[CutsceneTeleport][v154] 1차 텔레포트 예외: " + ex2.Message)); } } } [IteratorStateMachine(typeof(d__55))] private static IEnumerator DelayedTeleportA(PeakHandler peakHandler) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__55(0) { peakHandler = peakHandler }; } [IteratorStateMachine(typeof(d__56))] internal static IEnumerator DelayedTeleport(PeakHandler peakHandler, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__56(0) { peakHandler = peakHandler, delay = delay }; } } public static class FlagDeathRespawn { public static readonly Dictionary _deathPos = new Dictionary(); public static readonly Dictionary _deathCurse = new Dictionary(); public static readonly Dictionary _segmentRespawnCount = new Dictionary(); public static readonly HashSet _pendingFallbackRevive = new HashSet(); public const int MAX_RESPAWN_PER_SEGMENT = 2; public const float CURSE_CAP = 0.5f; public const float CURSE_FALLBACK = 0.3f; public const float DEATH_REVIVE_HEIGHT_OFFSET = 1.5f; public const float FALLBACK_HEIGHT_OFFSET = 3f; public const float REVIVE_INVINCIBLE_DURATION = 8f; public static void OnDieBefore(Character ch) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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) if ((Object)(object)ch == (Object)null || (Object)(object)((MonoBehaviourPun)ch).photonView == (Object)null || ((MonoBehaviourPun)ch).photonView.Owner == null) { return; } int actorNumber = ((MonoBehaviourPun)ch).photonView.Owner.ActorNumber; Vector3 val; string text; try { val = ch.Center; text = "Center"; } catch { try { val = ((Component)ch).transform.position; text = "transform"; } catch { val = Vector3.zero; text = "zero"; } } _deathPos[actorNumber] = val; float num = 0f; try { if (ch.refs != null && (Object)(object)ch.refs.afflictions != (Object)null) { num = ch.refs.afflictions.GetCurrentStatus((STATUSTYPE)5); } } catch { } _deathCurse[actorNumber] = num; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Respawn][v172.r3] OnDieBefore — actor={actorNumber}, pos=({val.x:F1},{val.y:F1},{val.z:F1}) [src={text}], curse={num:F2}"); } } public static void OnDieAfter(Character ch) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP || (Object)(object)ch == (Object)null || (Object)(object)((MonoBehaviourPun)ch).photonView == (Object)null || ((MonoBehaviourPun)ch).photonView.Owner == null || !PhotonNetwork.IsMasterClient) { return; } int actorNumber = ((MonoBehaviourPun)ch).photonView.Owner.ActorNumber; int value; int num = (_segmentRespawnCount.TryGetValue(actorNumber, out value) ? value : 0); if (num < 2) { Vector3 value2; Vector3 pos = (_deathPos.TryGetValue(actorNumber, out value2) ? value2 : ((Component)ch).transform.position) + Vector3.up * 1.5f; _segmentRespawnCount[actorNumber] = num + 1; FlagSurvivalNetwork.BroadcastRespawnCountSync(actorNumber, num + 1); try { FlagFixedHUD.RefreshRespawnHearts(); } catch { } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Respawn][v172.r5] OnDieAfter — actor={actorNumber}, count={num + 1}/{2}, deathPos+1.5m에서 부활"); } IssueRevive(ch, pos); } else { _pendingFallbackRevive.Add(actorNumber); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[Respawn][v172.r1] OnDieAfter — actor={actorNumber}, count 초과({num}회 사용), 모닥불 점화 대기"); } } } private static void IssueRevive(Character ch, Vector3 pos) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)((MonoBehaviourPun)ch).photonView != (Object)null) { ((MonoBehaviourPun)ch).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[3] { pos, false, -1 }); } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[Respawn][v172.r1] IssueRevive 예외: " + ex.Message)); } } } public static void OnRevivedAfter(Character ch) { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown if ((Object)(object)ch == (Object)null || (Object)(object)((MonoBehaviourPun)ch).photonView == (Object)null || ((MonoBehaviourPun)ch).photonView.Owner == null) { return; } int actorNumber = ((MonoBehaviourPun)ch).photonView.Owner.ActorNumber; if (!_deathCurse.TryGetValue(actorNumber, out var value)) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Respawn][v172.r1] OnRevivedAfter — actor={actorNumber}, _deathCurse 캐시 없음 (석상 부활 등) → skip"); } return; } float num = Mathf.Min(value, 0.5f); if (_pendingFallbackRevive.Contains(actorNumber)) { num = 0.3f; _pendingFallbackRevive.Remove(actorNumber); } try { if (ch.refs != null && (Object)(object)ch.refs.afflictions != (Object)null) { ch.refs.afflictions.SetStatus((STATUSTYPE)5, num, true); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[Respawn][v172.r1] OnRevivedAfter — actor={actorNumber}, 저주 {num:F2} 적용 (원본 {value:F2})"); } } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[Respawn][v172.r1] SetStatus 예외: " + ex.Message)); } } try { if (FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP && ch.IsLocal && ch.refs != null && (Object)(object)ch.refs.afflictions != (Object)null) { Affliction_Invincibility val = new Affliction_Invincibility { totalTime = 8f, isFromMilk = true }; ch.refs.afflictions.AddAffliction((Affliction)(object)val, false); ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogInfo((object)$"[Respawn][v172.r12] PvP 부활 무적 적용 — actor={actorNumber}, {8f}초"); } } } catch (Exception ex2) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogError((object)("[Respawn][v172.r12] 무적 적용 예외: " + ex2.Message)); } } _deathCurse.Remove(actorNumber); _deathPos.Remove(actorNumber); } public static void OnCampfireLit(Campfire campfire) { //IL_00a1: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_0169: Unknown result type (might be due to invalid IL or missing references) ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)($"[Respawn][v172.r7] OnCampfireLit 진입 — mode={FlagSurvivalNetwork.CurrentMultiplayerMode}, " + $"isHost={PhotonNetwork.IsMasterClient}, pendingQueue.Count={_pendingFallbackRevive.Count}, " + $"segmentCount.Count={_segmentRespawnCount.Count}")); } if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP || !PhotonNetwork.IsMasterClient || (Object)(object)campfire == (Object)null || (Object)(object)((Component)campfire).transform == (Object)null || _pendingFallbackRevive.Count == 0) { return; } Vector3 pos = ((Component)campfire).transform.position + Vector3.up * 3f; foreach (int item in new List(_pendingFallbackRevive)) { Character val = FindCharacterByActor(item); if ((Object)(object)val == (Object)null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[Respawn][v172.r1] OnCampfireLit — actor={item} Character 못 찾음, skip"); } _pendingFallbackRevive.Remove(item); } else if (!val.data.dead && !val.data.fullyPassedOut) { _pendingFallbackRevive.Remove(item); } else { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)$"[Respawn][v172.r1] OnCampfireLit — actor={item}, 모닥불 fallback 부활 (저주 {0.3f:F2})"); } IssueRevive(val, pos); } } } public static void OnSegmentChanged() { int count = _segmentRespawnCount.Count; _segmentRespawnCount.Clear(); FlagSurvivalNetwork.BroadcastRespawnCountClear(); try { FlagFixedHUD.RefreshRespawnHearts(); } catch { } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Respawn][v172.r1] OnSegmentChanged — 카운트 리셋 ({count}명)"); } } public static void ResetAll() { _deathPos.Clear(); _deathCurse.Clear(); _segmentRespawnCount.Clear(); _pendingFallbackRevive.Clear(); FlagSurvivalNetwork.BroadcastRespawnCountClear(); try { FlagFixedHUD.RefreshRespawnHearts(); } catch { } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[Respawn][v172.r3] ResetAll — 모든 상태 클리어 (새 게임 시작)"); } } public static void HandleRespawnCountSync(int actor, int count) { try { if (actor == -1 && count == -1) { int count2 = _segmentRespawnCount.Count; _segmentRespawnCount.Clear(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Respawn][vHearts2] HandleRespawnCountSync — 전체 클리어 ({count2}명)"); } } else if (actor >= 0 && count >= 0) { _segmentRespawnCount[actor] = count; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[Respawn][vHearts2] HandleRespawnCountSync — actor={actor}, count={count} 갱신"); } } try { FlagFixedHUD.RefreshRespawnHearts(); } catch { } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[Respawn][vHearts2] HandleRespawnCountSync 예외: " + ex.Message)); } } } private static Character FindCharacterByActor(int actor) { try { foreach (Character allCharacter in Character.AllCharacters) { if (!((Object)(object)allCharacter == (Object)null) && !((Object)(object)((MonoBehaviourPun)allCharacter).photonView == (Object)null) && ((MonoBehaviourPun)allCharacter).photonView.Owner != null && ((MonoBehaviourPun)allCharacter).photonView.Owner.ActorNumber == actor) { return allCharacter; } } } catch { } return null; } public static bool HasPendingRespawn() { try { foreach (Character allCharacter in Character.AllCharacters) { if (!((Object)(object)allCharacter == (Object)null) && !((Object)(object)((MonoBehaviourPun)allCharacter).photonView == (Object)null) && ((MonoBehaviourPun)allCharacter).photonView.Owner != null && allCharacter.data.dead) { int actorNumber = ((MonoBehaviourPun)allCharacter).photonView.Owner.ActorNumber; int value; bool num = (_segmentRespawnCount.TryGetValue(actorNumber, out value) ? value : 0) < 2; bool flag = _pendingFallbackRevive.Contains(actorNumber); if (num || flag) { return true; } } } } catch { } return false; } } [HarmonyPatch(typeof(Character), "RPCA_Die")] public static class Patch_RPCA_Die_DeathRespawn { static Patch_RPCA_Die_DeathRespawn() { try { FlagSurvivalNetwork.OnRespawnCountReceived = (Action)Delegate.Combine(FlagSurvivalNetwork.OnRespawnCountReceived, new Action(FlagDeathRespawn.HandleRespawnCountSync)); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[Respawn][vHearts2] static ctor — OnRespawnCountReceived 핸들러 등록 완료"); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[Respawn][vHearts2] static ctor 등록 예외: " + ex.Message)); } } } [HarmonyPrefix] public static void Prefix(Character __instance) { try { FlagDeathRespawn.OnDieBefore(__instance); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[Respawn] Die Prefix 예외: " + ex.Message)); } } } [HarmonyPostfix] public static void Postfix(Character __instance) { try { FlagDeathRespawn.OnDieAfter(__instance); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[Respawn] Die Postfix 예외: " + ex.Message)); } } } } [HarmonyPatch(typeof(Character), "RPCA_Revive")] public static class Patch_RPCA_Revive_DeathRespawn { [HarmonyPostfix] public static void Postfix(Character __instance) { try { FlagDeathRespawn.OnRevivedAfter(__instance); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[Respawn] Revive Postfix 예외: " + ex.Message)); } } } } [HarmonyPatch(typeof(Campfire), "Light_Rpc")] public static class Patch_Campfire_Light_DeathRespawn { [HarmonyPostfix] public static void Postfix(Campfire __instance) { try { FlagDeathRespawn.OnCampfireLit(__instance); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[Respawn] Light_Rpc Postfix 예외: " + ex.Message)); } } } } [HarmonyPatch(typeof(Character), "CheckEndGame")] public static class Patch_CheckEndGame_DeathRespawn { [HarmonyPrefix] public static bool Prefix() { try { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } if (FlagDeathRespawn.HasPendingRespawn()) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[Respawn][v172.r2] CheckEndGame 차단 — 부활 예정자 있음"); } return false; } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[Respawn] CheckEndGame Prefix 예외: " + ex.Message)); } } return true; } } [HarmonyPatch(typeof(Skelleton), "SpawnSkelly")] public static class Patch_SpawnSkelly_DeathRespawn { [HarmonyPrefix] public static bool Prefix(Skelleton __instance, Character target) { try { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } if ((Object)(object)target != (Object)null && (Object)(object)((MonoBehaviourPun)target).photonView != (Object)null && ((MonoBehaviourPun)target).photonView.Owner != null) { int actorNumber = ((MonoBehaviourPun)target).photonView.Owner.ActorNumber; int value; int num = (FlagDeathRespawn._segmentRespawnCount.TryGetValue(actorNumber, out value) ? value : 0); if (num >= 2) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Respawn][v172.r8] SpawnSkelly 통과 — actor={actorNumber}, count={num} (3번째 이상 죽음, 해골 유지)"); } return true; } } if ((Object)(object)__instance != (Object)null && (Object)(object)((Component)__instance).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)__instance).gameObject); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[Respawn] SpawnSkelly Prefix 예외: " + ex.Message)); } } return false; } } [HarmonyPatch(typeof(Character), "RPCA_Zombify")] public static class Patch_RPCA_Zombify_DeathRespawn { [HarmonyPrefix] public static bool Prefix(Character __instance, Vector3 itemSpawnPoint) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) try { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { return true; } if ((Object)(object)__instance == (Object)null || (Object)(object)((MonoBehaviourPun)__instance).photonView == (Object)null || ((MonoBehaviourPun)__instance).photonView.Owner == null) { return true; } int actorNumber = ((MonoBehaviourPun)__instance).photonView.Owner.ActorNumber; int value; int num = (FlagDeathRespawn._segmentRespawnCount.TryGetValue(actorNumber, out value) ? value : 0); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[Respawn][v172.r11] RPCA_Zombify 차단 — actor={actorNumber}, count={num} (PvP 좀비화 회피 → RPCA_Die 우회)"); } ((MonoBehaviourPun)__instance).photonView.RPC("RPCA_Die", (RpcTarget)0, new object[1] { itemSpawnPoint }); return false; } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[Respawn] RPCA_Zombify Prefix 예외: " + ex.Message)); } } return true; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.debugsnapshot", "Flag Survival Debug Snapshot", "1.0.0")] public class FlagDebugSnapshotPlugin : BaseUnityPlugin { private class SnapshotRunner : MonoBehaviour { private void Update() { try { Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current.f8Key).wasPressedThisFrame) { FlagDebugSnapshot.DumpSnapshot(); } } catch { } } } private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown GameObject val = new GameObject("FlagSurvival_DebugSnapshotRunner"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[DebugSnapshot] v1 활성: F8 = JSON 스냅샷 출력"); } } } public static class FlagDebugSnapshot { private static readonly string[] TreeKeywordList = new string[22] { "tree", "palm", "pine", "redwood", "birch", "foliage", "branch", "leaf", "leaves", "cactus", "cacti", "saguaro", "succulent", "thorn", "thornbush", "bramble", "briar", "prickly", "nettle", "spore", "toadstool", "poison" }; public static void DumpSnapshot() { //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) //IL_0b48: Unknown result type (might be due to invalid IL or missing references) //IL_0b54: Unknown result type (might be due to invalid IL or missing references) //IL_0b60: Unknown result type (might be due to invalid IL or missing references) //IL_0b93: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0b06: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0b23: Unknown result type (might be due to invalid IL or missing references) //IL_0b28: Unknown result type (might be due to invalid IL or missing references) try { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("{"); AppendObjectStart(stringBuilder, "meta", 1); AppendKV(stringBuilder, "timestamp", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), 2, isString: true); AppendKV(stringBuilder, "frame", Time.frameCount.ToString(), 2); AppendKV(stringBuilder, "time", Time.time.ToString("F3"), 2); string value = "?"; try { Scene activeScene = SceneManager.GetActiveScene(); value = ((Scene)(ref activeScene)).name; } catch { } AppendKV(stringBuilder, "scene", value, 2, isString: true, isLast: true); AppendObjectEnd(stringBuilder, 1); AppendObjectStart(stringBuilder, "peakHandler", 1); PeakHandler instance = Singleton.Instance; AppendKV(stringBuilder, "exists", ((Object)(object)instance != (Object)null).ToString().ToLower(), 2); AppendKV(stringBuilder, "isPlayingCinematic", (instance?.isPlayingCinematic ?? false).ToString().ToLower(), 2); bool flag = false; try { if ((Object)(object)instance != (Object)null) { FieldInfo field = typeof(PeakHandler).GetField("endScreenComplete", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { flag = (bool)field.GetValue(instance); } } } catch { } AppendKV(stringBuilder, "endScreenComplete", flag.ToString().ToLower(), 2, isString: false, isLast: true); AppendObjectEnd(stringBuilder, 1); AppendObjectStart(stringBuilder, "multiplayer", 1); bool flag2 = false; bool flag3 = false; int num = 0; int num2 = -1; string value2 = "?"; try { flag2 = PhotonNetwork.InRoom; flag3 = PhotonNetwork.IsMasterClient; Player[] playerList = PhotonNetwork.PlayerList; num = ((playerList != null) ? playerList.Length : 0); if (PhotonNetwork.LocalPlayer != null) { num2 = PhotonNetwork.LocalPlayer.ActorNumber; value2 = PhotonNetwork.LocalPlayer.NickName ?? "?"; } } catch { } AppendKV(stringBuilder, "isInRoom", flag2.ToString().ToLower(), 2); AppendKV(stringBuilder, "isMasterClient", flag3.ToString().ToLower(), 2); AppendKV(stringBuilder, "playerCount", num.ToString(), 2); AppendKV(stringBuilder, "localActorNumber", num2.ToString(), 2); AppendKV(stringBuilder, "localNickname", value2, 2, isString: true); AppendKV(stringBuilder, "multiplayerMode", FlagSurvivalNetwork.CurrentMultiplayerMode.ToString(), 2, isString: true, isLast: true); AppendObjectEnd(stringBuilder, 1); Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null) { AppendObjectStart(stringBuilder, "localCharacter", 1); SerializeCharacterFields(stringBuilder, localCharacter, 2, isLast: true); AppendObjectEnd(stringBuilder, 1); } else { stringBuilder.AppendLine(" \"localCharacter\": null,"); } stringBuilder.AppendLine(" \"allCharacters\": ["); List allCharacters = Character.AllCharacters; if (allCharacters != null) { int count = allCharacters.Count; int num3 = 0; foreach (Character item2 in allCharacters) { if ((Object)(object)item2 == (Object)null) { num3++; continue; } stringBuilder.AppendLine(" {"); SerializeCharacterFields(stringBuilder, item2, 3, isLast: true); stringBuilder.Append(" }"); if (num3 < count - 1) { stringBuilder.AppendLine(","); } else { stringBuilder.AppendLine(); } num3++; } } stringBuilder.AppendLine(" ],"); AppendObjectStart(stringBuilder, "flagWinnerCalculator", 1); bool flag4 = FlagWinnerCalculator.HasCachedResult(); IReadOnlyCollection cachedWinnerSet = FlagWinnerCalculator.GetCachedWinnerSet(); AppendKV(stringBuilder, "hasCachedResult", flag4.ToString().ToLower(), 2); stringBuilder.Append(" \"cachedWinnerSet\": ["); if (cachedWinnerSet != null) { int num4 = 0; int count2 = cachedWinnerSet.Count; foreach (int item3 in cachedWinnerSet) { stringBuilder.Append(item3.ToString()); if (num4 < count2 - 1) { stringBuilder.Append(", "); } num4++; } } stringBuilder.AppendLine("],"); List list = null; try { list = FlagWinnerCalculator.GetWinnerActorNumbersHostAuthoritative(); } catch { } stringBuilder.Append(" \"hostAuthoritativeCalc\": ["); if (list != null) { for (int i = 0; i < list.Count; i++) { stringBuilder.Append(list[i].ToString()); if (i < list.Count - 1) { stringBuilder.Append(", "); } } } stringBuilder.AppendLine("],"); HashSet hashSet = null; try { hashSet = FlagWinnerCalculator.GetWinnerActorSet(); } catch { } stringBuilder.Append(" \"getWinnerActorSet\": ["); if (hashSet != null) { int num5 = 0; int count3 = hashSet.Count; foreach (int item4 in hashSet) { stringBuilder.Append(item4.ToString()); if (num5 < count3 - 1) { stringBuilder.Append(", "); } num5++; } } stringBuilder.AppendLine("]"); AppendObjectEnd(stringBuilder, 1); AppendObjectStart(stringBuilder, "losers", 1); stringBuilder.Append(" \"statsWonOnly\": ["); try { List losersSorted_StatsWonOnly = FlagWinnerCalculator.GetLosersSorted_StatsWonOnly(); if (losersSorted_StatsWonOnly != null && losersSorted_StatsWonOnly.Count > 0) { stringBuilder.AppendLine(); for (int j = 0; j < losersSorted_StatsWonOnly.Count; j++) { stringBuilder.Append(" "); SerializeLoserBrief(stringBuilder, losersSorted_StatsWonOnly[j]); if (j < losersSorted_StatsWonOnly.Count - 1) { stringBuilder.AppendLine(","); } else { stringBuilder.AppendLine(); } } stringBuilder.Append(" "); } } catch (Exception ex) { stringBuilder.Append("\"ERROR: " + ex.Message + "\""); } stringBuilder.AppendLine("],"); stringBuilder.Append(" \"all\": ["); try { List losersSorted_All = FlagWinnerCalculator.GetLosersSorted_All(); if (losersSorted_All != null && losersSorted_All.Count > 0) { stringBuilder.AppendLine(); for (int k = 0; k < losersSorted_All.Count; k++) { stringBuilder.Append(" "); SerializeLoserBrief(stringBuilder, losersSorted_All[k]); if (k < losersSorted_All.Count - 1) { stringBuilder.AppendLine(","); } else { stringBuilder.AppendLine(); } } stringBuilder.Append(" "); } } catch (Exception ex2) { stringBuilder.Append("\"ERROR: " + ex2.Message + "\""); } stringBuilder.AppendLine("]"); AppendObjectEnd(stringBuilder, 1); stringBuilder.AppendLine(" \"biomeStats\": ["); try { IReadOnlyList allBiomeStats = FlagSurvivalMulti.GetAllBiomeStats(); if (allBiomeStats != null && allBiomeStats.Count > 0) { for (int l = 0; l < allBiomeStats.Count; l++) { FlagSurvivalMulti.BiomeStats biomeStats = allBiomeStats[l]; stringBuilder.AppendLine(" {"); AppendKV(stringBuilder, "segmentIndex", biomeStats.segmentIndex.ToString(), 3); AppendKV(stringBuilder, "biomeName", biomeStats.biomeName ?? "", 3, isString: true); AppendKV(stringBuilder, "title", biomeStats.title ?? "", 3, isString: true); AppendKV(stringBuilder, "totalFlags", biomeStats.totalFlags.ToString(), 3); AppendKV(stringBuilder, "reachableFlags", biomeStats.reachableFlags.ToString(), 3); AppendKV(stringBuilder, "totalConsumed", biomeStats.totalConsumed.ToString(), 3); AppendKV(stringBuilder, "topPlayerName", biomeStats.topPlayerName ?? "", 3, isString: true); AppendKV(stringBuilder, "playerCountAtBackup", biomeStats.playerCountAtBackup.ToString(), 3); AppendKV(stringBuilder, "pctAtBackup", biomeStats.pctAtBackup.ToString(), 3); AppendKV(stringBuilder, "wasPvP", biomeStats.wasPvP.ToString().ToLower(), 3); stringBuilder.Append(" \"playerCounts\": {"); if (biomeStats.playerCounts != null && biomeStats.playerCounts.Count > 0) { int num6 = 0; int count4 = biomeStats.playerCounts.Count; foreach (KeyValuePair playerCount in biomeStats.playerCounts) { stringBuilder.Append($"\"{playerCount.Key}\": {playerCount.Value}"); if (num6 < count4 - 1) { stringBuilder.Append(", "); } num6++; } } stringBuilder.AppendLine("}"); stringBuilder.Append(" }"); if (l < allBiomeStats.Count - 1) { stringBuilder.AppendLine(","); } else { stringBuilder.AppendLine(); } } } } catch (Exception ex3) { stringBuilder.AppendLine(" \"ERROR: " + ex3.Message + "\""); } stringBuilder.AppendLine(" ],"); AppendObjectStart(stringBuilder, "flagRegistry", 1); AppendKV(stringBuilder, "flagRegistryCount", FlagSurvivalMulti.FlagRegistryCount.ToString(), 2); AppendKV(stringBuilder, "nextFlagId", FlagSurvivalMulti.NextFlagId.ToString(), 2); AppendKV(stringBuilder, "totalFlagCount", FlagSurvivalMulti.GetTotalFlagCount().ToString(), 2); AppendKV(stringBuilder, "reachableFlagCount", FlagSurvivalMulti.GetReachableFlagCount().ToString(), 2); AppendKV(stringBuilder, "spawnRemoteHandlerCount", FlagSurvivalMulti.SpawnRemoteHandlerCount.ToString(), 2); AppendKV(stringBuilder, "spawnRemoteCallPluginCount", FlagSurvivalMulti.SpawnRemoteCallPluginCount.ToString(), 2); AppendKV(stringBuilder, "registerRemoteFlagCount", FlagSurvivalMulti.RegisterRemoteFlagCount.ToString(), 2); AppendKV(stringBuilder, "currentSegmentIndex", FlagSurvivalMulti.GetCurrentSegmentIndex().ToString(), 2); AppendKV(stringBuilder, "currentBiome", FlagSurvivalMulti.GetCurrentBiome() ?? "", 2, isString: true); AppendKV(stringBuilder, "currentBiomeTitle", FlagSurvivalMulti.GetCurrentBiomeTitle() ?? "", 2, isString: true, isLast: true); AppendObjectEnd(stringBuilder, 1); AppendObjectStart(stringBuilder, "config", 1); AppendKV(stringBuilder, "multiplayerMode", (FlagSurvivalPlugin.CfgMultiplayerMode != null) ? FlagSurvivalPlugin.CfgMultiplayerMode.Value.ToString() : "?", 2, isString: true); AppendKV(stringBuilder, "gameMode", (FlagSurvivalPlugin.CfgGameMode != null) ? FlagSurvivalPlugin.CfgGameMode.Value.ToString() : "?", 2, isString: true); AppendKV(stringBuilder, "difficulty", (FlagSurvivalPlugin.CfgDifficulty != null) ? FlagSurvivalPlugin.CfgDifficulty.Value.ToString() : "?", 2, isString: true, isLast: true); AppendObjectEnd(stringBuilder, 1); AppendObjectStart(stringBuilder, "nearbyTrees", 1); try { Vector3 val = Vector3.zero; bool flag5 = false; try { Character localCharacter2 = Character.localCharacter; if ((Object)(object)localCharacter2 != (Object)null) { val = localCharacter2.Center; flag5 = true; } } catch { } AppendKV(stringBuilder, "playerCenter", flag5 ? $"({val.x:F1}, {val.y:F1}, {val.z:F1})" : "null", 2, isString: true); AppendKV(stringBuilder, "scanRadius", "30", 2); if (flag5) { Collider[] array = Physics.OverlapSphere(val, 30f); stringBuilder.Append(" \"colliders\": [\n"); bool flag6 = true; int num7 = 0; List<(Collider, float)> list2 = new List<(Collider, float)>(); for (int m = 0; m < array.Length; m++) { if (!((Object)(object)array[m] == (Object)null)) { float item = Vector3.Distance(val, ((Component)array[m]).transform.position); list2.Add((array[m], item)); } } list2.Sort(((Collider col, float dist) a, (Collider col, float dist) b) => a.dist.CompareTo(b.dist)); foreach (var (val2, num8) in list2) { if (num7 >= 100) { break; } try { GameObject gameObject = ((Component)val2).gameObject; string text = ((Object)gameObject).name ?? ""; string text2 = text.ToLowerInvariant(); string text3 = ""; string[] treeKeywordList = TreeKeywordList; foreach (string text4 in treeKeywordList) { if (text2.Contains(text4)) { text3 = text4; break; } } List list3 = new List(); Transform parent = gameObject.transform.parent; int num9 = 0; while ((Object)(object)parent != (Object)null && num9 < 3) { list3.Add(((Object)parent).name ?? ""); parent = parent.parent; num9++; } if (!flag6) { stringBuilder.Append(",\n"); } flag6 = false; stringBuilder.Append(" {"); stringBuilder.Append("\"name\": \"" + EscapeJson(text) + "\", "); stringBuilder.Append($"\"dist\": {num8:F2}, "); stringBuilder.Append("\"matchedKeyword\": \"" + EscapeJson(text3) + "\", "); stringBuilder.Append("\"isFiltered\": " + (string.IsNullOrEmpty(text3) ? "false" : "true") + ", "); stringBuilder.Append("\"parents\": ["); for (int num10 = 0; num10 < list3.Count; num10++) { if (num10 > 0) { stringBuilder.Append(", "); } stringBuilder.Append("\"" + EscapeJson(list3[num10]) + "\""); } stringBuilder.Append("]}"); num7++; } catch { } } stringBuilder.Append("\n ],\n"); AppendKV(stringBuilder, "dumpCount", num7.ToString(), 2); AppendKV(stringBuilder, "totalHits", list2.Count.ToString(), 2, isString: false, isLast: true); } else { stringBuilder.Append(" \"colliders\": [],\n"); AppendKV(stringBuilder, "error", "localCharacter is null", 2, isString: true, isLast: true); } } catch (Exception ex4) { AppendKV(stringBuilder, "error", ex4.GetType().Name + ": " + ex4.Message, 2, isString: true, isLast: true); } AppendObjectEnd(stringBuilder, 1, isLast: true); stringBuilder.AppendLine("}"); string text5 = Path.Combine(Paths.PluginPath, "FlagSurvival_DebugSnapshots"); if (!Directory.Exists(text5)) { Directory.CreateDirectory(text5); } string path = $"snapshot_{DateTime.Now:yyyyMMdd_HHmmss}_frame{Time.frameCount}.json"; string text6 = Path.Combine(text5, path); File.WriteAllText(text6, stringBuilder.ToString()); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)("[DebugSnapshot] ★ JSON 출력: " + text6 + " ★")); } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[DebugSnapshot] 파일 크기: {stringBuilder.Length} chars"); } } catch (Exception ex5) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[DebugSnapshot] 예외: " + ex5.GetType().Name + ": " + ex5.Message + "\n" + ex5.StackTrace)); } } } private static void SerializeCharacterFields(StringBuilder sb, Character c, int indent, bool isLast) { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) int num = -1; string value = "?"; int num2 = -1; bool flag = false; bool flag2 = false; try { if ((Object)(object)((MonoBehaviourPun)c).photonView != (Object)null) { num2 = ((MonoBehaviourPun)c).photonView.ViewID; flag2 = ((MonoBehaviourPun)c).photonView.IsMine; if (((MonoBehaviourPun)c).photonView.Owner != null) { num = ((MonoBehaviourPun)c).photonView.Owner.ActorNumber; value = ((MonoBehaviourPun)c).photonView.Owner.NickName ?? "?"; } } flag = c.IsLocal; } catch { } AppendKV(sb, "actor", num.ToString(), indent); AppendKV(sb, "nickname", value, indent, isString: true); AppendKV(sb, "photonViewID", num2.ToString(), indent); AppendKV(sb, "isLocal", flag.ToString().ToLower(), indent); AppendKV(sb, "isMine", flag2.ToString().ToLower(), indent); try { Vector3 center = c.Center; AppendKV(sb, "centerX", center.x.ToString("F2"), indent); AppendKV(sb, "centerY", center.y.ToString("F2"), indent); AppendKV(sb, "centerZ", center.z.ToString("F2"), indent); } catch { } try { if (c.refs != null && (Object)(object)c.refs.hip != (Object)null) { Vector3 position = ((Component)c.refs.hip).transform.position; AppendKV(sb, "hipX", position.x.ToString("F2"), indent); AppendKV(sb, "hipY", position.y.ToString("F2"), indent); AppendKV(sb, "hipZ", position.z.ToString("F2"), indent); } } catch { } try { Vector3 position2 = ((Component)c).transform.position; AppendKV(sb, "rootX", position2.x.ToString("F2"), indent); AppendKV(sb, "rootY", position2.y.ToString("F2"), indent); AppendKV(sb, "rootZ", position2.z.ToString("F2"), indent); } catch { } bool flag3 = false; bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; bool flag8 = false; bool flag9 = false; try { flag3 = c.refs != null && (Object)(object)c.refs.stats != (Object)null && c.refs.stats.won; } catch { } try { flag4 = (Object)(object)c.data != (Object)null && c.data.dead; } catch { } try { flag5 = (Object)(object)c.data != (Object)null && c.data.passedOut; } catch { } try { flag6 = (Object)(object)c.data != (Object)null && c.data.fullyPassedOut; } catch { } try { flag7 = (Object)(object)c.data != (Object)null && c.data.isRopeClimbing; } catch { } try { flag9 = c.warping; } catch { } try { if ((Object)(object)c.data != (Object)null && (Object)(object)c.data.heldRope != (Object)null) { flag8 = c.data.heldRope.isHelicopterRope; } } catch { } AppendKV(sb, "won", flag3.ToString().ToLower(), indent); AppendKV(sb, "dead", flag4.ToString().ToLower(), indent); AppendKV(sb, "passedOut", flag5.ToString().ToLower(), indent); AppendKV(sb, "fullyPassedOut", flag6.ToString().ToLower(), indent); AppendKV(sb, "isRopeClimbing", flag7.ToString().ToLower(), indent); AppendKV(sb, "isHelicopterRope", flag8.ToString().ToLower(), indent); AppendKV(sb, "warping", flag9.ToString().ToLower(), indent); bool flag10 = false; try { MountainProgressHandler instance = Singleton.Instance; if ((Object)(object)instance != (Object)null) { flag10 = instance.IsAtPeak(c.Center); } } catch { } AppendKV(sb, "isAtPeak", flag10.ToString().ToLower(), indent, isString: false, isLast); } private static void SerializeLoserBrief(StringBuilder sb, Character c) { int num = -1; string s = "?"; int num2 = -1; bool flag = false; try { if ((Object)(object)((MonoBehaviourPun)c).photonView != (Object)null) { num2 = ((MonoBehaviourPun)c).photonView.ViewID; if (((MonoBehaviourPun)c).photonView.Owner != null) { num = ((MonoBehaviourPun)c).photonView.Owner.ActorNumber; s = ((MonoBehaviourPun)c).photonView.Owner.NickName ?? "?"; } } flag = c.refs != null && (Object)(object)c.refs.stats != (Object)null && c.refs.stats.won; } catch { } sb.Append($"{{\"actor\": {num}, \"nickname\": \"{EscapeJson(s)}\", \"photonViewID\": {num2}, \"won\": {flag.ToString().ToLower()}}}"); } private static void AppendObjectStart(StringBuilder sb, string key, int indent) { sb.Append(new string(' ', indent * 2)); sb.Append('"').Append(key).Append("\": {"); sb.AppendLine(); } private static void AppendObjectEnd(StringBuilder sb, int indent, bool isLast = false) { sb.Append(new string(' ', indent * 2)); sb.Append('}'); if (!isLast) { sb.Append(','); } sb.AppendLine(); } private static void AppendKV(StringBuilder sb, string key, string value, int indent, bool isString = false, bool isLast = false) { sb.Append(new string(' ', indent * 2)); sb.Append('"').Append(key).Append("\": "); if (isString) { sb.Append('"').Append(EscapeJson(value)).Append('"'); } else if (string.IsNullOrEmpty(value)) { sb.Append("null"); } else { sb.Append(value); } if (!isLast) { sb.Append(','); } sb.AppendLine(); } private static string EscapeJson(string s) { if (s == null) { return ""; } return s.Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\n", "\\n") .Replace("\r", "\\r") .Replace("\t", "\\t"); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.debugtimer", "Flag Survival Debug Timer", "1.0.0")] public class FlagDebugTimerPlugin : BaseUnityPlugin { private void Awake() { FlagDebugTimer.Initialize(); } } public static class FlagDebugTimer { private class TimerTick : MonoBehaviour { private bool _fontResolved; private void Update() { //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) if (!_fontResolved && (Object)(object)_text != (Object)null) { TextMeshProUGUI val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)_text && (Object)(object)((TMP_Text)val).font != (Object)null) { ((TMP_Text)_text).font = ((TMP_Text)val).font; _fontResolved = true; } } Keyboard current = Keyboard.current; if (current != null) { bool flag = ((ButtonControl)current.leftCtrlKey).isPressed || ((ButtonControl)current.rightCtrlKey).isPressed; bool flag2 = ((ButtonControl)current.leftShiftKey).isPressed || ((ButtonControl)current.rightShiftKey).isPressed; if (((ButtonControl)current.f7Key).wasPressedThisFrame && flag && !flag2) { Stop(); } if (((ButtonControl)current.f8Key).wasPressedThisFrame && flag && !flag2) { ToggleEndCutsceneAnimator(); } } if (!((Object)(object)_text == (Object)null)) { if (TimerRunning) { float num = Time.unscaledTime - StartTime; int num2 = Time.frameCount - StartFrame; ((TMP_Text)_text).text = $"⏱ {Tag}: {num:F2}s / {num2}f"; ((Graphic)_text).color = Color.yellow; } else if (HasFinalTime) { ((TMP_Text)_text).text = $"⏸ {Tag} 중단: {FinalElapsed:F3}s / {FinalFrames}f"; ((Graphic)_text).color = Color.cyan; } else { ((TMP_Text)_text).text = ""; } CheckCameraStop(); } } } public static bool TimerRunning = false; public static float StartTime = 0f; public static float FinalElapsed = 0f; public static bool HasFinalTime = false; public static string Tag = ""; public static int StartFrame = 0; public static int FinalFrames = 0; private static TimerTick _tickInstance; private static TextMeshProUGUI _text; private static Canvas _canvas; private static bool _animatorLocked = false; public static int LockTriggerFrame = -1; private static Vector3 _lastCameraPos = Vector3.zero; private static int _stillFrames = 0; private const int STILL_THRESHOLD = 5; private static bool _cameraStopReported = false; private static List _cameraPath = new List(); private static List _cameraForwards = new List(); private static int _pathStartFrame = -1; private static bool _pathReported = false; public static bool IsAnimatorLocked => _animatorLocked; public static void Initialize() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0076: 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_008d: 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_00b3: 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) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_017f: Expected O, but got Unknown if (!((Object)(object)_tickInstance != (Object)null)) { GameObject val = new GameObject("FlagDebugTimer_Canvas"); Object.DontDestroyOnLoad((Object)(object)val); _canvas = val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 9999; GameObject val2 = new GameObject("FlagDebugTimer_Text", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI) }); val2.transform.SetParent(val.transform, false); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 1f); component.anchoredPosition = new Vector2(20f, -20f); component.sizeDelta = new Vector2(800f, 80f); _text = val2.GetComponent(); ((TMP_Text)_text).fontSize = 36f; ((TMP_Text)_text).alignment = (TextAlignmentOptions)257; ((Graphic)_text).color = Color.yellow; ((TMP_Text)_text).fontStyle = (FontStyles)1; ((TMP_Text)_text).outlineWidth = 0.2f; ((TMP_Text)_text).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)_text).text = ""; GameObject val3 = new GameObject("FlagDebugTimer_Tick"); Object.DontDestroyOnLoad((Object)val3); _tickInstance = val3.AddComponent(); ((Component)_canvas).gameObject.SetActive(false); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[DebugTimer] v14: UI 비활성 (단축키 Ctrl+F7=중단/Ctrl+F8=수동토글 그대로 작동)."); } } } public static void Start(string tag) { TimerRunning = true; HasFinalTime = false; StartTime = Time.unscaledTime; StartFrame = Time.frameCount; Tag = tag; _cameraPath.Clear(); _cameraForwards.Clear(); _pathStartFrame = Time.frameCount; _pathReported = false; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)("[DebugTimer] ★ 타이머 시작 (" + tag + ") ★")); } } public static void CheckCameraStop() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00fa: Unknown result type (might be due to invalid IL or missing references) if (_pathStartFrame >= 0 && !_pathReported) { Camera main = Camera.main; if ((Object)(object)main != (Object)null) { _cameraPath.Add(((Component)main).transform.position); _cameraForwards.Add(((Component)main).transform.forward); } if (LockTriggerFrame >= 0) { ReportCameraPath(); _pathReported = true; } } if (LockTriggerFrame < 0 || _cameraStopReported) { return; } Camera main2 = Camera.main; if ((Object)(object)main2 == (Object)null) { return; } Vector3 position = ((Component)main2).transform.position; if (Vector3.Distance(position, _lastCameraPos) < 0.001f) { _stillFrames++; if (_stillFrames >= 5) { int num = Time.frameCount - 5; int num2 = num - LockTriggerFrame; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[DIAG] ★ 카메라 실제 정지 — frame={num}, speed=0 트리거({LockTriggerFrame}f) 후 {num2}f 만에 정지 ★"); } _cameraStopReported = true; } } else { _stillFrames = 0; } _lastCameraPos = position; } private static void ReportCameraPath() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) //IL_005e: 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_0060: 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_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_0069: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_009d: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00e7: 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_00ff: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) if (_cameraPath.Count == 0) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[CameraPath] 경로 데이터 0개"); } return; } Vector3 val = Vector3.zero; Vector3 val2 = _cameraPath[0]; Vector3 val3 = _cameraPath[0]; foreach (Vector3 item in _cameraPath) { val += item; val2 = Vector3.Min(val2, item); val3 = Vector3.Max(val3, item); } Vector3 val4 = val / (float)_cameraPath.Count; Vector3 val5 = val3 - val2; Vector3 val6 = Vector3.zero; foreach (Vector3 cameraForward in _cameraForwards) { val6 += cameraForward; } Vector3 val7 = val6 / (float)Mathf.Max(1, _cameraForwards.Count); Vector3 normalized = ((Vector3)(ref val7)).normalized; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[CameraPath] ★ 4.4초 무빙 통계 ({_cameraPath.Count}f 기록) ★"); } ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[CameraPath] 위치 평균 = ({val4.x:F2}, {val4.y:F2}, {val4.z:F2})"); } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[CameraPath] 범위: X[{val2.x:F1}~{val3.x:F1}] Δ{val5.x:F1} | Y[{val2.y:F1}~{val3.y:F1}] Δ{val5.y:F1} | Z[{val2.z:F1}~{val3.z:F1}] Δ{val5.z:F1}"); } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[CameraPath] forward 평균 = ({normalized.x:F2}, {normalized.y:F2}, {normalized.z:F2})"); } int num = Mathf.Max(1, _cameraPath.Count / 10); ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)"[CameraPath] 궤적 샘플 (위치 → 방향):"); } for (int i = 0; i < _cameraPath.Count; i += num) { Vector3 val8 = _cameraPath[i]; Vector3 val9 = ((i < _cameraForwards.Count) ? _cameraForwards[i] : Vector3.zero); ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogWarning((object)$"[CameraPath] +{i}f pos=({val8.x:F1}, {val8.y:F1}, {val8.z:F1}) fwd=({val9.x:F2}, {val9.y:F2}, {val9.z:F2})"); } } Vector3 val10 = _cameraPath[_cameraPath.Count - 1]; Vector3 val11 = _cameraForwards[_cameraForwards.Count - 1]; ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)$"[CameraPath] +{_cameraPath.Count - 1}f (정지) pos=({val10.x:F1}, {val10.y:F1}, {val10.z:F1}) fwd=({val11.x:F2}, {val11.y:F2}, {val11.z:F2})"); } ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)"[CameraPath] ★ 시선 교점 추정 (거리별 시선 끝점 평균/분산) ★"); } float[] obj = new float[6] { 10f, 20f, 30f, 50f, 80f, 120f }; int num2 = Mathf.Min(_cameraPath.Count, _cameraForwards.Count); float num3 = float.MaxValue; float num4 = 0f; Vector3 val12 = Vector3.zero; float[] array = obj; foreach (float num5 in array) { Vector3 val13 = Vector3.zero; for (int k = 0; k < num2; k++) { val13 += _cameraPath[k] + _cameraForwards[k] * num5; } Vector3 val14 = val13 / (float)num2; float num6 = 0f; for (int l = 0; l < num2; l++) { Vector3 val15 = _cameraPath[l] + _cameraForwards[l] * num5; float num7 = num6; val7 = val15 - val14; num6 = num7 + ((Vector3)(ref val7)).sqrMagnitude; } float num8 = num6 / (float)num2; float num9 = Mathf.Sqrt(num8); ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)$"[CameraPath] 거리 {num5,3:F0}m: 시선중심=({val14.x:F1}, {val14.y:F1}, {val14.z:F1}), 표준편차={num9:F2}m"); } if (num8 < num3) { num3 = num8; num4 = num5; val12 = val14; } } ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogWarning((object)$"[CameraPath] ★ 추천 캐릭터 좌표 (분산 최소 거리={num4:F0}m) = ({val12.x:F1}, {val12.y:F1}, {val12.z:F1}) ★"); } } public static void Stop() { if (!TimerRunning) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[DebugTimer] 타이머 중단 시도 — 이미 정지 상태"); } return; } FinalElapsed = Time.unscaledTime - StartTime; FinalFrames = Time.frameCount - StartFrame; TimerRunning = false; HasFinalTime = true; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[DebugTimer] ★ 타이머 중단 ({Tag}) — 경과: {FinalElapsed:F3}초 / {FinalFrames}프레임 ★"); } } public static void ToggleEndCutsceneAnimator() { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) try { PeakHandler instance = Singleton.Instance; if ((Object)(object)instance == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[DebugTimer] PeakHandler 없음 (인게임 X)"); } return; } FieldInfo field = typeof(PeakHandler).GetField("endCutsceneAnimator"); if (field == null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[DebugTimer] endCutsceneAnimator field 없음"); } return; } object value = field.GetValue(instance); if (value == null) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"[DebugTimer] endCutsceneAnimator null"); } return; } PropertyInfo property = value.GetType().GetProperty("speed"); if (property == null) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)"[DebugTimer] speed property 없음"); } return; } _animatorLocked = !_animatorLocked; float num = (_animatorLocked ? 0f : 1f); property.SetValue(value, num); if (_animatorLocked) { LockTriggerFrame = Time.frameCount; _cameraStopReported = false; _stillFrames = 0; _lastCameraPos = Vector3.zero; Camera main = Camera.main; if ((Object)(object)main != (Object)null) { _lastCameraPos = ((Component)main).transform.position; } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[DIAG] speed=0 설정 시점 — frame={LockTriggerFrame}, 카메라 추적 시작 (Camera.main pos={_lastCameraPos})"); } } else { LockTriggerFrame = -1; _cameraStopReported = false; } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)(_animatorLocked ? "[DebugTimer] ★ 카메라 무빙 잠금 (speed=0) + AnyKey 트리거 차단 ★" : "[DebugTimer] ★ 카메라 무빙 해제 (speed=1) + AnyKey 트리거 정상 ★")); } } catch (Exception ex) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)("[DebugTimer] ToggleEndCutsceneAnimator 예외: " + ex.Message)); } } } } [HarmonyPatch(typeof(PeakHandler), "EndScreenComplete")] internal static class Patch_EndScreenComplete_RestartTimer { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int frames; public float configDelay; private int 5__2; private float 5__3; private int 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__2 = Time.frameCount; 5__3 = Time.unscaledTime; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[DIAG] 카메라잠금 카운트 시작 — frame={5__2}, 목표={frames}f ({configDelay:F2}초 × FPS)"); } 5__4 = 0; break; } case 1: <>1__state = -1; 5__4++; break; } if (5__4 < frames) { <>2__current = null; <>1__state = 1; return true; } int frameCount = Time.frameCount; float num = Time.unscaledTime - 5__3; ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[DIAG] 카메라잠금 카운트 종료 — frame={frameCount}, 실제={frameCount - 5__2}f / {num:F3}초 (목표 {frames}f)"); } if (!FlagDebugTimer.IsAnimatorLocked) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[DebugTimer] ★ 자동 잠금 트리거 ({frames}프레임 경과) ★"); } FlagDebugTimer.ToggleEndCutsceneAnimator(); } else { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogInfo((object)"[DebugTimer] 자동 잠금 SKIP — 이미 잠금 상태"); } } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static void Postfix(PeakHandler __instance) { FlagDebugTimer.Start("다음 버튼 → ?"); } [IteratorStateMachine(typeof(d__1))] private static IEnumerator AutoLockAfterFrames(int frames, float configDelay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { frames = frames, configDelay = configDelay }; } } [HarmonyPatch(typeof(InputAction), "WasPerformedThisFrame")] internal static class Patch_WasPerformedThisFrame_Block { private static void Postfix(InputAction __instance, ref bool __result) { if (__result && FlagDebugTimer.IsAnimatorLocked && __instance != null && !(__instance.name != "AnyKey")) { __result = false; } } } [HarmonyPatch(typeof(GameOverHandler), "LoadAirport")] internal static class Patch_LoadAirport_BlockTimer { private static bool Prefix() { if (FlagDebugTimer.IsAnimatorLocked) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[DebugTimer] ★ LoadAirport 차단 (시간 트리거 — 잠금 중) ★"); } return false; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static class Patch_DisableScoutRevive { [HarmonyPostfix] public static void Postfix(ref bool __result) { try { if (FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP) { __result = false; } } catch { } } } public static class FlagEndCutsceneState { public static bool IsActive; } public static class FlagFadeEffect { private class FadeTick : MonoBehaviour { private class ActiveFade { public GameObject go; public Renderer[] renderers; public Material[][] materials; public Vector3 startScale; public bool hideAfterFade; public float duration; public float elapsed; public Color targetColor; } private readonly List _fades = new List(); public void StartFade(GameObject go, bool hideAfterFade, float duration, Color targetColor) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)go == (Object)null) { return; } Renderer[] componentsInChildren = go.GetComponentsInChildren(true); Material[][] array = new Material[componentsInChildren.Length][]; for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] == (Object)null) { array[i] = (Material[])(object)new Material[0]; } else { array[i] = componentsInChildren[i].materials; } } _fades.Add(new ActiveFade { go = go, renderers = componentsInChildren, materials = array, startScale = go.transform.localScale, hideAfterFade = hideAfterFade, duration = Mathf.Max(0.01f, duration), elapsed = 0f, targetColor = targetColor }); } private void Update() { //IL_0075: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_01df: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (_fades.Count == 0) { return; } for (int num = _fades.Count - 1; num >= 0; num--) { ActiveFade activeFade = _fades[num]; if (activeFade == null || (Object)(object)activeFade.go == (Object)null) { _fades.RemoveAt(num); } else { activeFade.elapsed += Time.deltaTime; float num2 = Mathf.Clamp01(activeFade.elapsed / activeFade.duration); Color val = Color.Lerp(Color.white, activeFade.targetColor, num2); for (int i = 0; i < activeFade.renderers.Length; i++) { if ((Object)(object)activeFade.renderers[i] == (Object)null) { continue; } Material[] array = activeFade.materials[i]; foreach (Material val2 in array) { if (!((Object)(object)val2 == (Object)null)) { if (val2.HasProperty("_Color")) { val2.color = val; } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", val); } if (val2.HasProperty("_Tint")) { val2.SetColor("_Tint", val); } } } } if (activeFade.hideAfterFade) { float num4; if (activeFade.elapsed < 0.05f) { float num3 = Mathf.Sin(activeFade.elapsed / 0.05f * MathF.PI * 0.5f); num4 = Mathf.Lerp(1f, 1.15f, num3); } else if (activeFade.elapsed < 0.1f) { num4 = 1.15f; } else { float num5 = 0.1f; float num6 = activeFade.duration - num5; float num7 = Mathf.Clamp01((activeFade.elapsed - num5) / num6); float num8 = num7 * num7; num4 = Mathf.Lerp(1.15f, 0f, num8); } activeFade.go.transform.localScale = activeFade.startScale * num4; } if (num2 >= 1f) { _fades.RemoveAt(num); } } } } } private const float DURATION_REMOVE = 0.4f; private const float DURATION_RECOLOR = 0.4f; private const float GROW_DURATION = 0.05f; private const float HOLD_DURATION = 0.05f; private const float GROW_FACTOR = 1.15f; private static FadeTick _tickInstance; public static void StartConsumeFade(GameObject flagGo, bool hideAfterFade) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)flagGo == (Object)null)) { float duration = (hideAfterFade ? 0.4f : 0.4f); EnsureTick(); _tickInstance.StartFade(flagGo, hideAfterFade, duration, Color.black); } } public static void StartConsumeFadeColor(GameObject flagGo, Color targetColor) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)flagGo == (Object)null)) { EnsureTick(); _tickInstance.StartFade(flagGo, hideAfterFade: false, 0.4f, targetColor); } } public static void StartConsumeFadeRemove(GameObject flagGo, Color targetColor) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)flagGo == (Object)null)) { EnsureTick(); _tickInstance.StartFade(flagGo, hideAfterFade: true, 0.4f, targetColor); } } public static void StartInstantRecolor(GameObject flagGo, Color targetColor) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)flagGo == (Object)null) { return; } try { Renderer[] componentsInChildren = flagGo.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val == (Object)null) { continue; } Material[] materials = val.materials; foreach (Material val2 in materials) { if ((Object)(object)val2 == (Object)null) { continue; } if (val2.HasProperty("_Color")) { val2.color = targetColor; } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", targetColor); } if (val2.HasProperty("_Tint")) { val2.SetColor("_Tint", targetColor); } if (targetColor.r > 0.8f && targetColor.g > 0.7f && targetColor.b < 0.2f) { if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", targetColor * 0.5f); } } else if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", Color.black); } } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FlagFadeEffect] StartInstantRecolor 실패: " + ex.Message)); } } } private static void EnsureTick() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_tickInstance != (Object)null)) { GameObject val = new GameObject("FlagFadeEffect_Tick"); Object.DontDestroyOnLoad((Object)val); _tickInstance = val.AddComponent(); } } } public static class FlagFixedHUD { private const float FONT_SIZE_LEADER = 25f; private const float FONT_SIZE_MY_DIST = 55f; private const float FONT_SIZE_MY_RANK = 73f; private const float FONT_SIZE_POINTS = 22f; private const float FONT_SIZE_MENU_HINT = 33f; private const float CENTER_LINE_GAP = 4f; private const float RANK_POINTS_GAP = 4f; private const float EDGE_PADDING = 25f; private const float UPDATE_INTERVAL = 0.1f; public static readonly Vector3 PEAK_SUMMIT_POSITION = new Vector3(19.5f, 1228.7f, 2242.5f); private static Canvas _ownCanvas; private static GameObject _container; private static TextMeshProUGUI _textLeaderInfo; private static TextMeshProUGUI _textMyDist; private static TextMeshProUGUI _textMyRank; private static TextMeshProUGUI _textPoints; private static TextMeshProUGUI _textMenuHint; private static TextMeshProUGUI _textRespawnHearts; private static TextMeshProUGUI _sourceTmp; private static float _lastUpdateTime = -1f; private static string _lastSig = null; public static void OnGUIManagerStarted(TextMeshProUGUI sourceTmp) { try { if ((Object)(object)sourceTmp == (Object)null || (Object)(object)((TMP_Text)sourceTmp).font == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[FixedHUD][v172.hud1] sourceTmp 또는 폰트 null — HUD 생성 skip"); } return; } _sourceTmp = sourceTmp; CreateUI(); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)"[FixedHUD][v172.hud1] HUD 생성 완료"); } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[FixedHUD][v172.hud1] OnGUIManagerStarted 실패: " + ex.Message + "\n" + ex.StackTrace)); } } } private static void CreateUI() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0305: 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_0063: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_container != (Object)null) { try { Object.Destroy((Object)(object)_container); } catch { } _container = null; } _textLeaderInfo = null; _textMyDist = null; _textMyRank = null; _textPoints = null; _textMenuHint = null; _textRespawnHearts = null; if ((Object)(object)_ownCanvas == (Object)null) { GameObject val = new GameObject("FlagSurvival_FixedHUDCanvas"); Object.DontDestroyOnLoad((Object)val); _ownCanvas = val.AddComponent(); _ownCanvas.renderMode = (RenderMode)0; _ownCanvas.sortingOrder = 100; val.AddComponent(); val.AddComponent(); } int layer = ((Component)_ownCanvas).gameObject.layer; _container = new GameObject("FlagSurvival_FixedHUDContainer", new Type[1] { typeof(RectTransform) }); _container.transform.SetParent(((Component)_ownCanvas).transform, false); _container.layer = layer; RectTransform component = _container.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; component.sizeDelta = Vector2.zero; ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; _textLeaderInfo = CreateAnchoredTMP("LeaderInfo", component, layer, 25f, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -25f), (TextAlignmentOptions)258); _textMyDist = CreateAnchoredTMP("MyDist", component, layer, 55f, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -54f), (TextAlignmentOptions)258); _textMyRank = CreateAnchoredTMP("MyRank", component, layer, 73f, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-32f, -32f), (TextAlignmentOptions)260); _textPoints = CreateAnchoredTMP("Points", component, layer, 22f, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-25f, -102f), (TextAlignmentOptions)258, 110f); _textMenuHint = CreateAnchoredTMP("MenuHint", component, layer, 33f, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(25f, -25f), (TextAlignmentOptions)257, 400f); RefreshMenuHint(); _textRespawnHearts = CreateAnchoredTMP("RespawnHearts", component, layer, 33f, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(25f, -62f), (TextAlignmentOptions)257, 400f); RefreshRespawnHearts(); } private static TextMeshProUGUI CreateAnchoredTMP(string suffix, RectTransform parent, int layer, float fontSize, Vector2 anchorPos, Vector2 pivot, Vector2 offset, TextAlignmentOptions alignment, float width = 800f) { //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0060: 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_0070: 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) //IL_008a: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FlagSurvival_FixedHUD_" + suffix, new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI) }); val.transform.SetParent((Transform)(object)parent, false); val.layer = layer; RectTransform component = val.GetComponent(); component.anchorMin = anchorPos; component.anchorMax = anchorPos; component.pivot = pivot; component.anchoredPosition = offset; component.sizeDelta = new Vector2(width, 100f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; TextMeshProUGUI component2 = val.GetComponent(); ((TMP_Text)component2).font = ((TMP_Text)_sourceTmp).font; ((TMP_Text)component2).fontSize = fontSize; ((TMP_Text)component2).alignment = alignment; ((Graphic)component2).color = ((Graphic)_sourceTmp).color; try { if ((Object)(object)((TMP_Text)_sourceTmp).fontMaterial != (Object)null) { ((TMP_Text)component2).outlineColor = Color32.op_Implicit(new Color(0.596f, 0.58f, 0.549f, 1f)); ((TMP_Text)component2).outlineWidth = 0.05f; if ((Object)(object)((TMP_Text)component2).font != (Object)null && ((TMP_Text)component2).font.fallbackFontAssetTable != null) { foreach (TMP_FontAsset item in ((TMP_Text)component2).font.fallbackFontAssetTable) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((TMP_Asset)item).material == (Object)null)) { if (((TMP_Asset)item).material.HasProperty("_OutlineColor")) { ((TMP_Asset)item).material.SetColor("_OutlineColor", new Color(0.596f, 0.58f, 0.549f, 1f)); } if (((TMP_Asset)item).material.HasProperty("_OutlineWidth")) { ((TMP_Asset)item).material.SetFloat("_OutlineWidth", 0.1f); } } } } if (((TMP_Text)component2).fontMaterial.HasProperty("_UnderlayColor")) { ((TMP_Text)component2).fontMaterial.SetColor("_UnderlayColor", new Color(0f, 0f, 0f, 0.4f)); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlayOffsetX", 0f); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlayOffsetY", 0f); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlayDilate", 0.1f); ((TMP_Text)component2).fontMaterial.SetFloat("_UnderlaySoftness", 0.4f); ((TMP_Text)component2).fontMaterial.EnableKeyword("UNDERLAY_ON"); } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)("[FixedHUD][v172.hud1] " + suffix + " outline 적용 실패: " + ex.Message)); } } ((TMP_Text)component2).text = ""; ((Graphic)component2).raycastTarget = false; ((TMP_Text)component2).enableWordWrapping = false; ((TMP_Text)component2).enableAutoSizing = false; ((TMP_Text)component2).autoSizeTextContainer = false; ((TMP_Text)component2).paragraphSpacing = 0f; ((TMP_Text)component2).lineSpacing = 0f; return component2; } private static void RefreshMenuHint() { if (!((Object)(object)_textMenuHint == (Object)null)) { bool flag = FlagSurvivalPlugin.CfgHudLanguage == null || FlagSurvivalPlugin.CfgHudLanguage.Value == FlagSurvivalPlugin.HUD언어.한국어; ((TMP_Text)_textMenuHint).text = (flag ? "[~]키를 눌러 메뉴설정" : "Press [~] for menu"); } } public static void RefreshRespawnHearts() { if ((Object)(object)_textRespawnHearts == (Object)null) { return; } if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { ((TMP_Text)_textRespawnHearts).text = ""; return; } int num = -1; try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null && (Object)(object)((MonoBehaviourPun)localCharacter).photonView != (Object)null && ((MonoBehaviourPun)localCharacter).photonView.Owner != null) { num = ((MonoBehaviourPun)localCharacter).photonView.Owner.ActorNumber; } } catch { } if (num < 0) { ((TMP_Text)_textRespawnHearts).text = ""; return; } int num2 = 0; try { if (FlagDeathRespawn._segmentRespawnCount.TryGetValue(num, out var value)) { num2 = value; } } catch { } string text = ((num2 <= 0) ? "♥♥♥" : ((num2 != 1) ? "♥♡♡" : "♥♥♡")); ((TMP_Text)_textRespawnHearts).text = text; } public static void Update() { //IL_011d: 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_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_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_textLeaderInfo == (Object)null || (Object)(object)_textMyDist == (Object)null || (Object)(object)_textMyRank == (Object)null || (Object)(object)_textPoints == (Object)null) { return; } if (FlagEndCutsceneState.IsActive) { if ((Object)(object)_ownCanvas != (Object)null && ((Component)_ownCanvas).gameObject.activeSelf) { ((Component)_ownCanvas).gameObject.SetActive(false); } return; } if ((Object)(object)_ownCanvas != (Object)null && !((Component)_ownCanvas).gameObject.activeSelf) { ((Component)_ownCanvas).gameObject.SetActive(true); } float realtimeSinceStartup = Time.realtimeSinceStartup; RefreshMenuHint(); if (realtimeSinceStartup < _lastUpdateTime + 0.1f) { return; } _lastUpdateTime = realtimeSinceStartup; try { Vector3 currentCampfirePosition = GetCurrentCampfirePosition(); Character val = null; Character val2 = null; float num = 0f; float num2 = float.MaxValue; int num3 = 0; List allCharacters = Character.AllCharacters; if (allCharacters == null || allCharacters.Count == 0) { RefreshMenuHint(); SetEmpty(); return; } List> list = new List>(); foreach (Character item in allCharacters) { if (!((Object)(object)item == (Object)null)) { float num4; try { num4 = Vector3.Distance(currentCampfirePosition, item.Center) * CharacterStats.unitsToMeters; } catch { continue; } list.Add(new KeyValuePair(item, num4)); if (item.IsLocal) { val = item; num = num4; } if (num4 < num2) { num2 = num4; val2 = item; } } } if (list.Count == 0 || (Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { RefreshMenuHint(); SetEmpty(); return; } int num5 = -1; try { if ((Object)(object)((MonoBehaviourPun)val).photonView != (Object)null && ((MonoBehaviourPun)val).photonView.Owner != null) { num5 = ((MonoBehaviourPun)val).photonView.Owner.ActorNumber; } } catch { } float num6 = ((num5 >= 0) ? FlagSegmentScoring.GetTotalScoreFloat(num5) : 0f); num3 = 1; foreach (KeyValuePair item2 in list) { if ((Object)(object)item2.Key == (Object)(object)val) { continue; } int num7 = -1; try { if ((Object)(object)((MonoBehaviourPun)item2.Key).photonView != (Object)null && ((MonoBehaviourPun)item2.Key).photonView.Owner != null) { num7 = ((MonoBehaviourPun)item2.Key).photonView.Owner.ActorNumber; } } catch { } float num8 = ((num7 >= 0) ? FlagSegmentScoring.GetTotalScoreFloat(num7) : 0f); if (num8 > num6 + 0.05f) { num3++; } else if (Mathf.Abs(num8 - num6) < 0.05f && item2.Value < num) { num3++; } } bool flag = FlagSurvivalPlugin.CfgHudLanguage == null || FlagSurvivalPlugin.CfgHudLanguage.Value == FlagSurvivalPlugin.HUD언어.한국어; string text = GetCharacterNick(val2); if (text.Length > 6) { text = text.Substring(0, 6); } string leaderInfo; string myDistText; string myRankText; string pointsText; if (FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP) { string arg = (flag ? "1등" : "1st"); leaderInfo = $"{arg} {text} {Mathf.RoundToInt(num2)}m"; myDistText = $"{Mathf.RoundToInt(num)}m"; myRankText = (flag ? $"{num3}등" : GetEnglishOrdinal(num3)); float num9 = num6; float num10 = num9; try { foreach (Character item3 in allCharacters) { if (!((Object)(object)item3 == (Object)null) && !((Object)(object)((MonoBehaviourPun)item3).photonView == (Object)null) && ((MonoBehaviourPun)item3).photonView.Owner != null) { float totalScoreFloat = FlagSegmentScoring.GetTotalScoreFloat(((MonoBehaviourPun)item3).photonView.Owner.ActorNumber); if (totalScoreFloat > num10) { num10 = totalScoreFloat; } } } } catch { } pointsText = num9.ToString("F1") + "pt / " + num10.ToString("F1") + "pt"; } else { FlagCOOPHUD.BuildFixedHUDTexts(flag, out leaderInfo, out myDistText, out myRankText, out pointsText); } string text2 = leaderInfo + "|" + myDistText + "|" + myRankText + "|" + pointsText; if (text2 == _lastSig) { return; } _lastSig = text2; ((TMP_Text)_textLeaderInfo).text = leaderInfo; ((TMP_Text)_textMyDist).text = myDistText; ((TMP_Text)_textMyRank).text = myRankText; ((TMP_Text)_textPoints).text = pointsText; try { float num11 = (flag ? (-3f) : 0f); float num12 = (flag ? 0f : (-9f)); float num13 = -12f; ((TMP_Text)_textMyRank).rectTransform.anchoredPosition = new Vector2(-32f + num12 + num13, -32f + num11); RectTransform rectTransform = ((TMP_Text)_textPoints).rectTransform; float num14 = -102f; float num15 = (flag ? (-25f) : (-4f)); float num16 = (flag ? 0f : 6f); rectTransform.anchoredPosition = new Vector2(-25f + num16 - 7f + num12 + num13, num14 + num15 - 7f + num11); } catch { } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[FixedHUD][v172.hud1] Update 예외: " + ex.Message)); } } } private static void SetEmpty() { if ((Object)(object)_textLeaderInfo != (Object)null) { ((TMP_Text)_textLeaderInfo).text = ""; } if ((Object)(object)_textMyDist != (Object)null) { ((TMP_Text)_textMyDist).text = ""; } if ((Object)(object)_textMyRank != (Object)null) { ((TMP_Text)_textMyRank).text = ""; } if ((Object)(object)_textPoints != (Object)null) { ((TMP_Text)_textPoints).text = ""; } } private static string GetEnglishOrdinal(int rank) { if (rank <= 0) { return "-"; } int num = rank % 100; if (num >= 11 && num <= 13) { return rank + "th"; } return (rank % 10) switch { 1 => rank + "st", 2 => rank + "nd", 3 => rank + "rd", _ => rank + "th", }; } private static string GetCharacterNick(Character c) { try { if ((Object)(object)((MonoBehaviourPun)c).photonView != (Object)null && ((MonoBehaviourPun)c).photonView.Owner != null) { string nickName = ((MonoBehaviourPun)c).photonView.Owner.NickName; if (!string.IsNullOrWhiteSpace(nickName)) { return nickName; } } } catch { } return ((Object)c).name ?? "?"; } private static Vector3 GetCurrentCampfirePosition() { //IL_0009: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0062: 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) int currentSegmentIndex; try { currentSegmentIndex = FlagSurvivalMulti.GetCurrentSegmentIndex(); } catch { return PEAK_SUMMIT_POSITION; } switch (currentSegmentIndex) { default: return PEAK_SUMMIT_POSITION; case 5: return PEAK_SUMMIT_POSITION; case 0: case 1: case 2: case 3: case 4: try { GameObject campfireRoot = MapHandler.GetCampfireRoot(currentSegmentIndex); if ((Object)(object)campfireRoot != (Object)null) { Campfire componentInChildren = campfireRoot.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)((Component)componentInChildren).transform != (Object)null) { return ((Component)componentInChildren).transform.position; } } } catch { } try { Campfire currentCampfire = MapHandler.CurrentCampfire; if ((Object)(object)currentCampfire != (Object)null && (Object)(object)((Component)currentCampfire).transform != (Object)null) { return ((Component)currentCampfire).transform.position; } } catch { } return PEAK_SUMMIT_POSITION; } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.leaderboardhud", "Flag Leaderboard HUD", "1.0.0")] public class FlagLeaderboardHUDPlugin : BaseUnityPlugin { private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown GameObject val = new GameObject("FlagSurvival_LeaderboardHUD_Runner"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[LeaderboardHUD] v3 — font + fontSharedMaterial 참조 복사"); } } } internal class LeaderboardHUDRunner : MonoBehaviour { private struct Entry { public int actor; public string nick; public float score; public float distance; public string coopScoreText; } [CompilerGenerated] private sealed class d__51 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LeaderboardHUDRunner <>4__this; public int row; public Entry e; public bool isKorean; public int rank; public int myActor; public int oldRank; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LeaderboardHUDRunner leaderboardHUDRunner = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; leaderboardHUDRunner.SetRowText(row, e, isKorean, rank, myActor); 5__2 = (float)(row - oldRank) * 32f; 5__3 = 0f; break; case 1: <>1__state = -1; break; } if (5__3 < 1f) { 5__3 += Time.deltaTime / 0.32f; float num2 = Mathf.Clamp01(5__3); float num3 = 1f - num2; float num4 = 1f - num3 * num3; float yOffset = 5__2 * (1f - num4); leaderboardHUDRunner.SetRowVisualState(row, 0f, yOffset, 1f); <>2__current = null; <>1__state = 1; return true; } leaderboardHUDRunner.SetRowVisualState(row, 0f, 0f, 1f); leaderboardHUDRunner._rowAnims[row] = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__50 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LeaderboardHUDRunner <>4__this; public int row; public Entry e; public bool isKorean; public int rank; public int myActor; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__50(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LeaderboardHUDRunner leaderboardHUDRunner = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; leaderboardHUDRunner.SetRowText(row, e, isKorean, rank, myActor); 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__2 < 1f) { 5__2 += Time.deltaTime / 0.32f; float num2 = Mathf.Clamp01(5__2); float num3 = 1f - num2; float num4 = 1f - num3 * num3; leaderboardHUDRunner.SetRowVisualState(row, (1f - num4) * 220f, 0f, 1f); <>2__current = null; <>1__state = 1; return true; } leaderboardHUDRunner.SetRowVisualState(row, 0f, 0f, 1f); leaderboardHUDRunner._rowAnims[row] = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const int ROWS = 8; private const float ANCHOR_X = -20f; private const float ANCHOR_Y = 200f; private const float ROW_PITCH = 32f; private const float COL_RANK_W = 50f; private const float COL_NAME_W = 160f; private const float COL_DIST_W = 110f; private const float COL_SCORE_W = 100f; private const float COL_GAP = 8f; private const float SELF_FONT = 28f; private const float OTHER_FONT = 24f; private const float DELTA_SELF_KOR = -1f; private const float DELTA_SELF_ENG = 4f; private const float DELTA_SELF_NUM = 3f; private const float DELTA_OTHER_KOR = -5f; private const float DELTA_OTHER_ENG = -2f; private const float DELTA_OTHER_NUM = -3f; private static readonly Color SELF_COLOR = new Color(1f, 0.8784314f, 0.4f, 1f); private GameObject _container; private TextMeshProUGUI[] _rankTmps = (TextMeshProUGUI[])(object)new TextMeshProUGUI[8]; private TextMeshProUGUI[] _nameTmps = (TextMeshProUGUI[])(object)new TextMeshProUGUI[8]; private TextMeshProUGUI[] _distTmps = (TextMeshProUGUI[])(object)new TextMeshProUGUI[8]; private TextMeshProUGUI[] _scoreTmps = (TextMeshProUGUI[])(object)new TextMeshProUGUI[8]; private TMP_FontAsset _srcFont; private Material _srcSharedMaterial; private Color _origColor = Color.white; private bool _initialized; private float _lastUpdate = -10f; private string _lastSig; private const float SLIDE_DISTANCE = 220f; private const float SLIDE_IN_DURATION = 0.32f; private const float FALL_DURATION = 0.32f; private static readonly Vector3 PEAK_SUMMIT_POSITION = new Vector3(19.5f, 1228.7f, 2242.5f); private readonly Dictionary _prevActorRank = new Dictionary(); private Coroutine[] _rowAnims = (Coroutine[])(object)new Coroutine[8]; private float _baseRankX; private float _baseNameX; private float _baseScoreX; private float _baseDistX; private float[] _dynRankX = new float[8]; private float[] _dynNameX = new float[8]; private float[] _dynDistX = new float[8]; private float[] _dynScoreX = new float[8]; private float _hudTotalW; private void Update() { if (!_initialized) { if (TryInit()) { _initialized = true; } return; } if (FlagEndCutsceneState.IsActive) { if ((Object)(object)_container != (Object)null && _container.activeSelf) { _container.SetActive(false); } return; } if (!FlagCOOPHUD.ShouldShowLeaderboard()) { if ((Object)(object)_container != (Object)null && _container.activeSelf) { _container.SetActive(false); } return; } bool flag = (Object)(object)Character.localCharacter != (Object)null; if ((Object)(object)_container != (Object)null && _container.activeSelf != flag) { _container.SetActive(flag); } if (!flag || Time.time < _lastUpdate + 0.5f) { return; } _lastUpdate = Time.time; try { UpdateRows(); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[LeaderboardHUD] " + ex.Message)); } } } private bool TryInit() { //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) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00be: 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_00e8: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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) TextMeshProUGUI val = FindFlagCountTMP(); if ((Object)(object)val == (Object)null) { return false; } if ((Object)(object)((TMP_Text)val).font == (Object)null) { return false; } _srcFont = ((TMP_Text)val).font; _srcSharedMaterial = ((TMP_Text)val).fontSharedMaterial; _origColor = ((Graphic)val).color; Canvas componentInParent = ((Component)val).GetComponentInParent(true); if ((Object)(object)componentInParent == (Object)null) { return false; } _container = new GameObject("FlagSurvival_LeaderboardHUD_Container", new Type[1] { typeof(RectTransform) }); _container.transform.SetParent(((Component)componentInParent).transform, false); _container.layer = ((Component)componentInParent).gameObject.layer; RectTransform component = _container.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.anchoredPosition = new Vector2(-20f, -200f); float num = 444f; float num2 = 256f; component.sizeDelta = new Vector2(num, num2); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; float num3 = 0f; float num4 = 58f; float num5 = 226f; float num6 = 344f; _baseRankX = num3; _baseNameX = num4; _baseDistX = num5; _baseScoreX = num6; _hudTotalW = num; for (int i = 0; i < 8; i++) { _dynRankX[i] = num3; _dynNameX[i] = num4; _dynDistX[i] = num5; _dynScoreX[i] = num6; } for (int j = 0; j < 8; j++) { float y = (float)j * 32f; _rankTmps[j] = CreateRowTMP("Rank" + j, num3, y, 50f, (TextAlignmentOptions)4097); _nameTmps[j] = CreateRowTMP("Name" + j, num4, y, 160f, (TextAlignmentOptions)4097); _distTmps[j] = CreateRowTMP("Dist" + j, num5, y, 110f, (TextAlignmentOptions)4097); _scoreTmps[j] = CreateRowTMP("Score" + j, num6, y, 100f, (TextAlignmentOptions)4097); } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)("[LeaderboardHUD] 초기화 완료 — 소스='" + ((Object)val).name + "', 폰트='" + ((Object)_srcFont).name + "', 머티리얼='" + (((Object)(object)_srcSharedMaterial != (Object)null) ? ((Object)_srcSharedMaterial).name : "null") + "'")); } return true; } private static TextMeshProUGUI FindFlagCountTMP() { TextMeshProUGUI[] array = Object.FindObjectsOfType(true); if (array == null) { return null; } TextMeshProUGUI[] array2 = array; foreach (TextMeshProUGUI val in array2) { if (!((Object)(object)val == (Object)null) && ((Object)((Component)val).gameObject).name.StartsWith("FlagSurvival_FlagCountText_")) { return val; } } return null; } private TextMeshProUGUI CreateRowTMP(string suffix, float x, float y, float w, TextAlignmentOptions align) { //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_0054: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FlagSurvival_LeaderboardHUD_" + suffix, new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(TextMeshProUGUI) }); val.transform.SetParent(_container.transform, false); val.layer = _container.layer; RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 1f); component.anchoredPosition = new Vector2(x, 0f - y); component.sizeDelta = new Vector2(w, 32f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; TextMeshProUGUI component2 = val.GetComponent(); ((TMP_Text)component2).font = _srcFont; if ((Object)(object)_srcSharedMaterial != (Object)null) { ((TMP_Text)component2).fontSharedMaterial = _srcSharedMaterial; } ((TMP_Text)component2).alignment = align; ((Graphic)component2).color = _origColor; ((TMP_Text)component2).text = ""; ((Graphic)component2).raycastTarget = false; ((TMP_Text)component2).enableWordWrapping = false; ((TMP_Text)component2).enableAutoSizing = false; ((TMP_Text)component2).autoSizeTextContainer = false; ((TMP_Text)component2).paragraphSpacing = 0f; ((TMP_Text)component2).lineSpacing = 0f; ((TMP_Text)component2).fontSize = 24f; return component2; } private void UpdateRows() { //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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) bool flag = FlagSurvivalPlugin.CfgHudLanguage == null || FlagSurvivalPlugin.CfgHudLanguage.Value == FlagSurvivalPlugin.HUD언어.한국어; int num = -1; try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null && (Object)(object)((MonoBehaviourPun)localCharacter).photonView != (Object)null && ((MonoBehaviourPun)localCharacter).photonView.Owner != null) { num = ((MonoBehaviourPun)localCharacter).photonView.Owner.ActorNumber; } } catch { } Vector3 currentCampfirePosition = GetCurrentCampfirePosition(); List list = new List(); bool flag2 = FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP; if (flag2) { try { List allCharacters = Character.AllCharacters; if (allCharacters != null) { foreach (Character item in allCharacters) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((MonoBehaviourPun)item).photonView == (Object)null) && ((MonoBehaviourPun)item).photonView.Owner != null) { int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; string nick = ((MonoBehaviourPun)item).photonView.Owner.NickName ?? "?"; float score = 0f; try { score = FlagSegmentScoring.GetTotalScoreFloat(actorNumber); } catch { } float distance = float.MaxValue; try { distance = Vector3.Distance(currentCampfirePosition, item.Center) * CharacterStats.unitsToMeters; } catch { } list.Add(new Entry { actor = actorNumber, nick = nick, score = score, distance = distance }); } } } } catch { } list.Sort(delegate(Entry a, Entry b) { int num3 = b.score.CompareTo(a.score); if (num3 != 0) { return num3; } int num4 = a.distance.CompareTo(b.distance); return (num4 != 0) ? num4 : a.actor.CompareTo(b.actor); }); } else { int coopLeaderboardRowCount = FlagCOOPHUD.GetCoopLeaderboardRowCount(); for (int i = 0; i < coopLeaderboardRowCount && i < 8; i++) { if (!FlagCOOPHUD.BuildCoopLeaderboardRow(i, flag, out var nick2, out var scoreText)) { continue; } int num2 = -1; try { if (PhotonNetwork.PlayerList != null) { Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { if (val != null && val.NickName == nick2) { num2 = val.ActorNumber; break; } } } } catch { } if (num2 < 0) { num2 = -(i + 1); } list.Add(new Entry { actor = num2, nick = nick2, score = 0f, distance = 0f, coopScoreText = scoreText }); } } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(flag ? 'K' : 'E').Append('|'); stringBuilder.Append(num).Append('|'); if (flag2) { foreach (Entry item2 in list) { stringBuilder.Append(item2.actor).Append(',').Append(item2.score.ToString("F1")) .Append(',') .Append(Mathf.RoundToInt(item2.distance)) .Append(';'); } } else { foreach (Entry item3 in list) { stringBuilder.Append(item3.actor).Append(',').Append(item3.coopScoreText ?? "") .Append(';'); } } string text = stringBuilder.ToString(); if (text == _lastSig) { return; } _lastSig = text; bool flag3 = _prevActorRank.Count == 0; for (int k = 0; k < 8; k++) { if (k >= list.Count) { CancelAnimAndReset(k); ((TMP_Text)_rankTmps[k]).text = ""; ((TMP_Text)_nameTmps[k]).text = ""; ((TMP_Text)_distTmps[k]).text = ""; ((TMP_Text)_scoreTmps[k]).text = ""; continue; } Entry e = list[k]; int rank = k + 1; int value; bool flag4 = _prevActorRank.TryGetValue(e.actor, out value); bool flag5 = !flag4 || value != k; if (flag3 || !flag5) { CancelAnimAndReset(k); SetRowText(k, e, flag, rank, num); continue; } if (_rowAnims[k] != null) { ((MonoBehaviour)this).StopCoroutine(_rowAnims[k]); _rowAnims[k] = null; } if (flag4 && value > k) { _rowAnims[k] = ((MonoBehaviour)this).StartCoroutine(AnimateRowRise(k, e, flag, rank, num)); } else { _rowAnims[k] = ((MonoBehaviour)this).StartCoroutine(AnimateRowFall(k, e, flag, rank, num, value)); } } _prevActorRank.Clear(); for (int l = 0; l < list.Count && l < 8; l++) { _prevActorRank[list[l].actor] = l; } } private void CancelAnimAndReset(int row) { if (_rowAnims[row] != null) { ((MonoBehaviour)this).StopCoroutine(_rowAnims[row]); _rowAnims[row] = null; } SetRowVisualState(row, 0f, 0f, 1f); } [IteratorStateMachine(typeof(d__50))] private IEnumerator AnimateRowRise(int row, Entry e, bool isKorean, int rank, int myActor) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__50(0) { <>4__this = this, row = row, e = e, isKorean = isKorean, rank = rank, myActor = myActor }; } [IteratorStateMachine(typeof(d__51))] private IEnumerator AnimateRowFall(int row, Entry e, bool isKorean, int rank, int myActor, int oldRank) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__51(0) { <>4__this = this, row = row, e = e, isKorean = isKorean, rank = rank, myActor = myActor, oldRank = oldRank }; } private void SetRowVisualState(int row, float xOffset, float yOffset, float alpha) { float baseY = (float)(-row) * 32f; ApplyTmpState(_rankTmps[row], _dynRankX[row], xOffset, baseY, yOffset, alpha); ApplyTmpState(_nameTmps[row], _dynNameX[row], xOffset, baseY, yOffset, alpha); ApplyTmpState(_distTmps[row], _dynDistX[row], xOffset, baseY, yOffset, alpha); ApplyTmpState(_scoreTmps[row], _dynScoreX[row], xOffset, baseY, yOffset, alpha); } private static void ApplyTmpState(TextMeshProUGUI tmp, float baseX, float xOffset, float baseY, float yOffset, float alpha) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)tmp == (Object)null)) { ((TMP_Text)tmp).rectTransform.anchoredPosition = new Vector2(baseX + xOffset, baseY + yOffset); if ((Object)(object)tmp.canvasRenderer != (Object)null) { tmp.canvasRenderer.SetAlpha(alpha); } } } private void SetRowText(int row, Entry e, bool isKorean, int rank, int myActor) { //IL_0016: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) bool flag = e.actor == myActor; Color color = (flag ? SELF_COLOR : _origColor); float num = (flag ? 28f : 24f); float korSize = num + (flag ? (-1f) : (-5f)); float engSize = num + (flag ? 4f : (-2f)); float numSize = num + (flag ? 3f : (-3f)); ((TMP_Text)_rankTmps[row]).fontSize = num; ((TMP_Text)_nameTmps[row]).fontSize = num; ((TMP_Text)_distTmps[row]).fontSize = num; ((TMP_Text)_scoreTmps[row]).fontSize = num; string text = (isKorean ? (rank + "등") : GetEnglishOrdinal(rank)); bool num2 = FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP; string text2 = (num2 ? (e.score.ToString("F1") + "pt") : (e.coopScoreText ?? "")); string text3 = (num2 ? (Mathf.RoundToInt(e.distance) + "m") : ""); string text4 = ApplyPerCharSizing(text, korSize, engSize, numSize); string text5 = ApplyPerCharSizing(e.nick, korSize, engSize, numSize); string text6 = ApplyPerCharSizing(text3, korSize, engSize, numSize); string text7 = ApplyPerCharSizing(text2, korSize, engSize, numSize); float x = ((TMP_Text)_rankTmps[row]).GetPreferredValues(text4).x; float x2 = ((TMP_Text)_nameTmps[row]).GetPreferredValues(text5).x; float x3 = ((TMP_Text)_distTmps[row]).GetPreferredValues(text6).x; float x4 = ((TMP_Text)_scoreTmps[row]).GetPreferredValues(text7).x; _dynScoreX[row] = _hudTotalW - x4; _dynDistX[row] = _dynScoreX[row] - 8f - x3; _dynNameX[row] = _dynDistX[row] - 8f - x2; _dynRankX[row] = _dynNameX[row] - 8f - x; ((TMP_Text)_rankTmps[row]).text = text4; ((TMP_Text)_nameTmps[row]).text = text5; ((TMP_Text)_distTmps[row]).text = text6; ((TMP_Text)_scoreTmps[row]).text = text7; ((Graphic)_rankTmps[row]).color = color; ((Graphic)_nameTmps[row]).color = color; ((Graphic)_distTmps[row]).color = color; ((Graphic)_scoreTmps[row]).color = color; ApplyTmpX(_rankTmps[row], _dynRankX[row]); ApplyTmpX(_nameTmps[row], _dynNameX[row]); ApplyTmpX(_distTmps[row], _dynDistX[row]); ApplyTmpX(_scoreTmps[row], _dynScoreX[row]); } private static string ApplyPerCharSizing(string text, float korSize, float engSize, float numSize) { if (string.IsNullOrEmpty(text)) { return text ?? ""; } StringBuilder stringBuilder = new StringBuilder(text.Length + 32); int num = -1; foreach (char c in text) { int num2 = ClassifyChar(c); if (num2 != num) { if (num != -1) { stringBuilder.Append(""); } stringBuilder.Append(" engSize, 0 => korSize, _ => numSize, }).ToString("F0", CultureInfo.InvariantCulture)).Append('>'); num = num2; } stringBuilder.Append(c); } if (num != -1) { stringBuilder.Append(""); } return stringBuilder.ToString(); } private static int ClassifyChar(char c) { if (c >= '가' && c <= '힣') { return 0; } if (c >= 'ᄀ' && c <= 'ᇿ') { return 0; } if (c >= '\u3130' && c <= '\u318f') { return 0; } if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) { return 1; } return 2; } private static void ApplyTmpX(TextMeshProUGUI tmp, float x) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) if (!((Object)(object)tmp == (Object)null)) { RectTransform rectTransform = ((TMP_Text)tmp).rectTransform; Vector2 anchoredPosition = rectTransform.anchoredPosition; anchoredPosition.x = x; rectTransform.anchoredPosition = anchoredPosition; } } private static Vector3 GetCurrentCampfirePosition() { //IL_0009: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0062: 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) int currentSegmentIndex; try { currentSegmentIndex = FlagSurvivalMulti.GetCurrentSegmentIndex(); } catch { return PEAK_SUMMIT_POSITION; } switch (currentSegmentIndex) { default: return PEAK_SUMMIT_POSITION; case 5: return PEAK_SUMMIT_POSITION; case 0: case 1: case 2: case 3: case 4: try { GameObject campfireRoot = MapHandler.GetCampfireRoot(currentSegmentIndex); if ((Object)(object)campfireRoot != (Object)null) { Campfire componentInChildren = campfireRoot.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)((Component)componentInChildren).transform != (Object)null) { return ((Component)componentInChildren).transform.position; } } } catch { } try { Campfire currentCampfire = MapHandler.CurrentCampfire; if ((Object)(object)currentCampfire != (Object)null && (Object)(object)((Component)currentCampfire).transform != (Object)null) { return ((Component)currentCampfire).transform.position; } } catch { } return PEAK_SUMMIT_POSITION; } } private static string GetEnglishOrdinal(int rank) { if (rank <= 0) { return "-"; } int num = rank % 100; if (num >= 11 && num <= 13) { return rank + "th"; } return (rank % 10) switch { 1 => rank + "st", 2 => rank + "nd", 3 => rank + "rd", _ => rank + "th", }; } } [HarmonyPatch] public static class Patch_LeaderboardHUDRunner_Update_InitGuard { public static MethodBase TargetMethod() { Type type = AccessTools.TypeByName("FlagSurvival.LeaderboardHUDRunner"); if (type == null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)"[LeaderboardHUDInitGuard] FlagSurvival.LeaderboardHUDRunner 타입 못 찾음 — 가드 미적용"); } return null; } MethodInfo methodInfo = AccessTools.Method(type, "Update", (Type[])null, (Type[])null); if (methodInfo == null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)"[LeaderboardHUDInitGuard] LeaderboardHUDRunner.Update 메서드 못 찾음 — 가드 미적용"); } return null; } return methodInfo; } [HarmonyPrefix] public static bool Prefix(object __instance) { try { if ((Object)(object)Character.localCharacter == (Object)null) { return false; } } catch { return true; } return true; } } public static class FlagOptimizer { private class Entry { public Transform transform; public Renderer[] renderers; } private class OptimizerTick : MonoBehaviour { private float _t; private void Update() { _t += Time.deltaTime; if (!(_t < 1f)) { _t = 0f; DoCullTick(); } } } private const float DEFAULT_CULL_DISTANCE = 150f; private const float TICK_INTERVAL = 1f; private static readonly List _entries = new List(); private static OptimizerTick _tickInstance; public static int RegisteredCount => _entries.Count; private static float GetCullDistanceSqr() { float num = FlagSurvivalPlugin.CfgFlagCullDistance?.Value ?? 150f; return num * num; } public static void Register(GameObject flagGo) { if ((Object)(object)flagGo == (Object)null) { return; } Renderer[] componentsInChildren = flagGo.GetComponentsInChildren(true); if (componentsInChildren == null || componentsInChildren.Length == 0) { return; } for (int i = 0; i < componentsInChildren.Length; i++) { if (!((Object)(object)componentsInChildren[i] == (Object)null)) { componentsInChildren[i].shadowCastingMode = (ShadowCastingMode)0; componentsInChildren[i].receiveShadows = false; } } _entries.Add(new Entry { transform = flagGo.transform, renderers = componentsInChildren }); EnsureTick(); } public static void Clear() { _entries.Clear(); } public static void DumpFirstFlagShaderInfo() { //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) if (_entries.Count == 0) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)"[셰이더덤프] 등록된 깃발 없음 — 깃발 생성 후 다시 시도"); } return; } Entry entry = _entries[0]; if (entry == null || (Object)(object)entry.transform == (Object)null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[셰이더덤프] 첫 entry stale (이미 destroy됨)"); } return; } ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[셰이더덤프] === 시작: {((Object)entry.transform).name} (Renderer {entry.renderers.Length}개) ==="); } for (int i = 0; i < entry.renderers.Length; i++) { Renderer val = entry.renderers[i]; if ((Object)(object)val == (Object)null) { continue; } Material[] sharedMaterials = val.sharedMaterials; ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)$"[셰이더덤프] [{i}] Renderer={((Object)val).name}, MaterialCount={sharedMaterials.Length}"); } for (int j = 0; j < sharedMaterials.Length; j++) { Material val2 = sharedMaterials[j]; if ((Object)(object)val2 == (Object)null) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$" mat[{j}] = null"); } continue; } Shader shader = val2.shader; int num = 0; try { num = shader.GetPropertyCount(); } catch { num = -1; } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$" mat[{j}] Shader={((Object)shader).name}, RenderQueue={val2.renderQueue}, PropertyCount={num}"); } if (num > 0) { for (int k = 0; k < num; k++) { try { string propertyName = shader.GetPropertyName(k); ShaderPropertyType propertyType = shader.GetPropertyType(k); ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogInfo((object)$" [{k}] {propertyName} ({propertyType})"); } } catch (Exception ex) { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogError((object)$" 프로퍼티 [{k}] 읽기 실패: {ex.Message}"); } } } } string[] shaderKeywords = val2.shaderKeywords; string arg = ((shaderKeywords.Length != 0) ? string.Join(", ", shaderKeywords) : "(없음)"); ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)$" 활성 키워드 ({shaderKeywords.Length}): {arg}"); } } } ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)"[셰이더덤프] === 끝 — Dissolve 관련 프로퍼티/키워드 검색하세요 (예: _Dissolve, _Cutoff, _Fade) ==="); } } private static void EnsureTick() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_tickInstance != (Object)null)) { GameObject val = new GameObject("FlagOptimizer_Tick"); Object.DontDestroyOnLoad((Object)val); _tickInstance = val.AddComponent(); } } internal static void DoCullTick() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007a: 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) Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { return; } Vector3 center = localCharacter.Center; float cullDistanceSqr = GetCullDistanceSqr(); int num = 0; int num2 = 0; int num3 = 0; for (int num4 = _entries.Count - 1; num4 >= 0; num4--) { Entry entry = _entries[num4]; if (entry == null || (Object)(object)entry.transform == (Object)null) { _entries.RemoveAt(num4); num3++; } else { Vector3 val = entry.transform.position - center; bool flag = ((Vector3)(ref val)).sqrMagnitude <= cullDistanceSqr; if (flag) { num2++; } else { num++; } Renderer[] renderers = entry.renderers; for (int i = 0; i < renderers.Length; i++) { if (!((Object)(object)renderers[i] == (Object)null) && renderers[i].enabled != flag) { renderers[i].enabled = flag; } } } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.coordsrow", "Player Coords Row", "1.0.0")] public class FlagPlayerCoordsRowPlugin : BaseUnityPlugin { private class CoordsRunner : MonoBehaviour { private GameObject _scoreContainer; private TextMeshProUGUI _coordsTmp; private void Update() { //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_0077: Expected O, but got Unknown //IL_00b3: 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) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_015a: 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_0208: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_scoreContainer == (Object)null) { _scoreContainer = GameObject.Find("FlagSurvival_ScoreContainer"); if ((Object)(object)_scoreContainer == (Object)null) { return; } } if ((Object)(object)_coordsTmp == (Object)null) { try { TextMeshProUGUI componentInChildren = _scoreContainer.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } GameObject val = new GameObject("FlagSurvival_PlayerCoordsRow", new Type[1] { typeof(RectTransform) }); val.transform.SetParent(_scoreContainer.transform, false); val.layer = _scoreContainer.layer; RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 0f); component.pivot = new Vector2(0f, 1f); component.anchoredPosition = new Vector2(0f, -10f); component.sizeDelta = new Vector2(900f, 80f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; _coordsTmp = val.AddComponent(); ((TMP_Text)_coordsTmp).font = ((TMP_Text)componentInChildren).font; ((TMP_Text)_coordsTmp).fontSize = 30f; ((Graphic)_coordsTmp).color = Color.yellow; ((TMP_Text)_coordsTmp).alignment = (TextAlignmentOptions)257; ((TMP_Text)_coordsTmp).enableWordWrapping = false; ((TMP_Text)_coordsTmp).text = "X: 0 Y: 0 Z: 0"; } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[CoordsRow] TMP 생성 실패: " + ex.Message)); } return; } } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { return; } Vector3 position = ((Component)localCharacter).transform.position; Vector3 val2 = position; try { if (localCharacter.refs != null && (Object)(object)localCharacter.refs.hip != (Object)null) { val2 = ((Component)localCharacter.refs.hip).transform.position; } } catch { } ((TMP_Text)_coordsTmp).text = $"Hip: X={val2.x:F1} Y={val2.y:F1} Z={val2.z:F1} Root: ({position.x:F1}, {position.y:F1}, {position.z:F1})"; } } private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown GameObject val = new GameObject("FlagSurvival_PlayerCoordsRunner"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[CoordsRow] 본 캐릭터 좌표 실시간 표시 (박스2 아래)"); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.pointlightoptimizer", "Point Light Optimizer", "1.0.0")] public class FlagPointLightOptimizerPlugin : BaseUnityPlugin { private void Awake() { FlagPointLightOptimizer.Initialize(); } } public static class FlagPointLightOptimizer { private class LightEntry { public Light light; public Transform parentTransform; } private class OptimizerTick : MonoBehaviour { private float _t; private void Update() { _t += Time.deltaTime; if (_t >= 1f) { _t = 0f; DoCullTick(); } try { Keyboard current = Keyboard.current; if (current != null && ((ButtonControl)current.f11Key).wasPressedThisFrame) { LogDiag(); } } catch { } } } private const float POINT_LIGHT_CULL_DISTANCE = 120f; private const float TICK_INTERVAL = 1f; private static readonly List _entries = new List(); private static OptimizerTick _tickInstance; private static int _lastVisibleCount = 0; private static int _lastCulledCount = 0; private static int _lastDestroyedCount = 0; private static int _totalRegistered = 0; private static int _totalDisabledByConsume = 0; public static void Initialize() { //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_001e: Expected O, but got Unknown if (!((Object)(object)_tickInstance != (Object)null)) { GameObject val = new GameObject("FlagPointLightOptimizer_Tick"); Object.DontDestroyOnLoad((Object)val); _tickInstance = val.AddComponent(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[PointLightOpt] v6 활성: 거리 컬링 {120f}m, ForcePixel 유지, F11=진단"); } } } internal static void RegisterFlag(GameObject flagGo) { if ((Object)(object)flagGo == (Object)null) { return; } try { Transform val = flagGo.transform.Find("FlagGlow"); if (!((Object)(object)val == (Object)null)) { Light component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { _entries.Add(new LightEntry { light = component, parentTransform = flagGo.transform }); _totalRegistered++; } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[PointLightOpt] RegisterFlag 실패: " + ex.Message)); } } } internal static void DisableFlagLight(GameObject flagGo) { if ((Object)(object)flagGo == (Object)null) { return; } try { Transform val = flagGo.transform.Find("FlagGlow"); if ((Object)(object)val == (Object)null) { return; } Light component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { return; } ((Behaviour)component).enabled = false; _totalDisabledByConsume++; for (int num = _entries.Count - 1; num >= 0; num--) { if (_entries[num] == null || (Object)(object)_entries[num].light == (Object)(object)component) { _entries.RemoveAt(num); break; } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[PointLightOpt] DisableFlagLight 실패: " + ex.Message)); } } } private static void DoCullTick() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { return; } Vector3 val; try { val = localCharacter.Center; } catch { try { val = ((Component)localCharacter).transform.position; } catch { return; } } float num = 14400f; int num2 = 0; int num3 = 0; int num4 = 0; for (int num5 = _entries.Count - 1; num5 >= 0; num5--) { LightEntry lightEntry = _entries[num5]; if (lightEntry == null || (Object)(object)lightEntry.light == (Object)null || (Object)(object)lightEntry.parentTransform == (Object)null) { _entries.RemoveAt(num5); num4++; } else { Vector3 val2 = lightEntry.parentTransform.position - val; if (((Vector3)(ref val2)).sqrMagnitude <= num) { if (!((Behaviour)lightEntry.light).enabled) { ((Behaviour)lightEntry.light).enabled = true; } num2++; } else { if (((Behaviour)lightEntry.light).enabled) { ((Behaviour)lightEntry.light).enabled = false; } num3++; } } } _lastVisibleCount = num2; _lastCulledCount = num3; _lastDestroyedCount = num4; } internal static void LogDiag() { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)($"[PointLightOpt][F11] 등록={_entries.Count}, " + $"마지막Tick: 활성={_lastVisibleCount}, 컬={_lastCulledCount}, 정리됨={_lastDestroyedCount}, " + $"누적: 등록={_totalRegistered}, 페이드OFF={_totalDisabledByConsume}")); } } } [HarmonyPatch(typeof(FlagSurvivalMulti), "OnFlagSpawned", new Type[] { typeof(CheckpointFlag), typeof(Vector3), typeof(bool) })] public static class Patch_OnFlagSpawned_RegisterLight { [HarmonyPostfix] public static void Postfix(CheckpointFlag flag) { if (!((Object)(object)flag == (Object)null) && !((Object)(object)((Component)flag).gameObject == (Object)null)) { FlagPointLightOptimizer.RegisterFlag(((Component)flag).gameObject); } } } [HarmonyPatch(typeof(FlagFadeEffect), "StartConsumeFade")] public static class Patch_StartConsumeFade_DisableLight { [HarmonyPostfix] public static void Postfix(GameObject flagGo) { FlagPointLightOptimizer.DisableFlagLight(flagGo); } } [HarmonyPatch(typeof(FlagFadeEffect), "StartConsumeFadeColor")] public static class Patch_StartConsumeFadeColor_DisableLight { [HarmonyPostfix] public static void Postfix(GameObject flagGo) { FlagPointLightOptimizer.DisableFlagLight(flagGo); } } [HarmonyPatch(typeof(FlagFadeEffect), "StartConsumeFadeRemove")] public static class Patch_StartConsumeFadeRemove_DisableLight { [HarmonyPostfix] public static void Postfix(GameObject flagGo) { FlagPointLightOptimizer.DisableFlagLight(flagGo); } } [HarmonyPatch(typeof(FlagFadeEffect), "StartInstantRecolor")] public static class Patch_StartInstantRecolor_DisableLight { [HarmonyPostfix] public static void Postfix(GameObject flagGo) { FlagPointLightOptimizer.DisableFlagLight(flagGo); } } [HarmonyPatch(typeof(PeakHandler), "EndScreenComplete")] public static class FlagRpcVerifyTest { [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private Dictionary 5__2; private Dictionary 5__3; private Dictionary 5__4; private Dictionary 5__5; private float 5__6; private int 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Unknown result type (might be due to invalid IL or missing references) //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)"========================================================="); } ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogWarning((object)"[RpcVerify][v1] ★ EndScreenComplete RPC 검증 시작 ★"); } ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[RpcVerify] Time={Time.time:F2}, frame={Time.frameCount}"); } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)"========================================================="); } 5__2 = new Dictionary(); 5__3 = new Dictionary(); 5__4 = new Dictionary(); 5__5 = new Dictionary(); try { List allCharacters = Character.AllCharacters; if (allCharacters == null) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)"[RpcVerify] Character.AllCharacters null — 검증 중단"); } _testInProgress = false; return false; } int num3 = 0; foreach (Character item in allCharacters) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((MonoBehaviourPun)item).photonView == (Object)null) && ((MonoBehaviourPun)item).photonView.Owner != null) { int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; string text2 = ((MonoBehaviourPun)item).photonView.Owner.NickName ?? "?"; Vector3 val3 = Vector3.zero; if (item.refs != null && (Object)(object)item.refs.hip != (Object)null) { val3 = ((Component)item.refs.hip).transform.position; } 5__2[actorNumber] = val3; 5__3[actorNumber] = TEST_TARGET_BASE; 5__4[actorNumber] = item; 5__5[actorNumber] = text2; num3++; ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogWarning((object)$"[RpcVerify] [START] actor={actorNumber} '{text2}' hip=({val3.x:F1}, {val3.y:F1}, {val3.z:F1}) → target=({5__3[actorNumber].x:F1}, {5__3[actorNumber].y:F1}, {5__3[actorNumber].z:F1})"); } } } } catch (Exception ex2) { ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogError((object)("[RpcVerify] 시작 위치 기록 예외: " + ex2.Message)); } } if (5__2.Count == 0) { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogError((object)"[RpcVerify] 캐릭터 0명 — 검증 중단"); } _testInProgress = false; return false; } int num4 = 0; foreach (KeyValuePair item2 in 5__4) { int key2 = item2.Key; Character value2 = item2.Value; Vector3 val4 = 5__3[key2]; try { if ((Object)(object)((MonoBehaviourPun)value2).photonView != (Object)null) { ((MonoBehaviourPun)value2).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val4, false }); ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogWarning((object)$"[RpcVerify] [RPC] actor={key2} '{5__5[key2]}' WarpPlayerRPC 호출 → ({val4.x:F1}, {val4.y:F1}, {val4.z:F1})"); } num4++; } } catch (Exception ex3) { ManualLogSource log12 = FlagSurvivalPlugin.Log; if (log12 != null) { log12.LogError((object)$"[RpcVerify] [RPC] actor={key2} 호출 예외: {ex3.Message}"); } } } ManualLogSource log13 = FlagSurvivalPlugin.Log; if (log13 != null) { log13.LogWarning((object)$"[RpcVerify] {num4}/{5__2.Count}명에게 RPC 호출 완료. {1f:F1}초 추적 시작..."); } 5__6 = 0f; 5__7 = 0; break; } case 1: <>1__state = -1; 5__6 += 0.05f; 5__7++; try { foreach (KeyValuePair item3 in 5__4) { int key = item3.Key; Character value = item3.Value; if (!((Object)(object)value == (Object)null) && value.refs != null && !((Object)(object)value.refs.hip == (Object)null)) { Vector3 position = ((Component)value.refs.hip).transform.position; Vector3 val = 5__2[key]; Vector3 val2 = 5__3[key]; float num = Vector3.Distance(position, val); float num2 = Vector3.Distance(position, val2); string text = ((num2 < 5f) ? "\ud83c\udfaf TARGET" : ((!(num > 5f)) ? "❌ STUCK " : "\ud83d\udccd MOVED ")); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[RpcVerify] [t={5__6:F2}s] actor={key} {text} pos=({position.x:F1},{position.y:F1},{position.z:F1}) | dStart={num:F1}m, dTarget={num2:F1}m"); } } } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)$"[RpcVerify] 추적 샘플 {5__7} 예외: {ex.Message}"); } } break; } if (5__6 < 1f) { <>2__current = (object)new WaitForSecondsRealtime(0.05f); <>1__state = 1; return true; } ManualLogSource log14 = FlagSurvivalPlugin.Log; if (log14 != null) { log14.LogWarning((object)"========================================================="); } ManualLogSource log15 = FlagSurvivalPlugin.Log; if (log15 != null) { log15.LogWarning((object)"[RpcVerify][v1] ★ 최종 결과 요약 ★"); } ManualLogSource log16 = FlagSurvivalPlugin.Log; if (log16 != null) { log16.LogWarning((object)"========================================================="); } int num5 = 0; int num6 = 0; int num7 = 0; try { foreach (KeyValuePair item4 in 5__4) { int key3 = item4.Key; Character value3 = item4.Value; if (!((Object)(object)value3 == (Object)null) && value3.refs != null && !((Object)(object)value3.refs.hip == (Object)null)) { Vector3 position2 = ((Component)value3.refs.hip).transform.position; Vector3 val5 = 5__2[key3]; Vector3 val6 = 5__3[key3]; float num8 = Vector3.Distance(position2, val5); float num9 = Vector3.Distance(position2, val6); string arg; if (num9 < 5f) { arg = "\ud83c\udfaf TARGET 도달 — RPC 정상 작동"; num5++; } else if (num8 > 5f) { arg = "\ud83d\udccd MOVED — 일시 이동했으나 다른 곳 (텔레포트 코드 경합)"; num6++; } else { arg = "❌ STUCK — RPC 무시 또는 좌표 lock"; num7++; } ManualLogSource log17 = FlagSurvivalPlugin.Log; if (log17 != null) { log17.LogWarning((object)($"[RpcVerify] [VERDICT] actor={key3} '{5__5[key3]}' {arg}\n" + $" 시작=({val5.x:F1},{val5.y:F1},{val5.z:F1}) → 끝=({position2.x:F1},{position2.y:F1},{position2.z:F1})\n" + $" dStart={num8:F1}m, dTarget={num9:F1}m")); } } } } catch (Exception ex4) { ManualLogSource log18 = FlagSurvivalPlugin.Log; if (log18 != null) { log18.LogError((object)("[RpcVerify] 결과 요약 예외: " + ex4.Message)); } } ManualLogSource log19 = FlagSurvivalPlugin.Log; if (log19 != null) { log19.LogWarning((object)$"[RpcVerify] ★ 최종: TARGET={num5}명, MOVED={num6}명, STUCK={num7}명 (총 {5__4.Count}명) ★"); } ManualLogSource log20 = FlagSurvivalPlugin.Log; if (log20 != null) { log20.LogWarning((object)"========================================================="); } _testInProgress = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool _testInProgress = false; private static int _lastTestFrame = -1; private const float TRACK_DURATION = 1f; private const float TRACK_INTERVAL = 0.05f; private static readonly Vector3 TEST_TARGET_BASE = new Vector3(-40.2f, 1181f, 2062.8f); private static void Postfix(PeakHandler __instance) { try { if (!_testInProgress && Time.frameCount != _lastTestFrame && !((Object)(object)__instance == (Object)null) && FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP) { _lastTestFrame = Time.frameCount; _testInProgress = true; ((MonoBehaviour)__instance).StartCoroutine(VerifyRpcCoroutine()); } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[RpcVerify] Postfix 예외: " + ex.Message)); } } } [IteratorStateMachine(typeof(d__6))] private static IEnumerator VerifyRpcCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0); } } public static class FlagScoutMasterDarkVision { private class DarkVisionRunner : MonoBehaviour { private Canvas _canvas; private GameObject _vignetteGo; private Graphic _vignetteImg; private GameObject _offsetGo; private Graphic _offsetImg; private GameObject _vignettePulseGo; private RawImage _vignettePulseImg; private Texture2D _vignettePulseTex; private Texture2D _vignetteTex; private AudioSource _heartbeat; private AudioClip _heartbeatClip; private float _currentAlpha; private float _targetAlpha; private float _originalFov; private float _currentFov; private float _targetFov; private bool _fovCaptured; private float _pulsePhase; private float _lastBeatTime; private int _beatCount; private Scoutmaster _scoutmaster; private float _lastTickLog; private int _updateTickCount; public void OnActivated(Scoutmaster sm) { _scoutmaster = sm; EnsureBuilt(); _targetAlpha = 0.7f; _beatCount = 0; _lastBeatTime = 0f; } public void OnDeactivated() { _targetAlpha = 0f; _targetFov = _originalFov; } private void EnsureBuilt() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_canvas != (Object)null)) { GameObject val = new GameObject("DarkVisionCanvas"); val.transform.SetParent(((Component)this).transform, false); _canvas = val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 4500; CanvasScaler obj = val.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); obj.matchWidthOrHeight = 0.5f; val.AddComponent(); _vignetteGo = new GameObject("Vignette", new Type[2] { typeof(RectTransform), typeof(CanvasRenderer) }); _vignetteGo.transform.SetParent(val.transform, false); Image val2 = _vignetteGo.AddComponent(); ((Graphic)val2).material = CreateMultiplyMaterial(); ((Graphic)val2).color = new Color(1f, 1f, 1f, 1f); ((Graphic)val2).raycastTarget = false; _vignetteImg = (Graphic)(object)val2; RectTransform rectTransform = ((Graphic)val2).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; _offsetGo = new GameObject("Offset", new Type[2] { typeof(RectTransform), typeof(CanvasRenderer) }); _offsetGo.transform.SetParent(val.transform, false); Image val3 = _offsetGo.AddComponent(); ((Graphic)val3).material = CreateOffsetMaterial(); ((Graphic)val3).color = new Color(1f, 1f, 1f, 1f); ((Graphic)val3).raycastTarget = false; _offsetImg = (Graphic)(object)val3; RectTransform rectTransform2 = ((Graphic)val3).rectTransform; rectTransform2.anchorMin = Vector2.zero; rectTransform2.anchorMax = Vector2.one; rectTransform2.offsetMin = Vector2.zero; rectTransform2.offsetMax = Vector2.zero; _offsetGo.transform.SetSiblingIndex(_vignetteGo.transform.GetSiblingIndex() + 1); _vignettePulseTex = CreateVignetteTexture(256); _vignettePulseGo = new GameObject("VignettePulse", new Type[2] { typeof(RectTransform), typeof(CanvasRenderer) }); _vignettePulseGo.transform.SetParent(val.transform, false); _vignettePulseImg = _vignettePulseGo.AddComponent(); _vignettePulseImg.texture = (Texture)(object)_vignettePulseTex; ((Graphic)_vignettePulseImg).color = new Color(0f, 0f, 0f, 0f); ((Graphic)_vignettePulseImg).raycastTarget = false; RectTransform rectTransform3 = ((Graphic)_vignettePulseImg).rectTransform; rectTransform3.anchorMin = Vector2.zero; rectTransform3.anchorMax = Vector2.one; rectTransform3.offsetMin = Vector2.zero; rectTransform3.offsetMax = Vector2.zero; _vignettePulseGo.transform.SetSiblingIndex(val.transform.childCount - 1); _heartbeat = val.AddComponent(); _heartbeatClip = CreateHeartbeatClip(); _heartbeat.clip = _heartbeatClip; _heartbeat.volume = 1f; _heartbeat.spatialBlend = 0f; _heartbeat.loop = false; _heartbeat.bypassEffects = true; _heartbeat.bypassListenerEffects = true; _heartbeat.bypassReverbZones = true; _heartbeat.priority = 0; _heartbeat.mute = false; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)("[DarkVision][v3] EnsureBuilt 완료 — " + $"Canvas={(Object)(object)_canvas != (Object)null}, Vignette={(Object)(object)_vignetteImg != (Object)null}(tex={(Object)(object)_vignetteTex != (Object)null}, " + $"size={(((Object)(object)_vignetteTex != (Object)null) ? ((Texture)_vignetteTex).width : 0)}), " + $"Audio={(Object)(object)_heartbeat != (Object)null}(clip={(Object)(object)_heartbeatClip != (Object)null}, " + $"length={(((Object)(object)_heartbeatClip != (Object)null) ? _heartbeatClip.length : 0f):F2}s, " + $"vol={(((Object)(object)_heartbeat != (Object)null) ? _heartbeat.volume : 0f):F2})")); } } } private Texture2D CreateVignetteTexture(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0098: 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) Texture2D val = new Texture2D(size, size, (TextureFormat)1, false); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; Color32[] array = (Color32[])(object)new Color32[size * size]; float num = (float)size * 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = ((float)j - num) / num; float num3 = ((float)i - num) / num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); byte b = (byte)Mathf.Clamp(Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.3f, 0.85f, num4)) * 255f, 0f, 255f); array[i * size + j] = new Color32((byte)0, (byte)0, (byte)0, b); } } val.SetPixels32(array); val.Apply(); return val; } private Material CreateMultiplyMaterial() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown Shader val = Shader.Find("Hidden/Internal-Colored"); string text = "Hidden/Internal-Colored"; if ((Object)(object)val == (Object)null) { val = Shader.Find("Sprites/Default"); text = "Sprites/Default"; } if ((Object)(object)val == (Object)null) { val = Shader.Find("UI/Default"); text = "UI/Default"; } if ((Object)(object)val == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)"[DarkVision][v20] 셰이더 없음 — Image fallback"); } return null; } Material val2 = new Material(val); val2.SetInt("_SrcBlend", 2); val2.SetInt("_DstBlend", 0); val2.SetInt("_ZWrite", 0); val2.SetInt("_Cull", 0); ((Object)val2).hideFlags = (HideFlags)61; int num = (val2.HasProperty("_SrcBlend") ? val2.GetInt("_SrcBlend") : (-1)); int num2 = (val2.HasProperty("_DstBlend") ? val2.GetInt("_DstBlend") : (-1)); int num3 = (val2.HasProperty("_BlendOp") ? val2.GetInt("_BlendOp") : (-1)); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)("[DarkVision][v24] Multiply 머티리얼 생성 — 셰이더=" + text + ", " + $"_SrcBlend={num}(기대=2 DstColor), _DstBlend={num2}(기대=0 Zero), _BlendOp={num3}, " + $"renderQueue={val2.renderQueue}, passCount={val.passCount}")); } return val2; } private Material CreateOffsetMaterial() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown Shader val = Shader.Find("Hidden/Internal-Colored"); string text = "Hidden/Internal-Colored"; if ((Object)(object)val == (Object)null) { val = Shader.Find("Sprites/Default"); text = "Sprites/Default"; } if ((Object)(object)val == (Object)null) { val = Shader.Find("UI/Default"); text = "UI/Default"; } if ((Object)(object)val == (Object)null) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)"[DarkVision][v24] Darken 셰이더 없음"); } return null; } Material val2 = new Material(val); val2.SetInt("_SrcBlend", 2); val2.SetInt("_DstBlend", 0); val2.SetInt("_BlendOp", 0); val2.SetInt("_ZWrite", 0); val2.SetInt("_Cull", 0); ((Object)val2).hideFlags = (HideFlags)61; int num = (val2.HasProperty("_SrcBlend") ? val2.GetInt("_SrcBlend") : (-1)); int num2 = (val2.HasProperty("_DstBlend") ? val2.GetInt("_DstBlend") : (-1)); if (val2.HasProperty("_BlendOp")) { val2.GetInt("_BlendOp"); } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)("[DarkVision][v25] Darken(2nd Multiply) 머티리얼 생성 — 셰이더=" + text + ", " + $"_SrcBlend={num}(기대=2 DstColor), _DstBlend={num2}(기대=0 Zero), " + string.Format("hasSrc={0}, hasDst={1}", val2.HasProperty("_SrcBlend"), val2.HasProperty("_DstBlend")))); } return val2; } private AudioClip CreateHeartbeatClip() { int num = 22050; float num2 = 0.8f; int num3 = (int)((float)num * num2); float[] array = new float[num3]; int num4 = 0; int num5 = (int)((float)num * 0.08f); int num6 = (int)((float)num * 0.3f); int num7 = num6 + (int)((float)num * 0.08f); float num8 = Mathf.Pow(10f, 1f); float num9 = 1f / (float)num; float num10 = 0.0007957747f; float num11 = num9 / (num10 + num9); float num12 = 0f; for (int i = 0; i < num3; i++) { float num13 = 0f; if (i >= num4 && i < num5) { float num14 = (float)(i - num4) / (float)(num5 - num4); float num15 = ((num14 < 0.15f) ? (num14 / 0.15f) : Mathf.Pow(1f - (num14 - 0.15f) / 0.85f, 1.8f)); num13 = Mathf.Sin(MathF.PI * 60f * (float)i / (float)num) * num15 * 1f; } else if (i >= num6 && i < num7) { float num16 = (float)(i - num6) / (float)(num7 - num6); float num17 = ((num16 < 0.15f) ? (num16 / 0.15f) : Mathf.Pow(1f - (num16 - 0.15f) / 0.85f, 1.8f)); num13 = Mathf.Sin(MathF.PI * 120f * (float)i / (float)num) * num17 * 0.7f; } float num18 = Mathf.Clamp(num13 * num8, -1f, 1f); num12 = (array[i] = num12 + num11 * (num18 - num12)); } AudioClip obj = AudioClip.Create("Heartbeat", num3, 1, num, false); obj.SetData(array, 0); return obj; } private void Update() { //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_canvas == (Object)null) { return; } _updateTickCount++; int num; if (_updateTickCount != 1) { num = ((Time.time - _lastTickLog >= 1f) ? 1 : 0); if (num == 0) { goto IL_004d; } } else { num = 1; } _lastTickLog = Time.time; goto IL_004d; IL_004d: float unscaledDeltaTime = Time.unscaledDeltaTime; if (_isActive && Time.time - _activateTime >= 90f) { _isActive = false; _targetAlpha = 0f; if (_fovCaptured) { _targetFov = _originalFov; } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[DarkVision][v1] {90f}초 경과 — 효과 자동 종료"); } } if (!_fovCaptured) { Camera mainCamera = GetMainCamera(); if ((Object)(object)mainCamera != (Object)null) { _originalFov = mainCamera.fieldOfView; _currentFov = _originalFov; _targetFov = (_isActive ? (_originalFov * 0.6f) : _originalFov); _fovCaptured = true; } } float num2 = Mathf.Max(0.9f, 3f - (float)_beatCount * 0.3f); if (num != 0) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)($"[DarkVision][v17] tick={_updateTickCount}, _isActive={_isActive}, " + $"beatInterval={num2:F2}s, alpha={_currentAlpha:F2}, FOV={_currentFov:F1}/{_originalFov:F1}")); } } float num3 = Time.time - _lastBeatTime; float num4 = 0f; if (num3 < 1f) { num4 = ((!(num3 < 0.4f)) ? (1f - (num3 - 0.4f) / 0.6f) : (num3 / 0.4f)); num4 = Mathf.Clamp01(num4); } _currentAlpha = Mathf.Lerp(_currentAlpha, _targetAlpha, unscaledDeltaTime * 0.5f); float num5 = Mathf.Clamp01(_currentAlpha + num4 * 0.25f); float num6 = Mathf.Lerp(1f, 0.7f, Mathf.Clamp01(num5 / 0.7f)); float num7 = ((!(num5 <= 0.7f)) ? Mathf.Lerp(1f, 0.714f, (num5 - 0.7f) / 0.3f) : 1f); _vignetteImg.color = new Color(num6, num6, num6, 1f); if ((Object)(object)_offsetImg != (Object)null) { _offsetImg.color = new Color(num7, num7, num7, 1f); } if ((Object)(object)_vignettePulseImg != (Object)null) { float num8 = (0.5f + num4 * 0.4f) * _currentAlpha; ((Graphic)_vignettePulseImg).color = new Color(0f, 0f, 0f, num8); } if (_fovCaptured) { Camera mainCamera2 = GetMainCamera(); if ((Object)(object)mainCamera2 != (Object)null) { _currentFov = Mathf.Lerp(_currentFov, _targetFov, unscaledDeltaTime * 4f); mainCamera2.fieldOfView = _currentFov; } } if (_isActive && Time.time - _lastBeatTime >= num2) { _lastBeatTime = Time.time; if ((Object)(object)_heartbeat != (Object)null && (Object)(object)_heartbeatClip != (Object)null) { _heartbeat.PlayOneShot(_heartbeatClip, 1f); ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)($"[DarkVision][v18] ♥ 박동 #{_beatCount + 1} 재생 — interval={num2:F2}s, " + $"strength={_currentAlpha:F2}, FOV={_currentFov:F1}/{_originalFov:F1}")); } } _beatCount++; } if (!_isActive && _currentAlpha < 0.01f && _fovCaptured && Mathf.Abs(_currentFov - _originalFov) < 0.5f) { _currentAlpha = 0f; _vignetteImg.color = new Color(1f, 1f, 1f, 1f); if ((Object)(object)_offsetImg != (Object)null) { _offsetImg.color = new Color(1f, 1f, 1f, 1f); } if ((Object)(object)_vignettePulseImg != (Object)null) { ((Graphic)_vignettePulseImg).color = new Color(0f, 0f, 0f, 0f); } Camera mainCamera3 = GetMainCamera(); if ((Object)(object)mainCamera3 != (Object)null) { mainCamera3.fieldOfView = _originalFov; } } } private void OnDestroy() { try { if (_fovCaptured) { Camera mainCamera = GetMainCamera(); if ((Object)(object)mainCamera != (Object)null) { mainCamera.fieldOfView = _originalFov; } } } catch { } } } private const float DURATION_SEC = 90f; private const float VIGNETTE_ALPHA_BASE = 0.7f; private const float VIGNETTE_PULSE_AMP = 0.25f; private const float FOV_SHRINK_RATIO = 0.6f; private const float FOV_LERP_SPEED = 4f; private const float ALPHA_LERP_SPEED = 0.5f; private const float BEAT_INTERVAL_START = 3f; private const float BEAT_INTERVAL_MIN = 0.9f; private const float BEAT_INTERVAL_STEP = 0.3f; private const float HEARTBEAT_VOLUME = 1f; private const float HEARTBEAT_GAIN_DB = 20f; private const float HEARTBEAT_LP_CUTOFF_HZ = 200f; private static GameObject _runnerGo; private static DarkVisionRunner _runner; private static float _activateTime; private static bool _isActive; public static void OnTargetChanged(int targetViewID, Scoutmaster sm) { try { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)((MonoBehaviourPun)localCharacter).photonView == (Object)null) { return; } if (targetViewID != -1 && targetViewID == ((MonoBehaviourPun)localCharacter).photonView.ViewID) { Activate(sm); } else if (_isActive && Time.time - _activateTime < 90f) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[DarkVision][v5] OnTargetChanged 다른 actor — 활성 유지 (경과 {Time.time - _activateTime:F1}/{90f}s)"); } } else { Deactivate(); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[DarkVision] OnTargetChanged 예외: " + ex.Message)); } } } private static void Activate(Scoutmaster sm) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown _activateTime = Time.time; _isActive = true; if ((Object)(object)_runnerGo == (Object)null) { _runnerGo = new GameObject("FlagSurvival_DarkVisionRunner"); Object.DontDestroyOnLoad((Object)(object)_runnerGo); _runner = _runnerGo.AddComponent(); } _runner.OnActivated(sm); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)($"[DarkVision][v5] ★ 본인 PC 타겟 — {90f}초 강제 유지 시작 ★ " + $"(알파 base={0.7f}, 펄스 ±{0.25f}, FOV ratio={0.6f}, 심박 {20f}dB)")); } } private static void Deactivate() { if (_isActive) { _isActive = false; if ((Object)(object)_runner != (Object)null) { _runner.OnDeactivated(); } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[DarkVision][v1] 효과 비활성 (타겟 해제 또는 다른 사람 타겟)"); } } } public static bool IsActive() { return _isActive; } public static float ActivateTime() { return _activateTime; } public static Camera GetMainCamera() { try { if ((Object)(object)MainCamera.instance == (Object)null) { return null; } return ((Component)MainCamera.instance).GetComponent(); } catch { return null; } } } [HarmonyPatch(typeof(Scoutmaster), "RPCA_SetCurrentTarget")] public static class Patch_Scoutmaster_RPCA_SetCurrentTarget_DarkVision { [HarmonyPostfix] public static void Postfix(Scoutmaster __instance, int targetViewID, float forceForTime) { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { FlagScoutMasterDarkVision.OnTargetChanged(targetViewID, __instance); } } } public static class FlagScoutMasterPenalty { private const float FORCED_CHASE_TIME = 90f; private static int ComputeStarCount(int pct) { if (pct >= 100) { return 3; } if (pct >= 67) { return 2; } if (pct >= 34) { return 1; } return 0; } private static int FindLowestPctActor(Dictionary playerPcts) { if (playerPcts == null || playerPcts.Count == 0) { return -1; } int num = -1; int num2 = int.MaxValue; foreach (KeyValuePair playerPct in playerPcts) { if (playerPct.Value < num2 || (playerPct.Value == num2 && (num < 0 || playerPct.Key < num))) { num2 = playerPct.Value; num = playerPct.Key; } } return num; } public static void OnBiomeBackup(int segmentIndex, string biomeName) { //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) try { if (FlagSurvivalNetwork.CurrentMultiplayerMode == FlagSurvivalNetwork.MultiplayerMode.PvP || !PhotonNetwork.IsMasterClient) { return; } IReadOnlyList allBiomeStats = FlagSurvivalMulti.GetAllBiomeStats(); if (allBiomeStats == null || allBiomeStats.Count == 0) { return; } FlagSurvivalMulti.BiomeStats biomeStats = allBiomeStats[allBiomeStats.Count - 1]; if (biomeStats.segmentIndex != segmentIndex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[StarPenalty][v1] 마지막 snap segmentIndex 불일치 ({biomeStats.segmentIndex} vs {segmentIndex}) — skip"); } return; } int num = ComputeStarCount(biomeStats.pctAtBackup); if (num >= 3) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[StarPenalty][v3] {biomeName} 클리어 별 {num}개 ({biomeStats.pctAtBackup}%) — 페널티 X (★★★)"); } return; } int num2 = FindLowestPctActor(biomeStats.playerPctsAtBackup); if (num2 < 0) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogWarning((object)$"[StarPenalty][v1] {biomeName} 별 {num}개 페널티 발동 시도 — 최하위 actor 없음, skip"); } return; } Character val = null; try { List allCharacters = Character.AllCharacters; if (allCharacters != null) { foreach (Character item in allCharacters) { if (!((Object)(object)item == (Object)null) && !((Object)(object)((MonoBehaviourPun)item).photonView == (Object)null) && ((MonoBehaviourPun)item).photonView.Owner != null && ((MonoBehaviourPun)item).photonView.Owner.ActorNumber == num2) { val = item; break; } } } } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[StarPenalty][v1] Character 검색 예외: " + ex.Message)); } } if ((Object)(object)val == (Object)null) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)$"[StarPenalty][v1] actor={num2} Character 못 찾음 — skip"); } return; } Scoutmaster val2 = default(Scoutmaster); if (!Scoutmaster.GetPrimaryScoutmaster(ref val2)) { ScoutmasterSpawner val3 = Object.FindObjectOfType(); Vector3 val4 = ((!((Object)(object)val3 != (Object)null) || !((Object)(object)((Component)val3).transform != (Object)null)) ? (((Component)val).transform.position + Vector3.up * 10f) : ((Component)val3).transform.position); GameObject val5; try { val5 = PhotonNetwork.InstantiateRoomObject("Character_Scoutmaster", val4, Quaternion.identity, (byte)0, (object[])null); } catch (Exception ex2) { ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogError((object)("[StarPenalty][v2] InstantiateRoomObject 예외: " + ex2.Message)); } return; } if ((Object)(object)val5 == (Object)null) { ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogError((object)"[StarPenalty][v2] InstantiateRoomObject가 null 반환 — 'Character_Scoutmaster' 프리팹 등록 안 됨?"); } return; } val2 = val5.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val5.GetComponentInChildren(); } if ((Object)(object)val2 == (Object)null) { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogError((object)"[StarPenalty][v2] spawn된 GameObject에서 Scoutmaster 컴포넌트 못 찾음"); } return; } ManualLogSource log9 = FlagSurvivalPlugin.Log; if (log9 != null) { log9.LogWarning((object)$"[StarPenalty][v2] 스카우트 마스터 강제 spawn ★ pos=({val4.x:F1},{val4.y:F1},{val4.z:F1})"); } } int num3 = (((Object)(object)((MonoBehaviourPun)val).photonView != (Object)null) ? ((MonoBehaviourPun)val).photonView.ViewID : (-1)); if (num3 < 0) { ManualLogSource log10 = FlagSurvivalPlugin.Log; if (log10 != null) { log10.LogWarning((object)"[StarPenalty][v1] target PhotonView ViewID 무효 — skip"); } return; } PhotonView component = ((Component)val2).GetComponent(); if ((Object)(object)component == (Object)null) { ManualLogSource log11 = FlagSurvivalPlugin.Log; if (log11 != null) { log11.LogError((object)"[StarPenalty][v1] Scoutmaster PhotonView 없음"); } return; } component.RPC("RPCA_SetCurrentTarget", (RpcTarget)0, new object[2] { num3, 90f }); ManualLogSource log12 = FlagSurvivalPlugin.Log; if (log12 != null) { log12.LogWarning((object)($"[StarPenalty][v1] 페널티 발동 ★ — biome={biomeName}({segmentIndex}), pct={biomeStats.pctAtBackup}%, " + $"stars={num}, target actor={num2} ({((MonoBehaviourPun)val).photonView.Owner.NickName}), forceTime={90f}s")); } } catch (Exception ex3) { ManualLogSource log13 = FlagSurvivalPlugin.Log; if (log13 != null) { log13.LogError((object)("[StarPenalty][v1] OnBiomeBackup 예외: " + ex3.Message + "\n" + ex3.StackTrace)); } } } } [HarmonyPatch(typeof(FlagSurvivalMulti), "BackupBiomeStats")] public static class Patch_BackupBiomeStats_StarPenalty { [HarmonyPostfix] public static void Postfix(int segmentIndex, string biomeName) { FlagScoutMasterPenalty.OnBiomeBackup(segmentIndex, biomeName); } } public static class FlagSegmentScoring { public const float FLAG_POINT_BASE = 1f; public const float FLAG_GAP_EXPONENT = 0.7f; public const float FLAG_GAP_COEFFICIENT = 0.12f; public static readonly int[] CAMPFIRE_RANK_POINTS = new int[6] { 100, 92, 84, 76, 68, 60 }; public const int CAMPFIRE_ROUND_BONUS = 10; public const float CAMPFIRE_REACH_RADIUS_METERS = 20f; public static readonly Vector3 PEAK_SUMMIT_POSITION = new Vector3(19.5f, 1228.7f, 2242.5f); public const int FLAG_POINT_VALUE = 1; public const int SCORING_SEGMENT_MIN = 0; public const int SCORING_SEGMENT_MAX = 5; private static readonly Dictionary> _segmentRanks = new Dictionary>(); private static readonly Dictionary _flagPointsCurrent = new Dictionary(); private static readonly List> _flagPointsBackup = new List>(); public const int MAX_PICKUPS_PER_ACTOR_PER_POSITION = 2; private static readonly Dictionary<(int x, int y, int z), Dictionary> _consumedActorsByPos = new Dictionary<(int, int, int), Dictionary>(); private static float _lastHostUpdateTime = -1f; private const float HOST_UPDATE_INTERVAL = 0.5f; private static readonly Dictionary> _segmentArrivalOrder = new Dictionary>(); private static readonly Dictionary> _segmentDeadDistance = new Dictionary>(); private static readonly Dictionary _segmentScored = new Dictionary(); private static readonly Dictionary _lastAliveDistance = new Dictionary(); public static readonly Dictionary _lastAlivePos = new Dictionary(); private const float DEATH_COORD_Y_THRESHOLD = 3000f; private const float DEATH_COORD_Z_THRESHOLD = -3000f; public static int GetCampfirePoints(int actor) { int num = 0; foreach (KeyValuePair> segmentRank in _segmentRanks) { int key = segmentRank.Key; if (segmentRank.Value.TryGetValue(actor, out var value) && value >= 1 && value <= CAMPFIRE_RANK_POINTS.Length) { int num2 = CAMPFIRE_RANK_POINTS[value - 1]; int num3 = key * 10; num += num2 + num3; } } return num; } public static float GetLeaderTotalScore() { float num = 0f; Dictionary flagCounts = FlagSurvivalMulti.GetFlagCounts(); if (flagCounts == null) { return 0f; } foreach (int key in flagCounts.Keys) { float totalScoreFloat = GetTotalScoreFloat(key); if (totalScoreFloat > num) { num = totalScoreFloat; } } foreach (Dictionary value in _segmentRanks.Values) { foreach (int key2 in value.Keys) { float totalScoreFloat2 = GetTotalScoreFloat(key2); if (totalScoreFloat2 > num) { num = totalScoreFloat2; } } } return num; } public static float GetFlagPointsForActor(int actor) { float leaderTotalScore = GetLeaderTotalScore(); float totalScoreFloat = GetTotalScoreFloat(actor); float num = leaderTotalScore - totalScoreFloat; if (num <= 0f) { return 1f; } return 1f + Mathf.Pow(num, 0.7f) * 0.12f; } public static void OnFlagConsumed_AddPoints(int actor) { try { float flagPointsForActor = GetFlagPointsForActor(actor); _flagPointsCurrent.TryGetValue(actor, out var value); _flagPointsCurrent[actor] = value + flagPointsForActor; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[v172.s2] 깃발 점수 +{flagPointsForActor:F2} (actor={actor}, 누적={_flagPointsCurrent[actor]:F2})"); } FlagSurvivalNetwork.BroadcastFlagPoints(flagPointsForActor); } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v172.s2] OnFlagConsumed_AddPoints 실패: " + ex.Message)); } } } public static void AddFlagPointsRemote(int actor, float pts) { try { _flagPointsCurrent.TryGetValue(actor, out var value); _flagPointsCurrent[actor] = value + pts; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[v172.s2.sync1] 원격 깃발 점수 +{pts:F2} (actor={actor}, 누적={_flagPointsCurrent[actor]:F2})"); } } catch (Exception ex) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogError((object)("[v172.s2.sync1] AddFlagPointsRemote 실패: " + ex.Message)); } } } public static bool IsActorPickupLimitReached(int actor, Vector3 pos) { //IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references) (int, int, int) key = (Mathf.RoundToInt(pos.x), Mathf.RoundToInt(pos.y), Mathf.RoundToInt(pos.z)); if (!_consumedActorsByPos.TryGetValue(key, out var value)) { return false; } if (!value.TryGetValue(actor, out var value2)) { return false; } return value2 >= 2; } public static int GetActorPickupCount(int actor, Vector3 pos) { //IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references) (int, int, int) key = (Mathf.RoundToInt(pos.x), Mathf.RoundToInt(pos.y), Mathf.RoundToInt(pos.z)); if (!_consumedActorsByPos.TryGetValue(key, out var value)) { return 0; } value.TryGetValue(actor, out var value2); return value2; } public static void RecordActorPickup(int actor, Vector3 pos) { //IL_0002: 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_0018: Unknown result type (might be due to invalid IL or missing references) (int, int, int) key = (Mathf.RoundToInt(pos.x), Mathf.RoundToInt(pos.y), Mathf.RoundToInt(pos.z)); if (!_consumedActorsByPos.TryGetValue(key, out var value)) { value = new Dictionary(); _consumedActorsByPos[key] = value; } value.TryGetValue(actor, out var value2); value[actor] = value2 + 1; } public static bool OnFlagConsumed_AddPointsIfFirst(int actor, Vector3 pos) { //IL_0001: 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) int actorPickupCount = GetActorPickupCount(actor, pos); RecordActorPickup(actor, pos); if (actorPickupCount == 0) { OnFlagConsumed_AddPoints(actor); return true; } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[v172.s2] 같은 좌표 {actorPickupCount + 1}번째 먹기 — 점수 X (회복만, actor={actor})"); } return false; } public static int GetFlagPoints(int actor) { return Mathf.RoundToInt(GetFlagPointsFloat(actor)); } public static float GetFlagPointsFloat(int actor) { try { float num = 0f; foreach (Dictionary item in _flagPointsBackup) { if (item != null && item.TryGetValue(actor, out var value)) { num += value; } } if (_flagPointsCurrent.TryGetValue(actor, out var value2)) { num += value2; } return num; } catch { return 0f; } } public static void BackupCurrentFlagPoints() { if (_flagPointsCurrent.Count != 0) { Dictionary dictionary = new Dictionary(_flagPointsCurrent); _flagPointsBackup.Add(dictionary); _flagPointsCurrent.Clear(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[v172.s2] 깃발 점수 백업 완료 ({dictionary.Count}명, 누적 {_flagPointsBackup.Count}개 세그먼트)"); } } } public static int GetTotalScore(int actor) { return GetCampfirePoints(actor) + GetFlagPoints(actor); } public static float GetTotalScoreFloat(int actor) { return (float)GetCampfirePoints(actor) + GetFlagPointsFloat(actor); } public static int GetSegmentRank(int seg, int actor) { if (_segmentRanks.TryGetValue(seg, out var value) && value.TryGetValue(actor, out var value2)) { return value2; } return 0; } public static int GetSegmentReachedCount(int seg) { if (_segmentRanks.TryGetValue(seg, out var value)) { return value.Count; } return 0; } public static void SetSegmentRank(int seg, int actor, int rank) { if (seg < 0 || seg > 5) { return; } if (!_segmentRanks.TryGetValue(seg, out var value)) { value = new Dictionary(); _segmentRanks[seg] = value; } if (!value.ContainsKey(actor)) { value[actor] = rank; ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[Scoring][v172.s1] seg={seg} actor={actor} → rank={rank} (도달자 {value.Count}명)"); } } } public static void ResetAllScores() { int num = 0; foreach (Dictionary value in _segmentRanks.Values) { num += value.Count; } _segmentRanks.Clear(); _lastHostUpdateTime = -1f; int count = _flagPointsCurrent.Count; int count2 = _flagPointsBackup.Count; int count3 = _consumedActorsByPos.Count; _flagPointsCurrent.Clear(); _flagPointsBackup.Clear(); _consumedActorsByPos.Clear(); _segmentArrivalOrder.Clear(); _segmentDeadDistance.Clear(); _segmentScored.Clear(); _lastAliveDistance.Clear(); _lastAlivePos.Clear(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)($"[Scoring][v172.s1] 모든 점수 리셋 (이전 등수 {num}건 클리어) | " + $"[v172.s2] 깃발점수 현재={count}, 백업={count2}, 좌표제한={count3} 클리어 | " + "[v172.s3] 진입순서/사망거리/지급완료 클리어")); } } public static void HostUpdate() { //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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 (FlagSurvivalNetwork.IsInMultiplayerRoom() && !FlagSurvivalNetwork.IsHost()) { return; } float realtimeSinceStartup = Time.realtimeSinceStartup; if (realtimeSinceStartup < _lastHostUpdateTime + 0.5f) { return; } _lastHostUpdateTime = realtimeSinceStartup; try { int currentScoringSegment = GetCurrentScoringSegment(); if (currentScoringSegment < 0 || currentScoringSegment > 5 || (_segmentScored.TryGetValue(currentScoringSegment, out var value) && value)) { return; } Vector3 campfirePositionForSegment = GetCampfirePositionForSegment(currentScoringSegment); List allCharacters = Character.AllCharacters; if (allCharacters == null) { return; } if (!_segmentArrivalOrder.ContainsKey(currentScoringSegment)) { _segmentArrivalOrder[currentScoringSegment] = new List(); } if (!_segmentDeadDistance.ContainsKey(currentScoringSegment)) { _segmentDeadDistance[currentScoringSegment] = new Dictionary(); } List list = _segmentArrivalOrder[currentScoringSegment]; Dictionary dictionary = _segmentDeadDistance[currentScoringSegment]; int num = 0; int num2 = 0; foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null || (Object)(object)((MonoBehaviourPun)item).photonView == (Object)null || ((MonoBehaviourPun)item).photonView.Owner == null) { continue; } int actorNumber = ((MonoBehaviourPun)item).photonView.Owner.ActorNumber; num++; if (list.Contains(actorNumber) || dictionary.ContainsKey(actorNumber)) { num2++; continue; } bool flag = false; try { if ((Object)(object)item.data != (Object)null && item.data.dead) { flag = true; } } catch { } Vector3 center = item.Center; if (center.y > 3000f && center.z < -3000f) { flag = true; } if (flag) { float value2; float num4 = (dictionary[actorNumber] = (_lastAliveDistance.TryGetValue(actorNumber, out value2) ? value2 : (Vector3.Distance(campfirePositionForSegment, center) * CharacterStats.unitsToMeters))); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[Scoring][v172.s3] seg={currentScoringSegment} actor={actorNumber} 사망 감지 — 마지막 거리 {num4:F1}m"); } num2++; continue; } float num5 = Vector3.Distance(campfirePositionForSegment, center) * CharacterStats.unitsToMeters; _lastAliveDistance[actorNumber] = num5; _lastAlivePos[actorNumber] = center; if (num5 <= 20f) { list.Add(actorNumber); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[Scoring][v172.s3] seg={currentScoringSegment} actor={actorNumber} 모닥불 진입 — 도착순서 {list.Count}번째 (점수 미지급, 전원 결정 후 일괄 지급)"); } num2++; } } if (num > 0 && num2 >= num) { FinalizeSegmentScoring(currentScoringSegment, list, dictionary); } } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[Scoring][v172.s3] HostUpdate 예외: " + ex.Message)); } } } private static void FinalizeSegmentScoring(int seg, List arrivalList, Dictionary deadDistMap) { try { int num = 1; foreach (int arrival in arrivalList) { int num2 = Mathf.Min(num, CAMPFIRE_RANK_POINTS.Length); SetSegmentRank(seg, arrival, num2); if (FlagSurvivalNetwork.IsInMultiplayerRoom()) { FlagSurvivalNetwork.BroadcastSegmentRank(seg, arrival, num2); } ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[Scoring][v172.s3] ★ seg={seg} actor={arrival} 진입자 {num2}등 ({CAMPFIRE_RANK_POINTS[num2 - 1]}점) ★"); } num++; } List> list = new List>(deadDistMap); list.Sort((KeyValuePair a, KeyValuePair b) => a.Value.CompareTo(b.Value)); foreach (KeyValuePair item in list) { int key = item.Key; float value = item.Value; int num3 = Mathf.Min(num, CAMPFIRE_RANK_POINTS.Length); SetSegmentRank(seg, key, num3); if (FlagSurvivalNetwork.IsInMultiplayerRoom()) { FlagSurvivalNetwork.BroadcastSegmentRank(seg, key, num3); } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)$"[Scoring][v172.s3] ★ seg={seg} actor={key} 사망자 {num3}등 (거리 {value:F1}m, {CAMPFIRE_RANK_POINTS[num3 - 1]}점) ★"); } num++; } _segmentScored[seg] = true; } catch (Exception ex) { ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogError((object)("[Scoring][v172.s3] FinalizeSegmentScoring 예외: " + ex.Message)); } } } private static int GetCurrentScoringSegment() { try { return FlagSurvivalMulti.GetCurrentSegmentIndex(); } catch { return -1; } } private static Vector3 GetCampfirePositionForSegment(int seg) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (seg == 5) { return PEAK_SUMMIT_POSITION; } try { GameObject campfireRoot = MapHandler.GetCampfireRoot(seg); if ((Object)(object)campfireRoot != (Object)null) { Campfire componentInChildren = campfireRoot.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)((Component)componentInChildren).transform != (Object)null) { return ((Component)componentInChildren).transform.position; } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogWarning((object)$"[Scoring][v172.s1.b1] GetCampfireRoot({seg}) 예외: {ex.Message}"); } } try { Campfire currentCampfire = MapHandler.CurrentCampfire; if ((Object)(object)currentCampfire != (Object)null && (Object)(object)((Component)currentCampfire).transform != (Object)null) { return ((Component)currentCampfire).transform.position; } } catch { } return PEAK_SUMMIT_POSITION; } public static List<(int actor, int total, int campfire, int flag)> GetAllScoresDiag() { List<(int, int, int, int)> list = new List<(int, int, int, int)>(); try { Player[] playerList = PhotonNetwork.PlayerList; if (playerList == null) { return list; } Player[] array = playerList; foreach (Player val in array) { if (val != null) { int actorNumber = val.ActorNumber; int campfirePoints = GetCampfirePoints(actorNumber); int flagPoints = GetFlagPoints(actorNumber); list.Add((actorNumber, campfirePoints + flagPoints, campfirePoints, flagPoints)); } } } catch { } return list; } } [HarmonyPatch(typeof(PeakHandler), "SetCosmetics")] public static class Patch_SetCosmetics_FilterToWinners { [HarmonyPrefix] public static bool Prefix(ref List characters) { if (FlagSurvivalNetwork.CurrentMultiplayerMode != FlagSurvivalNetwork.MultiplayerMode.PvP) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)"[SetCosmetics] PvE 모드 → PEAK 자연 흐름"); } return true; } if (characters == null) { ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogWarning((object)"[SetCosmetics] characters null — PEAK 자연 흐름"); } return true; } try { List winnerActorNumbersHostAuthoritative = FlagWinnerCalculator.GetWinnerActorNumbersHostAuthoritative(); int[] array = ((winnerActorNumbersHostAuthoritative != null) ? winnerActorNumbersHostAuthoritative.ToArray() : new int[0]); FlagWinnerCalculator.SetCachedWinners(array); if (FlagSurvivalNetwork.IsHost() && FlagSurvivalNetwork.IsInMultiplayerRoom()) { FlagSurvivalNetwork.BroadcastWinnerList(array); } ManualLogSource log3 = FlagSurvivalPlugin.Log; if (log3 != null) { log3.LogInfo((object)string.Format("[SetCosmetics][v117.b] winner 자체 재산출: actors=[{0}] (count={1}, IsHost={2})", string.Join(",", array), array.Length, FlagSurvivalNetwork.IsHost())); } } catch (Exception ex) { ManualLogSource log4 = FlagSurvivalPlugin.Log; if (log4 != null) { log4.LogError((object)("[SetCosmetics][v117.b] winner 재산출 예외: " + ex.Message)); } } HashSet winnerActorSet = FlagWinnerCalculator.GetWinnerActorSet(); if (winnerActorSet == null || winnerActorSet.Count == 0) { ManualLogSource log5 = FlagSurvivalPlugin.Log; if (log5 != null) { log5.LogWarning((object)"[SetCosmetics] 1등 actor 0명 — PEAK 호출 SKIP (헬기 안 0명, 패자 검증 모드)"); } characters = new List(); return false; } List list = new List(); foreach (Character character in characters) { if (!((Object)(object)character == (Object)null) && !((Object)(object)((MonoBehaviourPun)character).photonView == (Object)null) && ((MonoBehaviourPun)character).photonView.Owner != null) { int actorNumber = ((MonoBehaviourPun)character).photonView.Owner.ActorNumber; if (winnerActorSet.Contains(actorNumber)) { list.Add(character); } } } list.Sort((Character c1, Character c2) => ((MonoBehaviourPun)c1).photonView.ViewID.CompareTo(((MonoBehaviourPun)c2).photonView.ViewID)); if (list.Count > 4) { list.RemoveRange(4, list.Count - 4); } ManualLogSource log6 = FlagSurvivalPlugin.Log; if (log6 != null) { log6.LogWarning((object)$"[SetCosmetics] ★ PvP 1등 필터링: {characters.Count}명 → {list.Count}명 (상위 4명) ★"); } for (int i = 0; i < list.Count; i++) { Character val = list[i]; int num = -1; bool flag = false; try { num = ((((MonoBehaviourPun)val).photonView.Owner != null) ? ((MonoBehaviourPun)val).photonView.Owner.ActorNumber : (-1)); flag = val.refs != null && (Object)(object)val.refs.stats != (Object)null && val.refs.stats.won; } catch { } ManualLogSource log7 = FlagSurvivalPlugin.Log; if (log7 != null) { log7.LogInfo((object)$"[SetCosmetics] slot[{i}] ViewID={((MonoBehaviourPun)val).photonView.ViewID} actor={num} won={flag}"); } } if (list.Count == 0) { ManualLogSource log8 = FlagSurvivalPlugin.Log; if (log8 != null) { log8.LogError((object)"[SetCosmetics] 필터링 후 0명 — PEAK SetCosmetics 호출 SKIP (NullRef 방지)"); } return false; } characters = list; return true; } } public class FlagSettingsMenuWindow : MenuWindow { public override bool openOnStart => false; public override bool closeOnUICancel => true; } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.sol.peak.flagsurvival.settingsui", "FlagSurvival Settings UI", "0.18.0")] public class FlagSettingsUIPlugin : BaseUnityPlugin { private class TabItemInfo { public GameObject containerGo; public RectTransform containerRt; public float collapsedHeight; public float expandedHeight; public float currentHeight; public float targetHeight; public bool isExpanded; public bool canExpand; public GameObject expandedContent; public TextMeshProUGUI arrowText; public Action OnToggleAction; } private class TabInfo { public string label; public RectTransform headerRt; public Image headerBg; public TextMeshProUGUI headerText; public TextMeshProUGUI arrowText; public GameObject contentGo; public RectTransform contentRt; public float contentTargetHeight; public float currentHeight; public bool isExpanded; public List items = new List(); } private class LocText { public TextMeshProUGUI tmp; public string ko; public string en; } public enum Lang { Ko, En } private class SettingsUIRunner : MonoBehaviour { private GameObject _canvasGo; private GameObject _panelGo; private FlagSettingsMenuWindow _menuWindow; private static MethodInfo _menuWindowOpenMethod; private static MethodInfo _menuWindowCloseMethod; private RectTransform _tabsContainerRt; private TMP_FontAsset _font; private List _tabs = new List(); private TabInfo _currentBuildingTab; private List _locTexts = new List(); private List _refreshActions = new List(); private bool _visible; private const float HEADER_HEIGHT = 40f; private const float TAB_GAP = 4f; private const float ANIM_SPEED = 12f; private const float CONTENT_INDENT = 20f; private const float ITEM_LABEL_HEIGHT = 22f; private const float ITEM_CONTROL_HEIGHT = 32f; private const float ITEM_DESC_HEIGHT = 36f; private const float ITEM_GAP = 6f; private const float ITEM_CTRL_DESC_GAP = 6f; private const float ITEM_PADDING_TOP = 6f; private const float ITEM_PADDING_BOTTOM = 4f; private const float ACC_OPTION_HEIGHT = 26f; private const float ACC_OPTION_GAP = 2f; private void Awake() { if (FlagSurvivalPlugin.CfgHudLanguage != null) { FlagSurvivalPlugin.CfgHudLanguage.SettingChanged += OnHudLanguageChanged; } } private void OnDestroy() { if (FlagSurvivalPlugin.CfgHudLanguage != null) { FlagSurvivalPlugin.CfgHudLanguage.SettingChanged -= OnHudLanguageChanged; } } private void OnHudLanguageChanged(object s, EventArgs e) { RefreshAllLocTexts(); RunRefreshActions(); } private void Update() { Keyboard current = Keyboard.current; if (current == null) { return; } if (((ButtonControl)current.backquoteKey).wasPressedThisFrame) { _visible = !_visible; if (_visible) { OpenPanel(); } else { ClosePanel(); } } if (_visible && (Object)(object)_panelGo != (Object)null && _panelGo.activeSelf) { AnimateTabs(); AnimateItems(); } } private void OpenPanel() { EnsureUIBuilt(); if ((Object)(object)_panelGo == (Object)null) { return; } bool flag = false; try { if ((Object)(object)_menuWindow != (Object)null) { if (_menuWindowOpenMethod == null) { _menuWindowOpenMethod = typeof(MenuWindow).GetMethod("Open", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_menuWindowOpenMethod != null) { _menuWindowOpenMethod.Invoke(_menuWindow, null); flag = true; } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[SettingsUI][v172.tilde1] Open reflection 실패: " + ex.Message)); } } if (!flag) { _panelGo.SetActive(true); if ((Object)(object)_menuWindow != (Object)null && !MenuWindow.AllActiveWindows.Contains((MenuWindow)(object)_menuWindow)) { MenuWindow.AllActiveWindows.Add((MenuWindow)(object)_menuWindow); } } RefreshAllDisplays(); ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[SettingsUI] 패널 OPEN — AllActiveWindows count={MenuWindow.AllActiveWindows.Count}, reflection={flag}"); } } private void ClosePanel() { bool flag = false; try { if ((Object)(object)_menuWindow != (Object)null) { if (_menuWindowCloseMethod == null) { _menuWindowCloseMethod = typeof(MenuWindow).GetMethod("Close", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (_menuWindowCloseMethod != null) { _menuWindowCloseMethod.Invoke(_menuWindow, null); flag = true; } } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[SettingsUI][v172.tilde1] Close reflection 실패: " + ex.Message)); } } if (!flag) { if ((Object)(object)_panelGo != (Object)null) { _panelGo.SetActive(false); } if ((Object)(object)_menuWindow != (Object)null) { MenuWindow.AllActiveWindows.Remove((MenuWindow)(object)_menuWindow); } } ManualLogSource log2 = FlagSurvivalPlugin.Log; if (log2 != null) { log2.LogInfo((object)$"[SettingsUI] 패널 CLOSE — AllActiveWindows count={MenuWindow.AllActiveWindows.Count}, reflection={flag}"); } } private Lang GetCurrentLang() { if (FlagSurvivalPlugin.CfgHudLanguage == null) { return Lang.Ko; } if (FlagSurvivalPlugin.CfgHudLanguage.Value != FlagSurvivalPlugin.HUD언어.English) { return Lang.Ko; } return Lang.En; } private void RefreshAllLocTexts() { Lang currentLang = GetCurrentLang(); foreach (LocText locText in _locTexts) { if (!((Object)(object)locText.tmp == (Object)null)) { ((TMP_Text)locText.tmp).text = ((currentLang == Lang.En) ? locText.en : locText.ko); } } } private void RegisterLocText(TextMeshProUGUI tmp, string ko, string en) { if (!((Object)(object)tmp == (Object)null)) { _locTexts.Add(new LocText { tmp = tmp, ko = ko, en = en }); ((TMP_Text)tmp).text = ((GetCurrentLang() == Lang.En) ? en : ko); } } private void RunRefreshActions() { foreach (Action refreshAction in _refreshActions) { try { refreshAction?.Invoke(); } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[SettingsUI] refreshAction 예외: " + ex.Message)); } } } } private string FormatEnumValue(TEnum value) where TEnum : Enum { string text = value.ToString(); if (string.IsNullOrEmpty(text)) { return text; } if (text.Length >= 6 && text[0] == '_' && char.IsDigit(text[1])) { string text2 = TryFormatNumericEnum(text); if (text2 != null) { return text2; } } if (text.IndexOf('_') < 0) { return text; } string[] array = text.Split('_'); List list = new List(); List list2 = new List(); string[] array2 = array; foreach (string text3 in array2) { if (!string.IsNullOrEmpty(text3)) { if (IsKoreanChar(text3[0])) { list.Add(text3); } else { list2.Add(text3); } } } string text4 = string.Join(" ", list); string text5 = string.Join(" ", list2); if (GetCurrentLang() == Lang.En) { if (text5.Length <= 0) { if (text4.Length <= 0) { return text; } return text4; } return text5; } if (text4.Length <= 0) { if (text5.Length <= 0) { return text; } return text5; } return text4; } private string TryFormatNumericEnum(string name) { string[] array = name.Split('_'); if (array.Length < 2 || string.IsNullOrEmpty(array[1])) { return null; } if (!int.TryParse(array[1], out var result)) { return null; } string text = ((float)result / 100000f).ToString("0.####"); if (array.Length >= 3 && array[2] == "Default") { if (GetCurrentLang() != Lang.En) { return text + " (기본)"; } return text + " (Default)"; } return text; } private static bool IsKoreanChar(char c) { if ((c < '가' || c > '힣') && (c < 'ᄀ' || c > 'ᇿ')) { if (c >= '\u3130') { return c <= '\u318f'; } return false; } return true; } private (string ko, string en) GetDesc(ConfigEntryBase cfg, ConfigEntry descKoCfg, ConfigEntry descEnCfg) { if (descKoCfg != null && descEnCfg != null) { ConfigDefinition definition = ((ConfigEntryBase)descKoCfg).Definition; string text = StripArrow((definition != null) ? definition.Key : null); ConfigDefinition definition2 = ((ConfigEntryBase)descEnCfg).Definition; string text2 = StripArrow((definition2 != null) ? definition2.Key : null); if (!string.IsNullOrEmpty(text) || !string.IsNullOrEmpty(text2)) { return (text, text2); } } if (cfg != null && cfg.Description != null) { return ExtractFirstKoEn(cfg.Description.Description); } return ("", ""); } private static string StripArrow(string s) { if (string.IsNullOrEmpty(s)) { return ""; } if (s.StartsWith("↓.")) { s = s.Substring(2); } else if (s.StartsWith("↓")) { s = s.Substring(1); } return s.Trim(); } private static (string ko, string en) ExtractFirstKoEn(string desc) { if (string.IsNullOrEmpty(desc)) { return ("", ""); } string text = ""; string text2 = ""; string[] array = desc.Split('\n'); for (int i = 0; i < array.Length; i++) { string text3 = array[i].TrimStart(' ', '\t'); if (!string.IsNullOrEmpty(text3)) { char c = text3[0]; bool flag = ContainsKoreanChar(text3); if (string.IsNullOrEmpty(text) && flag) { text = text3.TrimEnd(); } else if (string.IsNullOrEmpty(text2) && !flag && c != ' ') { text2 = text3.TrimEnd(); } if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2)) { break; } } } return (text, text2); } private static bool ContainsKoreanChar(string s) { if (string.IsNullOrEmpty(s)) { return false; } for (int i = 0; i < s.Length; i++) { if (IsKoreanChar(s[i])) { return true; } } return false; } private void EnsureUIBuilt() { if (!((Object)(object)_canvasGo != (Object)null)) { BuildCanvasAndPanel(); BuildHeader(); BuildTabsContainer(); AddTab("멀티플레이", "Multiplayer", BuildTab_Multiplayer); AddTab("모드", "Mode", BuildTab_Mode); AddTab("그래픽", "Graphics", BuildTab_Graphics); AddTab("저주", "Curse", BuildTab_Curse); AddTab("깃발", "Flag", BuildTab_Flag); AddTab("초기화", "Reset", BuildTab_Reset); BuildFooter(); RelayoutTabs(); UpdateHeaderVisuals(); RefreshAllLocTexts(); RunRefreshActions(); ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogInfo((object)$"[SettingsUI] UI 빌드 완료 (탭 {_tabs.Count}개)"); } } } private void BuildCanvasAndPanel() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)EventSystem.current == (Object)null) { GameObject val = new GameObject("FlagSurvival_SettingsUI_EventSystem"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); val.AddComponent(); } } catch (Exception ex) { ManualLogSource log = FlagSurvivalPlugin.Log; if (log != null) { log.LogError((object)("[SettingsUI] EventSystem 생성 실패: " + ex.Message)); } } try { TextMeshProUGUI val2 = Object.FindObjectOfType(); if ((Object)(object)val2 != (Object)null) { _font = ((TMP_Text)val2).font; } } catch { } _canvasGo = new GameObject("FlagSurvival_SettingsUI_Canvas"); _canvasGo.transform.SetParent(((Component)this).transform, false); Canvas obj2 = _canvasGo.AddComponent(); obj2.renderMode = (RenderMode)0; obj2.sortingOrder = 5000; CanvasScaler obj3 = _canvasGo.AddComponent(); obj3.uiScaleMode = (ScaleMode)1; obj3.referenceResolution = new Vector2(1920f, 1080f); obj3.matchWidthOrHeight = 0.5f; _canvasGo.AddComponent(); _panelGo = MakeBox(_canvasGo.transform, "Panel", new Vector2(720f, 780f), new Color(0.08f, 0.08f, 0.1f, 0.95f)); RectTransform component = _panelGo.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.anchoredPosition = Vector2.zero; _panelGo.SetActive(false); _menuWindow = _panelGo.AddComponent(); } private void BuildHeader() { //IL_002e: 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) //IL_0058: 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_0081: 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) TextMeshProUGUI val = MakeText(_panelGo.transform, "", 28f, (FontStyles)0); RectTransform rectTransform = ((TMP_Text)val).rectTransform; rectTransform.anchorMin = new Vector2(0f, 1f); rectTransform.anchorMax = new Vector2(1f, 1f); rectTransform.pivot = new Vector2(0.5f, 1f); rectTransform.anchoredPosition = new Vector2(0f, -22f); rectTransform.sizeDelta = new Vector2(-40f, 35f); ((TMP_Text)val).alignment = (TextAlignmentOptions)514; ((Graphic)val).color = new Color(1f, 0.85f, 0.4f); RegisterLocText(val, "FlagSurvival 설정", "FlagSurvival Settings"); } private void BuildTabsContainer() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0053: 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_007d: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ScrollView", new Type[2] { typeof(RectTransform), typeof(Image) }); val.transform.SetParent(_panelGo.transform, false); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 0.5f); component.offsetMin = new Vector2(20f, 50f); component.offsetMax = new Vector2(-20f, -65f); ((Transform)component).localScale = Vector3.one; Image component2 = val.GetComponent(); ((Graphic)component2).color = new Color(0f, 0f, 0f, 0.001f); ((Graphic)component2).raycastTarget = true; ScrollRect val2 = val.AddComponent(); val2.vertical = true; val2.horizontal = false; val2.movementType = (MovementType)2; val2.scrollSensitivity = 30f; val2.inertia = false; GameObject val3 = new GameObject("Viewport", new Type[2] { typeof(RectTransform), typeof(RectMask2D) }); val3.transform.SetParent(val.transform, false); RectTransform component3 = val3.GetComponent(); component3.anchorMin = Vector2.zero; component3.anchorMax = Vector2.one; component3.offsetMin = Vector2.zero; component3.offsetMax = Vector2.zero; ((Transform)component3).localScale = Vector3.one; GameObject val4 = new GameObject("TabsContainer", new Type[1] { typeof(RectTransform) }); val4.transform.SetParent(val3.transform, false); _tabsContainerRt = val4.GetComponent(); _tabsContainerRt.anchorMin = new Vector2(0f, 1f); _tabsContainerRt.anchorMax = new Vector2(1f, 1f); _tabsContainerRt.pivot = new Vector2(0f, 1f); _tabsContainerRt.anchoredPosition = Vector2.zero; _tabsContainerRt.sizeDelta = new Vector2(0f, 600f); ((Transform)_tabsContainerRt).localScale = Vector3.one; ((Transform)_tabsContainerRt).localRotation = Quaternion.identity; val2.viewport = component3; val2.content = _tabsContainerRt; } private void BuildFooter() { //IL_002e: 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) //IL_0058: 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_0081: 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) TextMeshProUGUI val = MakeText(_panelGo.transform, "", 14f, (FontStyles)0); RectTransform rectTransform = ((TMP_Text)val).rectTransform; rectTransform.anchorMin = new Vector2(0f, 0f); rectTransform.anchorMax = new Vector2(1f, 0f); rectTransform.pivot = new Vector2(0.5f, 0f); rectTransform.anchoredPosition = new Vector2(0f, 18f); rectTransform.sizeDelta = new Vector2(-40f, 22f); ((TMP_Text)val).alignment = (TextAlignmentOptions)514; ((Graphic)val).color = new Color(0.5f, 0.5f, 0.5f); RegisterLocText(val, "` 키로 닫기", "Press ` to close"); } private void AddTab(string labelKo, string labelEn, Action contentBuilder) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) int count = _tabs.Count; GameObject val = new GameObject($"TabHeader_{count}_{labelKo}", new Type[3] { typeof(RectTransform), typeof(Image), typeof(Button) }); val.transform.SetParent((Transform)(object)_tabsContainerRt, false); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0f, 1f); ((Transform)component).localScale = Vector3.one; ((Transform)component).localRotation = Quaternion.identity; component.sizeDelta = new Vector2(0f, 40f); Image component2 = val.GetComponent(); Button component3 = val.GetComponent