using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using Photon.Pun;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("PhotonPingGUI")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PhotonPingGUI")]
[assembly: AssemblyTitle("PhotonPingGUI")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("PhotonPingGUI", "Photon Ping GUI", "1.0.0")]
public class PhotonPingGUI : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <InitGUI>d__31 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PhotonPingGUI <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <InitGUI>d__31(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 = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>4__this.CreateGUI();
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.UpdatePingLoop());
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 <UpdatePingLoop>d__35 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public PhotonPingGUI <>4__this;
private int <ping>5__1;
private float <actualTextWidth>5__2;
private int <maxPing>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <UpdatePingLoop>d__35(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
break;
}
if ((Object)(object)<>4__this._pingText != (Object)null)
{
<ping>5__1 = PhotonNetwork.GetPing();
((TMP_Text)<>4__this._pingText).text = (<>4__this._showMsConfig.Value ? $"{<ping>5__1} ms" : $"{<ping>5__1}");
((TMP_Text)<>4__this._pingText).ForceMeshUpdate(false, false);
<actualTextWidth>5__2 = Mathf.Ceil(((TMP_Text)<>4__this._pingText).preferredWidth);
<>4__this._textRect.sizeDelta = new Vector2(Mathf.Max(<>4__this._textContainerWidth.Value, <actualTextWidth>5__2), <>4__this._textRect.sizeDelta.y);
if ((Object)(object)<>4__this._maxText != (Object)null && <>4__this._pingHistory.Count > 0)
{
<maxPing>5__3 = <>4__this._pingHistory.Max();
((TMP_Text)<>4__this._maxText).text = $"{<maxPing>5__3}";
((TMP_Text)<>4__this._maxText).ForceMeshUpdate(false, false);
}
<>4__this.PositionGraph(<>4__this._textRect);
<>4__this.UpdateGraph(<ping>5__1);
}
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
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();
}
}
private GameObject _canvasGO;
private TextMeshProUGUI _pingText;
private TextMeshProUGUI _maxText;
private ConfigEntry<string> _cornerConfig;
private ConfigEntry<bool> _showMsConfig;
private ConfigEntry<float> _paddingLeft;
private ConfigEntry<float> _paddingRight;
private ConfigEntry<float> _paddingTop;
private ConfigEntry<float> _paddingBottom;
private ConfigEntry<string> _fontNameConfig;
private ConfigEntry<int> _fontSizeConfig;
private ConfigEntry<Color> _fontColorConfig;
private RectTransform _graphContainer;
private List<GameObject> _graphPoints = new List<GameObject>();
private Queue<int> _pingHistory = new Queue<int>();
private ConfigEntry<int> _graphMaxSamples;
private ConfigEntry<float> _graphWidth;
private ConfigEntry<float> _graphHeight;
private ConfigEntry<Color> _graphColor;
private ConfigEntry<float> _graphSpacing;
private ConfigEntry<float> _graphYOffsetTop;
private ConfigEntry<float> _graphYOffsetBottom;
private ConfigEntry<float> _maxOffsetLeftX;
private ConfigEntry<float> _maxOffsetLeftY;
private ConfigEntry<float> _maxOffsetRightX;
private ConfigEntry<float> _maxOffsetRightY;
private ConfigEntry<float> _textContainerWidth;
private ConfigEntry<bool> _showGraphConfig;
private ConfigEntry<bool> _showMaxConfig;
private RectTransform _textRect;
private void Awake()
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Expected O, but got Unknown
//IL_014c: 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)
_cornerConfig = ((BaseUnityPlugin)this).Config.Bind<string>("Display", "Corner", "BottomLeft", new ConfigDescription("Corner of the screen for ping text", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[4] { "TopLeft", "TopRight", "BottomLeft", "BottomRight" }), Array.Empty<object>()));
_showMsConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Display", "ShowMs", true, (ConfigDescription)null);
_paddingLeft = ((BaseUnityPlugin)this).Config.Bind<float>("Display", "PaddingLeft", 10f, (ConfigDescription)null);
_paddingRight = ((BaseUnityPlugin)this).Config.Bind<float>("Display", "PaddingRight", -10f, (ConfigDescription)null);
_paddingTop = ((BaseUnityPlugin)this).Config.Bind<float>("Display", "PaddingTop", 10f, (ConfigDescription)null);
_paddingBottom = ((BaseUnityPlugin)this).Config.Bind<float>("Display", "PaddingBottom", 10f, (ConfigDescription)null);
_fontNameConfig = ((BaseUnityPlugin)this).Config.Bind<string>("Display", "FontName", "DarumaDropOne-Regular SDF", (ConfigDescription)null);
_fontSizeConfig = ((BaseUnityPlugin)this).Config.Bind<int>("Display", "FontSize", 14, (ConfigDescription)null);
_fontColorConfig = ((BaseUnityPlugin)this).Config.Bind<Color>("Display", "FontColor", Color.white, (ConfigDescription)null);
_graphMaxSamples = ((BaseUnityPlugin)this).Config.Bind<int>("Graph", "MaxSamples", 50, (ConfigDescription)null);
_graphWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "Width", 50f, (ConfigDescription)null);
_graphHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "Height", 40f, (ConfigDescription)null);
_graphColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Graph", "Color", Color.white, (ConfigDescription)null);
_graphSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "Spacing", 2f, (ConfigDescription)null);
_graphYOffsetTop = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "YOffsetTop", 0f, (ConfigDescription)null);
_graphYOffsetBottom = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "YOffsetBottom", -25f, (ConfigDescription)null);
_maxOffsetLeftX = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "MaxOffsetLeftX", 5f, (ConfigDescription)null);
_maxOffsetLeftY = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "MaxOffsetLeftY", 0f, (ConfigDescription)null);
_maxOffsetRightX = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "MaxOffsetRightX", 5f, (ConfigDescription)null);
_maxOffsetRightY = ((BaseUnityPlugin)this).Config.Bind<float>("Graph", "MaxOffsetRightY", 0f, (ConfigDescription)null);
_textContainerWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Display", "TextContainerWidth", 34.5f, "Width of the text container - adjust this to control spacing between ping text and graph");
_showGraphConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Display", "ShowGraph", true, "Toggle the ping graph visibility");
_showMaxConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("Display", "ShowMax", true, "Toggle the max ping text visibility");
((MonoBehaviour)this).StartCoroutine(InitGUI());
}
[IteratorStateMachine(typeof(<InitGUI>d__31))]
private IEnumerator InitGUI()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <InitGUI>d__31(0)
{
<>4__this = this
};
}
private void CreateGUI()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
//IL_0067: 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: Expected O, but got Unknown
//IL_0103: 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_0158: Expected O, but got Unknown
//IL_019a: 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_01b1: Expected O, but got Unknown
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)_canvasGO != (Object)null))
{
_canvasGO = new GameObject("PhotonPingCanvas");
Canvas val = _canvasGO.AddComponent<Canvas>();
val.renderMode = (RenderMode)0;
val.sortingOrder = 1000;
CanvasScaler val2 = _canvasGO.AddComponent<CanvasScaler>();
val2.uiScaleMode = (ScaleMode)1;
val2.referenceResolution = new Vector2(1920f, 1080f);
_canvasGO.AddComponent<GraphicRaycaster>();
GameObject val3 = new GameObject("PingText");
val3.transform.SetParent(_canvasGO.transform, false);
_pingText = val3.AddComponent<TextMeshProUGUI>();
TMP_FontAsset font = ((IEnumerable<TMP_FontAsset>)Resources.FindObjectsOfTypeAll<TMP_FontAsset>()).FirstOrDefault((Func<TMP_FontAsset, bool>)((TMP_FontAsset f) => ((Object)f).name == _fontNameConfig.Value)) ?? Resources.GetBuiltinResource<TMP_FontAsset>("LiberationSans SDF.asset");
((TMP_Text)_pingText).font = font;
((TMP_Text)_pingText).fontSize = _fontSizeConfig.Value;
((Graphic)_pingText).color = _fontColorConfig.Value;
((TMP_Text)_pingText).enableWordWrapping = false;
((TMP_Text)_pingText).overflowMode = (TextOverflowModes)0;
_textRect = val3.GetComponent<RectTransform>();
SetCorner(_textRect, _cornerConfig.Value);
GameObject val4 = new GameObject("PingGraph");
val4.transform.SetParent(_canvasGO.transform, false);
_graphContainer = val4.AddComponent<RectTransform>();
_graphContainer.sizeDelta = new Vector2(_graphWidth.Value, _graphHeight.Value);
GameObject val5 = new GameObject("MaxPingText");
val5.transform.SetParent(_canvasGO.transform, false);
_maxText = val5.AddComponent<TextMeshProUGUI>();
((TMP_Text)_maxText).font = ((TMP_Text)_pingText).font;
((TMP_Text)_maxText).fontSize = Mathf.Max(10, _fontSizeConfig.Value - 2);
((Graphic)_maxText).color = ((Graphic)_pingText).color;
((TMP_Text)_maxText).enableWordWrapping = false;
((TMP_Text)_maxText).overflowMode = (TextOverflowModes)0;
RectTransform component = val5.GetComponent<RectTransform>();
component.sizeDelta = new Vector2(0f, 20f);
PositionGraph(_textRect);
Object.DontDestroyOnLoad((Object)(object)_canvasGO);
}
}
private void PositionGraph(RectTransform textRect)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: 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_0092: 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_00f4: 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_0156: 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_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_0263: Unknown result type (might be due to invalid IL or missing references)
//IL_0268: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_027e: Unknown result type (might be due to invalid IL or missing references)
//IL_0283: 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_02a0: 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_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_02bd: 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_0372: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
bool flag = _cornerConfig.Value.Contains("Left");
bool flag2 = _cornerConfig.Value.StartsWith("Top");
_graphContainer.anchorMin = textRect.anchorMin;
_graphContainer.anchorMax = textRect.anchorMax;
_graphContainer.sizeDelta = new Vector2(_graphWidth.Value, _graphHeight.Value);
_graphContainer.pivot = new Vector2(flag ? 0f : 1f, 0.5f);
float num = _textContainerWidth.Value;
if ((Object)(object)_pingText != (Object)null)
{
((TMP_Text)_pingText).ForceMeshUpdate(false, false);
float preferredWidth = ((TMP_Text)_pingText).preferredWidth;
if (preferredWidth > 0f)
{
num = Mathf.Max(num, preferredWidth);
}
}
float num2 = (flag ? textRect.anchoredPosition.x : (textRect.anchoredPosition.x - num));
float num3 = (flag ? (num2 + num) : textRect.anchoredPosition.x);
float num4 = _graphHeight.Value / 2f;
float num5 = (flag2 ? (textRect.anchoredPosition.y - num4 + _graphYOffsetTop.Value) : (textRect.anchoredPosition.y + num4 + _graphYOffsetBottom.Value));
((Component)_graphContainer).gameObject.SetActive(_showGraphConfig.Value);
if (_showGraphConfig.Value)
{
_graphContainer.anchoredPosition = new Vector2(flag ? (num3 + _graphSpacing.Value) : (num2 - _graphSpacing.Value), num5);
}
if (!((Object)(object)_maxText != (Object)null))
{
return;
}
((Component)_maxText).gameObject.SetActive(_showMaxConfig.Value);
if (_showMaxConfig.Value)
{
RectTransform component = ((Component)_maxText).GetComponent<RectTransform>();
component.anchorMin = textRect.anchorMin;
component.anchorMax = textRect.anchorMax;
((TMP_Text)_pingText).ForceMeshUpdate(false, false);
((TMP_Text)_maxText).ForceMeshUpdate(false, false);
Bounds textBounds = ((TMP_Text)_pingText).textBounds;
float y = ((Bounds)(ref textBounds)).min.y;
textBounds = ((TMP_Text)_maxText).textBounds;
float y2 = ((Bounds)(ref textBounds)).min.y;
float num6 = y - y2;
float num7 = _textRect.anchoredPosition.y + num6;
if (flag)
{
float num8 = _graphContainer.anchoredPosition.x + _graphWidth.Value + Mathf.Abs(_maxOffsetLeftX.Value);
component.pivot = new Vector2(0f, flag2 ? 1f : 0f);
component.anchoredPosition = new Vector2(num8, num7);
}
else
{
float num9 = _graphContainer.anchoredPosition.x - _graphWidth.Value - Mathf.Abs(_maxOffsetRightX.Value);
component.pivot = new Vector2(1f, flag2 ? 1f : 0f);
component.anchoredPosition = new Vector2(num9, num7);
}
}
}
private void SetCorner(RectTransform rect, string corner)
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_00b9: 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_00d2: 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_0118: 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_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: 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_01ae: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = default(Vector2);
switch (corner)
{
case "TopLeft":
((Vector2)(ref val))..ctor(0f, 1f);
rect.anchorMax = val;
rect.anchorMin = val;
rect.pivot = new Vector2(0f, 1f);
rect.anchoredPosition = new Vector2(_paddingLeft.Value, 0f - _paddingTop.Value);
break;
case "TopRight":
((Vector2)(ref val))..ctor(1f, 1f);
rect.anchorMax = val;
rect.anchorMin = val;
rect.pivot = new Vector2(1f, 1f);
rect.anchoredPosition = new Vector2(_paddingRight.Value, 0f - _paddingTop.Value);
break;
case "BottomLeft":
((Vector2)(ref val))..ctor(0f, 0f);
rect.anchorMax = val;
rect.anchorMin = val;
rect.pivot = new Vector2(0f, 0f);
rect.anchoredPosition = new Vector2(_paddingLeft.Value, _paddingBottom.Value);
break;
case "BottomRight":
((Vector2)(ref val))..ctor(1f, 0f);
rect.anchorMax = val;
rect.anchorMin = val;
rect.pivot = new Vector2(1f, 0f);
rect.anchoredPosition = new Vector2(_paddingRight.Value, _paddingBottom.Value);
break;
}
rect.sizeDelta = new Vector2(_textContainerWidth.Value, 20f);
}
[IteratorStateMachine(typeof(<UpdatePingLoop>d__35))]
private IEnumerator UpdatePingLoop()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <UpdatePingLoop>d__35(0)
{
<>4__this = this
};
}
private void UpdateGraph(int ping)
{
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Expected O, but got Unknown
//IL_011a: 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_014b: 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_0292: 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_0296: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: 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_02ef: Unknown result type (might be due to invalid IL or missing references)
_pingHistory.Enqueue(ping);
if (_pingHistory.Count > _graphMaxSamples.Value)
{
_pingHistory.Dequeue();
}
if (_pingHistory.Count < 2 || !_showGraphConfig.Value)
{
return;
}
bool flag = _cornerConfig.Value.Contains("Left");
_graphContainer.pivot = new Vector2(flag ? 0f : 1f, 0.5f);
float num = _graphWidth.Value / (float)Mathf.Max(1, _graphMaxSamples.Value - 1);
int[] array = _pingHistory.ToArray();
int num2 = array.Length - 1;
Vector2 val2 = default(Vector2);
while (_graphPoints.Count < num2)
{
GameObject val = new GameObject("Line", new Type[1] { typeof(Image) });
val.transform.SetParent((Transform)(object)_graphContainer, false);
Image component = val.GetComponent<Image>();
((Graphic)component).color = _graphColor.Value;
RectTransform component2 = val.GetComponent<RectTransform>();
((Vector2)(ref val2))..ctor(0f, 0.5f);
component2.anchorMax = val2;
component2.anchorMin = val2;
component2.pivot = new Vector2(0f, 0.5f);
_graphPoints.Add(val);
}
while (_graphPoints.Count > num2)
{
GameObject val3 = _graphPoints[_graphPoints.Count - 1];
_graphPoints.RemoveAt(_graphPoints.Count - 1);
if ((Object)(object)val3 != (Object)null)
{
Object.Destroy((Object)(object)val3);
}
}
Vector2 val4 = default(Vector2);
Vector2 val5 = default(Vector2);
for (int i = 0; i < num2; i++)
{
float num3 = (float)i * num;
float num4 = Mathf.Clamp((float)array[i] / 200f * _graphHeight.Value, 0f, _graphHeight.Value);
((Vector2)(ref val4))..ctor(num3, num4);
float num5 = (float)(i + 1) * num;
float num6 = Mathf.Clamp((float)array[i + 1] / 200f * _graphHeight.Value, 0f, _graphHeight.Value);
((Vector2)(ref val5))..ctor(num5, num6);
RectTransform component3 = _graphPoints[i].GetComponent<RectTransform>();
Vector2 val6 = val5 - val4;
component3.sizeDelta = new Vector2(((Vector2)(ref val6)).magnitude + 0.5f, 1f);
component3.anchoredPosition = val4;
float num7 = Mathf.Atan2(val6.y, val6.x) * 57.29578f;
((Transform)component3).localRotation = Quaternion.Euler(0f, 0f, num7);
}
if ((Object)(object)_maxText != (Object)null && _pingHistory.Count > 0)
{
int num8 = _pingHistory.Max();
((TMP_Text)_maxText).text = $"{num8}";
}
}
}