using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using HarmonyLib;
using Il2Cpp;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppPhoton.Pun;
using Il2CppRUMBLE.Combat.ShiftStones;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.MoveSystem;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Pools;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem.Collections.Generic;
using Il2CppTMPro;
using MelonLoader;
using Microsoft.CodeAnalysis;
using RumbleModUI;
using RumbleModdingAPI;
using TwitchChatInGame;
using TwitchTools;
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: MelonInfo(typeof(Main), "TwitchChatInGame", "1.0.4", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("TwitchChatInGame")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+58115abe6ff461c6c3140c266fe89d16342dee77")]
[assembly: AssemblyProduct("TwitchChatInGame")]
[assembly: AssemblyTitle("TwitchChatInGame")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace TwitchTools
{
public class TwitchChatHandle : IDisposable
{
private bool exit = false;
private string channel;
private string read;
private TcpClient tcpClient;
private StreamReader inputStream;
private StreamWriter outputStream;
private Thread pingThread;
public TwitchChatHandle(string oauth, string channel)
{
this.channel = channel;
tcpClient = new TcpClient("irc.twitch.tv", 6667);
inputStream = new StreamReader(tcpClient.GetStream());
outputStream = new StreamWriter(tcpClient.GetStream());
outputStream.WriteLine("PASS " + oauth);
outputStream.WriteLine("NICK bot");
outputStream.WriteLine("USER bot 8 * :bot");
outputStream.WriteLine("JOIN #" + channel);
outputStream.Flush();
pingThread = new Thread((ThreadStart)delegate
{
AutoPing();
});
pingThread.Start();
}
public TwitchChatEntry Read()
{
while (true)
{
if (exit)
{
return null;
}
read = TcpRead();
if (read == null)
{
Thread.Sleep(100);
}
else if (read.Contains("PRIVMSG"))
{
break;
}
}
int num = read.IndexOf(":") + 1;
int num2 = read.IndexOf("!");
int num3 = num2 - num;
if (num3 < 1)
{
return null;
}
string sender = read.Substring(num, num3);
num = read.IndexOf(":", 1) + 1;
string message = read.Substring(num);
return new TwitchChatEntry(sender, message);
}
public bool Write(string chatMessage)
{
return TcpWrite(":[email protected] PRIVMSG #" + channel + " :" + chatMessage);
}
private string TcpRead()
{
try
{
return inputStream.ReadLine();
}
catch
{
return null;
}
}
private bool TcpWrite(string text)
{
try
{
outputStream.WriteLine(text);
outputStream.Flush();
return true;
}
catch
{
return false;
}
}
private void AutoPing()
{
while (!exit)
{
if (!TcpWrite("PING irc.twitch.tv"))
{
Thread.Sleep(100);
continue;
}
int num;
for (num = 0; num < 300; num++)
{
if (exit)
{
return;
}
Thread.Sleep(1000);
num++;
}
}
}
public void Dispose()
{
exit = true;
pingThread.Join();
inputStream.Dispose();
outputStream.Dispose();
tcpClient.Dispose();
}
}
public class TwitchChatEntry
{
public readonly string Sender;
public readonly string Message;
public TwitchChatEntry(string sender, string message)
{
Sender = sender;
Message = message;
}
}
}
namespace TwitchChatInGame
{
public static class BuildInfo
{
public const string ModName = "TwitchChatInGame";
public const string ModVersion = "1.0.4";
public const string Author = "UlvakSkillz";
}
public class ChatCommand
{
public string[] commands;
private Func<object> functionToRun;
public bool commandRan = false;
public bool running = true;
public ChatCommand(string[] newCommands, Func<object> newFunctionToRun)
{
commands = newCommands;
functionToRun = newFunctionToRun;
}
public void RunCheck()
{
if (!running)
{
return;
}
string[] array = commands;
foreach (string value in array)
{
if (Main.chatEntries[0].Message.ToLower().Contains(value))
{
try
{
functionToRun();
}
catch
{
}
commandRan = true;
break;
}
}
}
}
public class Main : MelonMod
{
[RegisterTypeInIl2Cpp]
public class HandChecker : MonoBehaviour
{
[CompilerGenerated]
private sealed class <waitForHoldPress>d__4 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public HandChecker <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <waitForHoldPress>d__4(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.4f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
try
{
if (!toggling && <>4__this.handTouching)
{
MelonCoroutines.Start(ToggleChat(!activeScreen.active));
}
}
catch
{
}
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 bool onLeft;
private bool handTouching = false;
public HandChecker()
{
try
{
onLeft = ((((Object)((Component)this).transform.parent).name == "Bone_HandAlpha_L") ? true : false);
}
catch
{
Object.Destroy((Object)(object)this);
}
}
private void OnTriggerEnter(Collider other)
{
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Invalid comparison between Unknown and I4
try
{
if (handTouching || toggling || !showScreen || (Object)(object)activeScreen == (Object)null || (onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_R") || (!onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_L") || (int)((Component)((Component)other).transform.parent.parent.parent.parent.parent.parent.parent.parent.parent).GetComponent<PlayerController>().controllerType != 1)
{
return;
}
}
catch
{
return;
}
if (tapToSwitch && toggleableChat && !activeScreen.active && ((onLeft && whereToPinChat == 2) || (!onLeft && whereToPinChat == 1)))
{
whereToPinChat = (onLeft ? 1 : 2);
TwitchChatInGame.Settings[1].Value = whereToPinChat;
TwitchChatInGame.Settings[1].SavedValue = whereToPinChat;
SetActiveScreenTransform();
MelonCoroutines.Start(ToggleChat(active: true));
}
else if (toggleableChat && ((whereToPinChat == 1 && ((Object)((Component)other).gameObject).name == "Bone_HandAlpha_R") || (whereToPinChat == 2 && ((Object)((Component)other).gameObject).name == "Bone_HandAlpha_L")))
{
handTouching = true;
MelonCoroutines.Start(waitForHoldPress());
}
}
[IteratorStateMachine(typeof(<waitForHoldPress>d__4))]
private IEnumerator waitForHoldPress()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <waitForHoldPress>d__4(0)
{
<>4__this = this
};
}
private void OnTriggerExit(Collider other)
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Invalid comparison between Unknown and I4
try
{
if ((onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_R") || (!onLeft && ((Object)((Component)other).gameObject).name != "Bone_HandAlpha_L") || (int)((Component)((Component)other).transform.parent.parent.parent.parent.parent.parent.parent.parent.parent).GetComponent<PlayerController>().controllerType != 1)
{
return;
}
}
catch
{
return;
}
handTouching = false;
}
}
[HarmonyPatch(typeof(PlayerController), "Initialize", new Type[] { typeof(Player) })]
public static class playerspawn
{
public static void Postfix(ref PlayerController __instance, ref Player player)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Invalid comparison between Unknown and I4
try
{
if ((int)player.Controller.controllerType == 1)
{
}
}
catch
{
return;
}
MelonCoroutines.Start(CreateScreen(__instance));
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass76_0
{
public TwitchChatEntry chatEntry;
public bool chatRead;
internal void <ReadEntries>b__0()
{
chatEntry = chat.Read();
chatEntries.Add(chatEntry);
chatRead = true;
}
}
[CompilerGenerated]
private sealed class <CreateScreen>d__72 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PlayerController playerController;
private Player <player>5__1;
private GameObject[] <chatToggles>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <CreateScreen>d__72(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<player>5__1 = null;
<chatToggles>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
//IL_01f9: 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_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_0331: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: 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_00c2: Expected O, but got Unknown
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Invalid comparison between Unknown and I4
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<player>5__1 = playerController.assignedPlayer;
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if ((Object)(object)playerController == (Object)null || <player>5__1 == null || (Object)(object)<player>5__1.Controller == (Object)null || (int)<player>5__1.Controller.controllerType != 1)
{
return false;
}
activeScreen = Object.Instantiate<GameObject>(screen);
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
chatTMP = ((Component)activeScreen.transform.GetChild(1)).GetComponent<TextMeshProUGUI>();
rawImage = ((Component)activeScreen.transform.GetChild(0)).GetComponent<RawImage>();
SetActiveScreenTransform();
activeScreen.SetActive(lastKnownScreenActiveState);
<chatToggles>5__2 = (GameObject[])(object)new GameObject[2];
<chatToggles>5__2[0] = GameObject.CreatePrimitive((PrimitiveType)0);
((Object)<chatToggles>5__2[0]).name = "TwitchChatToggle";
<chatToggles>5__2[0].layer = 22;
Object.DestroyImmediate((Object)(object)<chatToggles>5__2[0].GetComponent<MeshRenderer>());
((Collider)<chatToggles>5__2[0].GetComponent<SphereCollider>()).isTrigger = true;
<chatToggles>5__2[0].transform.parent = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(0).GetChild(1).GetChild(0)
.GetChild(4)
.GetChild(0)
.GetChild(1)
.GetChild(0)
.GetChild(0)
.GetChild(0);
<chatToggles>5__2[0].transform.localPosition = new Vector3(0.03f, 0f, 0f);
<chatToggles>5__2[0].transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
<chatToggles>5__2[0].transform.localScale = new Vector3(0.075f, 0.075f, 0.075f);
<chatToggles>5__2[0].AddComponent<HandChecker>();
<chatToggles>5__2[1] = GameObject.CreatePrimitive((PrimitiveType)0);
((Object)<chatToggles>5__2[1]).name = "TwitchChatToggle";
<chatToggles>5__2[1].layer = 22;
Object.DestroyImmediate((Object)(object)<chatToggles>5__2[1].GetComponent<MeshRenderer>());
((Collider)<chatToggles>5__2[1].GetComponent<SphereCollider>()).isTrigger = true;
<chatToggles>5__2[1].transform.parent = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(0).GetChild(1).GetChild(0)
.GetChild(4)
.GetChild(0)
.GetChild(2)
.GetChild(0)
.GetChild(0)
.GetChild(0);
<chatToggles>5__2[1].transform.localPosition = new Vector3(-0.03f, 0f, 0f);
<chatToggles>5__2[1].transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
<chatToggles>5__2[1].transform.localScale = new Vector3(0.075f, 0.075f, 0.075f);
<chatToggles>5__2[1].AddComponent<HandChecker>();
MelonCoroutines.Start(ScreenFade());
MelonCoroutines.Start(MoveScreenIfNeeded());
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 <MoveScreenIfNeeded>d__73 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
private Transform <playerPos>5__1;
private int <closest>5__2;
private float <distance>5__3;
private int <i>5__4;
private float <measuredDistance>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <MoveScreenIfNeeded>d__73(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<playerPos>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_009f: 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_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Expected O, but got Unknown
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: 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_01ee: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<playerPos>5__1 = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.transform.GetChild(1).GetChild(0).GetChild(0);
CreateScreenSpots();
break;
case 1:
<>1__state = -1;
break;
}
if ((Object)(object)activeScreen != (Object)null && whereToPinChat == 0)
{
if (showScreen)
{
activeScreen.SetActive(true);
}
<closest>5__2 = -1;
<distance>5__3 = 100f;
<i>5__4 = 0;
while (<i>5__4 < screenSpots.Count)
{
<measuredDistance>5__5 = Vector3.Distance(((Component)<playerPos>5__1).transform.position, screenSpots[<i>5__4].transform.position);
if (<measuredDistance>5__5 < <distance>5__3)
{
<closest>5__2 = <i>5__4;
<distance>5__3 = <measuredDistance>5__5;
}
<i>5__4++;
}
if (screenSpots.Count > 0 && (Object)(object)((Component)activeScreen.transform.parent).gameObject != (Object)(object)screenSpots[<closest>5__2])
{
activeScreen.transform.parent = screenSpots[<closest>5__2].transform;
activeScreen.transform.localPosition = (overrideChatPosition ? overridePosition : Vector3.zero);
activeScreen.transform.localRotation = (overrideChatRotation ? overrideRotation : Quaternion.identity);
activeScreen.transform.localScale = (Vector3)(overrideChatScale ? overrideScale : new Vector3(0.005f, 0.005f, 0.005f));
}
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 1;
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();
}
}
[CompilerGenerated]
private sealed class <ProcessEntries>d__69 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
private bool <clear>5__1;
private List<string>.Enumerator <>s__2;
private string <word>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ProcessEntries>d__69(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>s__2 = default(List<string>.Enumerator);
<word>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
Log("Starting Process Chat");
break;
case 1:
<>1__state = -1;
break;
}
while (fileFound)
{
if (chatEntries.Count > 0)
{
try
{
if (!(chatEntries[0].Sender == ""))
{
}
}
catch
{
chatEntries.RemoveAt(0);
continue;
}
Log(chatEntries[0].Sender + ": " + chatEntries[0].Message);
<clear>5__1 = true;
if (blacklistedNames.Contains(chatEntries[0].Sender.ToLower()))
{
<clear>5__1 = false;
}
else
{
<>s__2 = blacklistedWords.GetEnumerator();
try
{
while (<>s__2.MoveNext())
{
<word>5__3 = <>s__2.Current;
if (chatEntries[0].Message.ToLower().Contains(<word>5__3))
{
<clear>5__1 = false;
break;
}
<word>5__3 = null;
}
}
finally
{
((IDisposable)<>s__2).Dispose();
}
<>s__2 = default(List<string>.Enumerator);
}
if (<clear>5__1)
{
CheckCommands();
UpdateChatLog();
}
chatEntries.RemoveAt(0);
continue;
}
<>2__current = (object)new WaitForSeconds(0.25f);
<>1__state = 1;
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();
}
}
[CompilerGenerated]
private sealed class <ReadEntries>d__76 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Main <>4__this;
private <>c__DisplayClass76_0 <>8__1;
private Thread <temp>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ReadEntries>d__76(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>8__1 = null;
<temp>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Expected O, but got Unknown
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -1;
goto IL_00a3;
}
<>1__state = -1;
Log("Starting Listening to Chat");
goto IL_00c4;
IL_00a3:
if (!<>8__1.chatRead)
{
<>2__current = (object)new WaitForSeconds(0.25f);
<>1__state = 1;
return true;
}
<>8__1 = null;
<temp>5__2 = null;
goto IL_00c4;
IL_00c4:
if (fileFound)
{
<>8__1 = new <>c__DisplayClass76_0();
<>8__1.chatEntry = null;
<>8__1.chatRead = false;
<temp>5__2 = new Thread((ThreadStart)delegate
{
<>8__1.chatEntry = chat.Read();
chatEntries.Add(<>8__1.chatEntry);
<>8__1.chatRead = true;
});
<temp>5__2.Start();
goto IL_00a3;
}
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 <ReconnectBot>d__64 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Main <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ReconnectBot>d__64(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
MelonCoroutines.Stop(<>4__this.processEntriesCoroutine);
MelonCoroutines.Stop(<>4__this.readEntriesCoroutine);
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
chat.Dispose();
<>4__this.TwitchFileCheck();
if (fileFound)
{
while (chatEntries.Count > 0)
{
chatEntries.RemoveAt(0);
}
Log("Restarting Twitch Bot");
<>4__this.readEntriesCoroutine = MelonCoroutines.Start(<>4__this.ReadEntries());
<>4__this.processEntriesCoroutine = MelonCoroutines.Start(ProcessEntries());
}
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 <ScreenFade>d__75 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
private Transform <playerPos>5__1;
private Vector3 <forwardVector>5__2;
private Vector3 <directionToObject>5__3;
private float <dotProduct>5__4;
private float <angle>5__5;
private float <newAlpha>5__6;
private float <inverter>5__7;
private Vector3 <forwardVector2>5__8;
private Vector3 <directionToObject2>5__9;
private float <dotProduct2>5__10;
private float <angle2>5__11;
private float <newAlpha2>5__12;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ScreenFade>d__75(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<playerPos>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: 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_006e: 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_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)
//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_00a2: 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_01dd: 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_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_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: 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_0222: 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_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0234: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: 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_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_031b: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_0349: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Unknown result type (might be due to invalid IL or missing references)
//IL_035f: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<playerPos>5__1 = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.transform.GetChild(1).GetChild(0).GetChild(0);
break;
case 1:
<>1__state = -1;
break;
}
if ((Object)(object)activeScreen != (Object)null)
{
Vector3 val = <playerPos>5__1.forward;
<forwardVector>5__2 = ((Vector3)(ref val)).normalized;
val = activeScreen.transform.position - <playerPos>5__1.position;
<directionToObject>5__3 = ((Vector3)(ref val)).normalized;
<dotProduct>5__4 = Vector3.Dot(<forwardVector>5__2, <directionToObject>5__3);
<angle>5__5 = Mathf.Acos(<dotProduct>5__4) * 57.29578f;
<newAlpha>5__6 = 0f;
if (<angle>5__5 <= 20f)
{
<newAlpha>5__6 = 1f;
}
else if (<angle>5__5 >= 45f)
{
<newAlpha>5__6 = 0f;
}
else
{
<newAlpha>5__6 = 1.8f - 0.04f * <angle>5__5;
}
<inverter>5__7 = -1f;
if ((Object)(object)activeScreen.transform.parent == (Object)null)
{
<inverter>5__7 = -1f;
}
else if (((Object)activeScreen.transform.parent).name == "Bone_HandAlpha_L")
{
<inverter>5__7 = -1f;
}
else if (((Object)activeScreen.transform.parent).name == "Bone_HandAlpha_R")
{
<inverter>5__7 = 1f;
}
val = activeScreen.transform.forward * <inverter>5__7;
<forwardVector2>5__8 = ((Vector3)(ref val)).normalized;
val = ((Component)<playerPos>5__1).transform.position - activeScreen.transform.position;
<directionToObject2>5__9 = ((Vector3)(ref val)).normalized;
<dotProduct2>5__10 = Vector3.Dot(<forwardVector2>5__8, <directionToObject2>5__9);
<angle2>5__11 = Mathf.Acos(<dotProduct2>5__10) * 57.29578f;
if (<angle2>5__11 >= 90f)
{
<newAlpha>5__6 = 0f;
}
else if (<angle2>5__11 > 60f)
{
<newAlpha2>5__12 = 3f - 1f / 30f * <angle2>5__11;
if (<newAlpha>5__6 > <newAlpha2>5__12)
{
<newAlpha>5__6 = <newAlpha2>5__12;
}
}
((Graphic)rawImage).color = new Color(((Graphic)rawImage).color.r, ((Graphic)rawImage).color.g, ((Graphic)rawImage).color.b, <newAlpha>5__6);
((Graphic)chatTMP).color = new Color(((Graphic)chatTMP).color.r, ((Graphic)chatTMP).color.g, ((Graphic)chatTMP).color.b, <newAlpha>5__6);
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 1;
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();
}
}
[CompilerGenerated]
private sealed class <SlowDownTime>d__57 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Main <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SlowDownTime>d__57(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_003b: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
Time.timeScale = 0.5f;
<>2__current = (object)new WaitForSecondsRealtime(5f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
Time.timeScale = 1f;
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 <ThrowBall>d__58 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Main <>4__this;
private Transform <playerPos>5__1;
private List<PooledMonoBehaviour> <pooledStructuresBall>5__2;
private List<PooledMonoBehaviour> <pooledStructures>5__3;
private int <i>5__4;
private int <closest>5__5;
private float <closestDistance>5__6;
private int <i>5__7;
private float <distance>5__8;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ThrowBall>d__58(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<playerPos>5__1 = null;
<pooledStructuresBall>5__2 = null;
<pooledStructures>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Expected O, but got Unknown
//IL_0173: 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_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: 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)
//IL_01cc: 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_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_027c: Unknown result type (might be due to invalid IL or missing references)
//IL_0286: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
SpawnStruct("!ball", "SpawnBall");
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<playerPos>5__1 = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(1).GetChild(0).GetChild(0);
<pooledStructuresBall>5__2 = ((Il2CppArrayBase<Pool<PooledMonoBehaviour>>)(object)Singleton<PoolManager>.instance.availablePools)[Singleton<PoolManager>.instance.GetPoolIndex("Ball")].PooledObjects;
<pooledStructures>5__3 = new List<PooledMonoBehaviour>();
<i>5__4 = 0;
while (<i>5__4 < <pooledStructuresBall>5__2.Count)
{
if (((Component)((Component)<pooledStructuresBall>5__2[<i>5__4]).transform).gameObject.active)
{
<pooledStructures>5__3.Add(<pooledStructuresBall>5__2[<i>5__4]);
}
<i>5__4++;
}
if (<pooledStructures>5__3.Count > 0)
{
<closest>5__5 = -1;
<closestDistance>5__6 = 100f;
<i>5__7 = 0;
while (<i>5__7 < <pooledStructures>5__3.Count)
{
<distance>5__8 = Vector2.Distance(new Vector2(((Component)<pooledStructures>5__3[<i>5__7]).transform.position.x, ((Component)<pooledStructures>5__3[<i>5__7]).transform.position.z), new Vector2(((Component)<playerPos>5__1).transform.position.x, ((Component)<playerPos>5__1).transform.position.z));
if (<distance>5__8 < <closestDistance>5__6)
{
<closest>5__5 = <i>5__7;
<closestDistance>5__6 = <distance>5__8;
}
<i>5__7++;
}
((Component)<pooledStructures>5__3[<closest>5__5]).gameObject.GetComponent<Rigidbody>().AddForce((<playerPos>5__1.position - ((Component)<pooledStructures>5__3[<closest>5__5]).gameObject.transform.position) * 15f, (ForceMode)2);
}
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 <ToggleChat>d__55 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public bool active;
private int <i>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ToggleChat>d__55(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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_0052: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: 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)
//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_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
toggling = true;
originalScale = activeScreen.transform.localScale;
if (active)
{
activeScreen.transform.localScale = Vector3.zero;
}
activeScreen.SetActive(true);
<i>5__1 = 0;
break;
case 1:
<>1__state = -1;
<i>5__1++;
break;
}
if (<i>5__1 < 40)
{
try
{
if (active)
{
Transform transform = activeScreen.transform;
transform.localScale += originalScale / 40f;
}
else
{
Transform transform2 = activeScreen.transform;
transform2.localScale -= originalScale / 40f;
}
}
catch
{
goto IL_0123;
}
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 1;
return true;
}
goto IL_0123;
IL_0123:
try
{
activeScreen.SetActive(active);
lastKnownScreenActiveState = active;
activeScreen.transform.localScale = originalScale;
}
catch
{
}
toggling = 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 string currentScene = "Loader";
private static string FILEPATH = "UserData\\TwitchChatInGame";
private static string FILENAME = "ConnectionInfo.txt";
private static string OVERRIDEFILENAME = "PositionOverride.txt";
private static string RESPONSESFILENAME = "Responses.txt";
private static string BLACKLISTEDNAMESFILENAME = "BlackListedNames.txt";
private static string BLACKLISTEDWORDSFILENAME = "BlackListedWords.txt";
private static List<string> blacklistedNames = new List<string>();
private static List<string> blacklistedWords = new List<string>();
private static string[] responsesFileText;
private static string[] connectionInfo;
private static TwitchChatHandle chat;
public static List<TwitchChatEntry> chatEntries = new List<TwitchChatEntry>();
private static bool fileFound = false;
private static Mod TwitchChatInGame = new Mod();
private static List<ChatCommand> commands = new List<ChatCommand>();
private static GameObject screen;
public static GameObject activeScreen;
private static TextMeshProUGUI chatTMP;
private static RawImage rawImage;
private static bool showScreen = true;
private static int whereToPinChat = 0;
private static Vector3 overridePosition;
private static Vector3 overrideScale;
private static Quaternion overrideRotation;
private static bool overrideChatPosition = false;
private static bool overrideChatRotation = false;
private static bool overrideChatScale = false;
private static bool toggleableChat = true;
private static bool tapToSwitch = true;
private static bool chatResponses = true;
private static bool blockChatCommands = false;
private static float spawningCooldownTime = 3f;
private static string chatBackgroundColor = "FFFFFF";
private static string chatTextColor = "000000";
private static DateTime lastBall = DateTime.Now;
private static DateTime lastPillar = DateTime.Now;
private static DateTime lastCube = DateTime.Now;
private static DateTime lastWall = DateTime.Now;
private static DateTime lastSlow = DateTime.Now;
private static DateTime lasttoggleChat = DateTime.Now;
private static List<string> chatLog = new List<string>();
private static bool lastKnownScreenActiveState = false;
private static bool toggling = false;
private static Vector3 originalScale;
private static List<GameObject> screenSpots = new List<GameObject>();
private static GameObject screenSpotsParent;
private object processEntriesCoroutine;
private object readEntriesCoroutine;
public GameObject LoadAssetBundle(string bundleName, string objectName)
{
using Stream stream = ((MelonBase)this).MelonAssembly.Assembly.GetManifestResourceStream(bundleName);
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Il2CppAssetBundle val = Il2CppAssetBundleManager.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array));
return Object.Instantiate<GameObject>(val.LoadAsset<GameObject>(objectName));
}
public override void OnLateInitializeMelon()
{
TwitchChatInGame.ModName = "TwitchChatInGame";
TwitchChatInGame.ModVersion = "1.0.4";
TwitchChatInGame.SetFolder("TwitchChatInGame");
TwitchChatInGame.ModSaved += Save;
UI.instance.UI_Initialized += UIInit;
FileInitialization();
ModInitialization();
}
private void ModInitialization()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Expected O, but got Unknown
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Expected O, but got Unknown
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Expected O, but got Unknown
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Expected O, but got Unknown
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Expected O, but got Unknown
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Expected O, but got Unknown
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Expected O, but got Unknown
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Expected O, but got Unknown
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Expected O, but got Unknown
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Expected O, but got Unknown
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Expected O, but got Unknown
//IL_0576: Unknown result type (might be due to invalid IL or missing references)
//IL_0580: Expected O, but got Unknown
TwitchChatInGame.AddToList("Show Chat", true, 0, "Toggles ChatBox On/Off", new Tags());
TwitchChatInGame.AddToList("Where To Pin Chat", 1, $"0: Environment{Environment.NewLine}1: Left Hand{Environment.NewLine}2: Right Hand", new Tags());
TwitchChatInGame.AddToList("Chat Position Override", false, 0, "Toggles using the Chatbox Position Override from File On/Off" + Environment.NewLine + "Saving will Reload the Override with the Current File Info", new Tags());
TwitchChatInGame.AddToList("Chat Rotation Override", false, 0, "Toggles using the Chatbox Rotation Override from File On/Off" + Environment.NewLine + "Saving will Reload the Override with the Current File Info", new Tags());
TwitchChatInGame.AddToList("Chat Scale Override", false, 0, "Toggles using the Chatbox Scale Override from File On/Off" + Environment.NewLine + "Saving will Reload the Override with the Current File Info", new Tags());
TwitchChatInGame.AddToList("Chat Tap To Toggle", true, 0, "Toggles the Chatbox On/Off by Tapping the Back of the Wrist of the Hand that Chat is On", new Tags());
TwitchChatInGame.AddToList("Chat Tap To Switch", true, 0, "Toggles the Changing of what Hand the Chatbox is on by Tapping the Back of any Wrist while the Chatbox is Toggled OFF (From Setting Above this One)", new Tags());
TwitchChatInGame.AddToList("Chat Background Color", "FFFFFF", "Sets The Background Color to the Supplied Color", new Tags());
TwitchChatInGame.AddToList("Chat Text Color", "000000", "Sets The Text Color to the Supplied Color", new Tags());
TwitchChatInGame.AddToList("Chat Response Messages", true, 0, "Toggles The Bot Responding to Messages", new Tags());
TwitchChatInGame.AddToList("Block All Commands", false, 0, "Blocks all of the Chat Commands without needing to Toggle Each one Off", new Tags());
TwitchChatInGame.AddToList("Summon Commands CD", 3f, "Sets the Cooldown Time for !ball !pillar !cube !wall", new Tags());
TwitchChatInGame.AddToList("Reconnect Twitch", false, 0, "Reconnects to Twitch (For Settings Setup or Bot Timeout)", new Tags
{
DoNotSave = true
});
commands.Add(new ChatCommand(new string[1] { "!commands" }, delegate
{
string text6 = responsesFileText[0];
string text7 = "";
bool flag = true;
for (int l = 1; l < commands.Count; l++)
{
for (int m = 0; m < commands[l].commands.Length; m++)
{
if (commands[l].running)
{
if (!flag)
{
text7 += ", ";
}
else
{
flag = false;
}
text7 += commands[l].commands[m];
}
}
}
text6 = text6.Replace("{commands}", text7);
Write(text6, overrideResponses: true);
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!aniyogev" }, delegate
{
Write(responsesFileText[1]);
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!shiftstones" }, delegate
{
string text4 = responsesFileText[2];
string text5 = "";
PlayerShiftstoneSystem component = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.GetComponent<PlayerShiftstoneSystem>();
string[] array3 = new string[2];
try
{
array3[0] = ((Il2CppArrayBase<ShiftstoneSocket>)(object)component.shiftStoneSockets)[0].assignedShifstone.StoneName;
}
catch
{
}
try
{
array3[1] = ((Il2CppArrayBase<ShiftstoneSocket>)(object)component.shiftStoneSockets)[1].assignedShifstone.StoneName;
}
catch
{
}
if (array3[0] != null)
{
text5 += array3[0];
}
if (array3[1] != null)
{
text5 = text5 + " and " + array3[1];
}
if (array3[0] == null && array3[1] == null)
{
text5 += "No Shiftstones";
}
text4 = text4.Replace("{shiftstones}", text5);
Write(text4);
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!bp" }, delegate
{
int battlePoints2 = Singleton<PlayerManager>.instance.localPlayer.Data.GeneralData.BattlePoints;
string msg5 = responsesFileText[3].Replace("{bp}", battlePoints2.ToString());
Write(msg5);
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!region" }, delegate
{
string fixedRegion = Singleton<NetworkManager>.instance.networkConfig.FixedRegion;
List<string> list2 = new List<string>
{
"asia", "au", "cae", "eu", "in", "jp", "ru", "rue", "za", "sa",
"kr", "us", "usw"
};
string[] array2 = new string[13]
{
"Asia", "Australia", "Canada", "Europe", "India", "Japan", "Russia", "Russia, East", "South Africa", "South America",
"South Korea", "USA, East", "USA, West"
};
string msg4 = responsesFileText[4].Replace("{region}", array2[list2.IndexOf(fixedRegion)]);
Write(msg4);
return null;
}));
commands.Add(new ChatCommand(new string[2] { "!opponent", "!opponents" }, delegate
{
if (Singleton<PlayerManager>.instance.AllPlayers.Count > 1 && (currentScene == "Map0" || currentScene == "Map1"))
{
string publicUsername = Singleton<PlayerManager>.instance.AllPlayers[1].Data.GeneralData.PublicUsername;
int battlePoints = Singleton<PlayerManager>.instance.AllPlayers[1].Data.GeneralData.BattlePoints;
string msg3 = responsesFileText[5].Replace("{otherplayer}", publicUsername).Replace("{otherbp}", battlePoints.ToString());
Write(msg3);
}
else
{
Write("@" + chatEntries[0].Sender + ", I am currently not fighting anyone.");
}
return null;
}));
commands.Add(new ChatCommand(new string[2] { "!hp", "!hps" }, delegate
{
string[] array = responsesFileText[6].Split("|");
string text3 = array[0].Replace("{hp}", Singleton<PlayerManager>.instance.localPlayer.Data.HealthPoints.ToString());
for (int k = 1; k < Singleton<PlayerManager>.instance.AllPlayers.Count; k++)
{
Player val = Singleton<PlayerManager>.instance.AllPlayers[k];
text3 += array[1].Replace("{otherplayer}", Singleton<PlayerManager>.instance.AllPlayers[k].Data.GeneralData.PublicUsername).Replace("{otherhp}", Singleton<PlayerManager>.instance.AllPlayers[k].Data.HealthPoints.ToString());
}
Write(text3);
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!mods" }, delegate
{
string text = responsesFileText[7];
List<int> list = new List<int>();
string text2 = "";
for (int j = 0; j < Calls.myMods.Count; j++)
{
if (j != 0)
{
text2 += ", ";
}
if (j == Calls.myMods.Count - 1)
{
text2 += " and ";
}
text2 += Calls.myMods[j].ModName;
}
Write(text.Replace("{mods}", text2));
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!ball" }, delegate
{
if (currentScene == "Gym" || (currentScene == "Park" && PhotonNetwork.IsMasterClient))
{
MelonCoroutines.Start(ThrowBall());
}
else
{
Write("@" + chatEntries[0].Sender + ", use !ball only inside the Gym!");
}
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!pillar" }, delegate
{
SpawnStruct("!pillar", "SpawnPillar");
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!cube" }, delegate
{
SpawnStruct("!cube", "SpawnCube");
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!wall" }, delegate
{
SpawnStruct("!wall", "SpawnWall");
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!slow" }, delegate
{
if (currentScene == "Gym" || (currentScene == "Park" && PhotonNetwork.IsMasterClient))
{
if ((DateTime.Now - lastSlow).TotalSeconds > 5.0)
{
lastSlow = DateTime.Now;
MelonCoroutines.Start(SlowDownTime());
string msg2 = responsesFileText[12];
Write(msg2);
}
}
else
{
Write("@" + chatEntries[0].Sender + ", use !slow only inside the Gym!");
}
return null;
}));
commands.Add(new ChatCommand(new string[1] { "!togglechat" }, delegate
{
if (!toggling && whereToPinChat != 0 && (DateTime.Now - lasttoggleChat).TotalSeconds > 5.0)
{
lasttoggleChat = DateTime.Now;
MelonCoroutines.Start(ToggleChat(!activeScreen.active));
string msg = responsesFileText[13];
Write(msg);
}
return null;
}));
for (int i = 0; i < commands.Count; i++)
{
TwitchChatInGame.AddToList(commands[i].commands[0], true, 0, "Toggles On/Off " + commands[i].commands[0] + " Command", new Tags());
}
TwitchChatInGame.GetFromFile();
Save();
screen = LoadAssetBundle("TwitchChatInGame.twitchchat", "Canvas");
((Object)screen).name = "TwitchScreen";
((TMP_Text)((Component)screen.transform.GetChild(1)).GetComponent<TextMeshProUGUI>()).text = "";
screen.SetActive(false);
Object.DontDestroyOnLoad((Object)(object)screen);
if (fileFound)
{
Log("Starting Twitch Bot");
readEntriesCoroutine = MelonCoroutines.Start(ReadEntries());
processEntriesCoroutine = MelonCoroutines.Start(ProcessEntries());
}
}
private void FileInitialization()
{
//IL_053c: Unknown result type (might be due to invalid IL or missing references)
//IL_0541: Unknown result type (might be due to invalid IL or missing references)
//IL_0546: 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_0550: Unknown result type (might be due to invalid IL or missing references)
//IL_0555: Unknown result type (might be due to invalid IL or missing references)
//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
//IL_04ca: 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_04fe: Unknown result type (might be due to invalid IL or missing references)
//IL_052d: Unknown result type (might be due to invalid IL or missing references)
//IL_0532: Unknown result type (might be due to invalid IL or missing references)
if (!Directory.Exists(FILEPATH))
{
Directory.CreateDirectory(FILEPATH);
}
blacklistedNames.Clear();
if (!File.Exists(FILEPATH + "\\" + BLACKLISTEDNAMESFILENAME))
{
saveFile("", FILEPATH + "\\" + BLACKLISTEDNAMESFILENAME);
}
string[] array = ReadFileText(FILEPATH, BLACKLISTEDNAMESFILENAME);
string[] array2 = array;
foreach (string text in array2)
{
blacklistedNames.Add(text.ToLower());
}
blacklistedWords.Clear();
if (!File.Exists(FILEPATH + "\\" + BLACKLISTEDWORDSFILENAME))
{
saveFile("", FILEPATH + "\\" + BLACKLISTEDWORDSFILENAME);
}
string[] array3 = ReadFileText(FILEPATH, BLACKLISTEDWORDSFILENAME);
string[] array4 = array3;
foreach (string text2 in array4)
{
blacklistedWords.Add(text2.ToLower());
}
if (!File.Exists(FILEPATH + "\\" + RESPONSESFILENAME))
{
string textToSave = "!commands|@{sender}, The Commands are: {commands}." + Environment.NewLine + "!aniyogev|@{sender}, I too wish AniYogev was here!" + Environment.NewLine + "!shiftstones|@{sender}, I am currently wearing {shiftstones}." + Environment.NewLine + "!bp|@{sender}, I currently have {bp} BP." + Environment.NewLine + "!region|@{sender}, I am Currently in {region}." + Environment.NewLine + "!opponent|@{sender}, I am currently fighting {otherplayer}, they have {otherbp} BP." + Environment.NewLine + "!hp|@{sender}, I currently have {hp} Health.| {otherplayer} has {otherhp} Health." + Environment.NewLine + "!mods|@{sender}, my Mods are: {mods}." + Environment.NewLine + "!ball|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!pillar|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!cube|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!wall|@{sender} used {command} to Summon a {structure}!" + Environment.NewLine + "!slow|@{sender} activated Slow Mo Time!" + Environment.NewLine + "!togglechat|@{sender}, are you trying to be Sneaky?";
saveFile(textToSave, FILEPATH + "\\" + RESPONSESFILENAME);
fileFound = false;
}
responsesFileText = ReadFileText(FILEPATH, RESPONSESFILENAME);
for (int k = 0; k < responsesFileText.Length; k++)
{
string[] array5 = responsesFileText[k].Split("|");
responsesFileText[k] = array5[1];
if (array5.Length > 2)
{
ref string reference = ref responsesFileText[k];
reference = reference + "|" + array5[2];
}
}
if (!File.Exists(FILEPATH + "\\" + OVERRIDEFILENAME))
{
string textToSave2 = $"0 0 0{Environment.NewLine}0 0 0{Environment.NewLine}0.075 0.075 0.075{Environment.NewLine}{Environment.NewLine}--------------------------------------------------{Environment.NewLine}Line 1, Position (x y z){Environment.NewLine}Line 2, Rotation (x y z){Environment.NewLine}Line 3, Scale (x y z){Environment.NewLine}Put Spaces Between Each Number{Environment.NewLine}Save to Update Override while Game is open";
saveFile(textToSave2, FILEPATH + "\\" + OVERRIDEFILENAME);
fileFound = false;
}
try
{
string[] array6 = ReadFileText(FILEPATH, OVERRIDEFILENAME);
string[] array7 = (array6[0] + " " + array6[1] + " " + array6[2]).Split(" ");
overridePosition = new Vector3(float.Parse(array7[0], CultureInfo.InvariantCulture), float.Parse(array7[1], CultureInfo.InvariantCulture), float.Parse(array7[2], CultureInfo.InvariantCulture));
overrideRotation = Quaternion.Euler(float.Parse(array7[3], CultureInfo.InvariantCulture), float.Parse(array7[4], CultureInfo.InvariantCulture), float.Parse(array7[5], CultureInfo.InvariantCulture));
overrideScale = new Vector3(float.Parse(array7[6], CultureInfo.InvariantCulture), float.Parse(array7[7], CultureInfo.InvariantCulture), float.Parse(array7[8], CultureInfo.InvariantCulture));
}
catch
{
overridePosition = Vector3.zero;
overrideRotation = Quaternion.identity;
overrideScale = Vector3.one;
}
TwitchFileCheck();
if (!fileFound)
{
Log("File Info Not Set: " + $"{FILEPATH}\\{FILENAME}{Environment.NewLine}Please open File and edit to your info!");
}
}
private void TwitchFileCheck()
{
if (!File.Exists(FILEPATH + "\\" + FILENAME))
{
string textToSave = "oauth:InsertOauthTokenHere" + Environment.NewLine + "ReplaceWithChannelName" + Environment.NewLine + Environment.NewLine + "--------------------------------------------------" + Environment.NewLine + "First Line is 'oauth:' followed by your oauth code (no space) (https://twitchtokengenerator.com/)." + Environment.NewLine + "Second Line is your Channel Name so that the bot goes to the correct spot.";
saveFile(textToSave, FILEPATH + "\\" + FILENAME);
fileFound = false;
}
connectionInfo = ReadFileText(FILEPATH, FILENAME);
if (connectionInfo[0] == "oauth:InsertOauthTokenHere" || connectionInfo[1] == "ReplaceWithChannelName")
{
fileFound = false;
}
else
{
fileFound = true;
}
chat = new TwitchChatHandle(connectionInfo[0], connectionInfo[1]);
}
[IteratorStateMachine(typeof(<ToggleChat>d__55))]
private static IEnumerator ToggleChat(bool active)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ToggleChat>d__55(0)
{
active = active
};
}
private static void SpawnStruct(string command, string structureName)
{
if (currentScene == "Gym" || (currentScene == "Park" && PhotonNetwork.IsMasterClient))
{
DateTime dateTime = DateTime.Now;
string text = "";
switch (command)
{
case "!ball":
text += responsesFileText[8];
dateTime = lastBall.AddSeconds(spawningCooldownTime);
break;
case "!pillar":
text += responsesFileText[9];
dateTime = lastPillar.AddSeconds(spawningCooldownTime);
break;
case "!cube":
text += responsesFileText[10];
dateTime = lastCube.AddSeconds(spawningCooldownTime);
break;
case "!wall":
text += responsesFileText[11];
dateTime = lastWall.AddSeconds(spawningCooldownTime);
break;
}
if (!(dateTime < DateTime.Now))
{
return;
}
switch (command)
{
case "!ball":
lastBall = DateTime.Now;
break;
case "!pillar":
lastPillar = DateTime.Now;
break;
case "!cube":
lastCube = DateTime.Now;
break;
case "!wall":
lastWall = DateTime.Now;
break;
}
PlayerStackProcessor component = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.GetComponent<PlayerStackProcessor>();
for (int i = 0; i < component.availableStacks.Count; i++)
{
if (((Object)component.availableStacks[i]).name == structureName)
{
component.Execute(component.availableStacks[i], (StackConfiguration)null);
structureName = structureName.Replace("SpawnPillar", "Pillar").Replace("SpawnBall", "Ball").Replace("SpawnCube", "Cube")
.Replace("SpawnWall", "Wall");
text = text.Replace("{structure}", structureName).Replace("{command}", command);
Write(text);
break;
}
}
}
else
{
Write($"@{chatEntries[0].Sender}, use {command} only inside the Gym!");
}
}
[IteratorStateMachine(typeof(<SlowDownTime>d__57))]
private IEnumerator SlowDownTime()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <SlowDownTime>d__57(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<ThrowBall>d__58))]
private IEnumerator ThrowBall()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ThrowBall>d__58(0)
{
<>4__this = this
};
}
private void UIInit()
{
UI.instance.AddMod(TwitchChatInGame);
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
Time.timeScale = 1f;
currentScene = sceneName;
}
private void saveFile(string textToSave, string file)
{
FileStream fileStream = File.Create(file);
byte[] bytes = Encoding.UTF8.GetBytes(textToSave);
fileStream.Write(bytes);
fileStream.Close();
fileStream.Dispose();
}
public static string[] ReadFileText(string filePath, string fileName)
{
try
{
return File.ReadAllLines(filePath + "\\" + fileName);
}
catch (Exception ex)
{
MelonLogger.Error((object)ex);
}
return null;
}
private void Save()
{
showScreen = (bool)TwitchChatInGame.Settings[0].SavedValue;
if (!showScreen && (Object)(object)activeScreen != (Object)null)
{
activeScreen.SetActive(false);
}
int num = whereToPinChat;
whereToPinChat = (int)TwitchChatInGame.Settings[1].SavedValue;
overrideChatPosition = (bool)TwitchChatInGame.Settings[2].SavedValue;
overrideChatRotation = (bool)TwitchChatInGame.Settings[3].SavedValue;
overrideChatScale = (bool)TwitchChatInGame.Settings[4].SavedValue;
toggleableChat = (bool)TwitchChatInGame.Settings[5].SavedValue;
tapToSwitch = (bool)TwitchChatInGame.Settings[6].SavedValue;
chatBackgroundColor = (string)TwitchChatInGame.Settings[7].SavedValue;
chatTextColor = (string)TwitchChatInGame.Settings[8].SavedValue;
chatResponses = (bool)TwitchChatInGame.Settings[9].SavedValue;
blockChatCommands = (bool)TwitchChatInGame.Settings[10].SavedValue;
spawningCooldownTime = (float)TwitchChatInGame.Settings[11].SavedValue;
if ((bool)TwitchChatInGame.Settings[12].SavedValue)
{
TwitchChatInGame.Settings[12].Value = false;
TwitchChatInGame.Settings[12].SavedValue = false;
MelonCoroutines.Start(ReconnectBot());
}
for (int i = 0; i < commands.Count; i++)
{
commands[i].running = (bool)TwitchChatInGame.Settings[i + 13].SavedValue;
}
if (num != whereToPinChat && whereToPinChat == 0)
{
MelonCoroutines.Start(MoveScreenIfNeeded());
}
if (chatBackgroundColor.Length < 6)
{
Log("Chat Background Color too Short!");
chatBackgroundColor = "FFFFFF";
TwitchChatInGame.Settings[5].SavedValue = "FFFFFF";
TwitchChatInGame.Settings[5].Value = "FFFFFF";
}
if (chatTextColor.Length < 6)
{
Log("Chat Text Color too Short!");
chatBackgroundColor = "000000";
TwitchChatInGame.Settings[6].SavedValue = "000000";
TwitchChatInGame.Settings[6].Value = "000000";
}
SetActiveScreenTransform();
LoadOverrideText();
blacklistedNames.Clear();
blacklistedWords.Clear();
string[] array = ReadFileText(FILEPATH, BLACKLISTEDNAMESFILENAME);
string[] array2 = array;
foreach (string text in array2)
{
blacklistedNames.Add(text.ToLower());
}
string[] array3 = ReadFileText(FILEPATH, BLACKLISTEDWORDSFILENAME);
string[] array4 = array3;
foreach (string text2 in array4)
{
blacklistedWords.Add(text2.ToLower());
}
}
[IteratorStateMachine(typeof(<ReconnectBot>d__64))]
private IEnumerator ReconnectBot()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ReconnectBot>d__64(0)
{
<>4__this = this
};
}
private void LoadOverrideText()
{
//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_00a2: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
string[] array = ReadFileText(FILEPATH, OVERRIDEFILENAME);
string[] array2 = (array[0] + " " + array[1] + " " + array[2]).Split(" ");
overridePosition = new Vector3(float.Parse(array2[0], CultureInfo.InvariantCulture), float.Parse(array2[1], CultureInfo.InvariantCulture), float.Parse(array2[2], CultureInfo.InvariantCulture));
overrideRotation = Quaternion.Euler(float.Parse(array2[3], CultureInfo.InvariantCulture), float.Parse(array2[4], CultureInfo.InvariantCulture), float.Parse(array2[5], CultureInfo.InvariantCulture));
overrideScale = new Vector3(float.Parse(array2[6], CultureInfo.InvariantCulture), float.Parse(array2[7], CultureInfo.InvariantCulture), float.Parse(array2[8], CultureInfo.InvariantCulture));
}
private static void SetActiveScreenTransform()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: 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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: 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_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: 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_025d: 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_027c: Unknown result type (might be due to invalid IL or missing references)
//IL_0279: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: 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_0330: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)activeScreen == (Object)null)
{
return;
}
Transform val = null;
Vector3 zero = Vector3.zero;
Vector3 one = Vector3.one;
Quaternion val2 = Quaternion.identity;
switch (whereToPinChat)
{
case 0:
try
{
val = screenSpots[0].transform;
if (showScreen)
{
if (!activeScreen.active)
{
ToggleChat(active: true);
}
}
else
{
activeScreen.SetActive(false);
}
}
catch
{
val = null;
}
((Vector3)(ref zero))..ctor(0f, 0f, 0f);
val2 = Quaternion.Euler(0f, 0f, 0f);
((Vector3)(ref one))..ctor(0.005f, 0.005f, 0.005f);
break;
case 1:
val = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(0).GetChild(1).GetChild(0)
.GetChild(4)
.GetChild(0)
.GetChild(1)
.GetChild(0)
.GetChild(0)
.GetChild(0);
((Vector3)(ref zero))..ctor(0.1f, 0f, 0f);
val2 = Quaternion.Euler(0f, 270f, 30f);
((Vector3)(ref one))..ctor(0.0005f, 0.0005f, 0.0005f);
break;
case 2:
val = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).transform.GetChild(0).GetChild(1).GetChild(0)
.GetChild(4)
.GetChild(0)
.GetChild(2)
.GetChild(0)
.GetChild(0)
.GetChild(0);
((Vector3)(ref zero))..ctor(-0.1f, 0f, 0f);
val2 = Quaternion.Euler(0f, 270f, 30f);
((Vector3)(ref one))..ctor(-0.0005f, 0.0005f, 0.0005f);
break;
}
if ((Object)(object)val != (Object)null)
{
activeScreen.transform.parent = val;
}
activeScreen.transform.localPosition = (overrideChatPosition ? overridePosition : zero);
activeScreen.transform.localRotation = (overrideChatRotation ? overrideRotation : val2);
activeScreen.transform.localScale = (overrideChatScale ? overrideScale : one);
string text = "";
for (int i = 0; i < chatLog.Count; i++)
{
text += chatLog[i];
if (i < chatLog.Count - 1)
{
text = text + Environment.NewLine + Environment.NewLine;
}
}
((TMP_Text)chatTMP).text = text;
((Graphic)rawImage).color = hexToColor(chatBackgroundColor);
((Graphic)chatTMP).color = Color.white;
((TMP_Text)chatTMP).faceColor = Color32.op_Implicit(hexToColor(chatTextColor));
}
public static Color hexToColor(string hex)
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: 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)
hex = hex.Replace("0x", "");
hex = hex.Replace("#", "");
byte b = byte.MaxValue;
byte b2 = byte.Parse(hex.Substring(0, 2), NumberStyles.HexNumber);
byte b3 = byte.Parse(hex.Substring(2, 2), NumberStyles.HexNumber);
byte b4 = byte.Parse(hex.Substring(4, 2), NumberStyles.HexNumber);
return Color32.op_Implicit(new Color32(b2, b3, b4, b));
}
private static void CheckCommands()
{
if (blockChatCommands)
{
return;
}
foreach (ChatCommand command in commands)
{
command.RunCheck();
if (command.commandRan)
{
command.commandRan = false;
break;
}
}
}
[IteratorStateMachine(typeof(<ProcessEntries>d__69))]
private static IEnumerator ProcessEntries()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ProcessEntries>d__69(0);
}
private static void UpdateChatLog()
{
chatLog.Add(chatEntries[0].Sender + ": " + chatEntries[0].Message);
while (chatLog.Count > 5)
{
chatLog.RemoveAt(0);
}
if (!((Object)(object)activeScreen != (Object)null))
{
return;
}
string text = "";
for (int i = 0; i < chatLog.Count; i++)
{
text += chatLog[i];
if (i < chatLog.Count - 1)
{
text = text + Environment.NewLine + Environment.NewLine;
}
}
((TMP_Text)chatTMP).text = text;
}
[IteratorStateMachine(typeof(<CreateScreen>d__72))]
private static IEnumerator CreateScreen(PlayerController playerController)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <CreateScreen>d__72(0)
{
playerController = playerController
};
}
[IteratorStateMachine(typeof(<MoveScreenIfNeeded>d__73))]
private static IEnumerator MoveScreenIfNeeded()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <MoveScreenIfNeeded>d__73(0);
}
private static void CreateScreenSpots()
{
//IL_0a67: Unknown result type (might be due to invalid IL or missing references)
//IL_0a7c: Unknown result type (might be due to invalid IL or missing references)
//IL_0aa0: 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_0040: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: 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_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Expected O, but got Unknown
//IL_00cc: 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_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Expected O, but got Unknown
//IL_0164: 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_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Expected O, but got Unknown
//IL_01da: 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_021c: 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_025d: Expected O, but got Unknown
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
//IL_02b3: Expected O, but got Unknown
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: Unknown result type (might be due to invalid IL or missing references)
//IL_0347: Unknown result type (might be due to invalid IL or missing references)
//IL_034e: Expected O, but got Unknown
//IL_0388: 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)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03e9: Expected O, but got Unknown
//IL_0423: Unknown result type (might be due to invalid IL or missing references)
//IL_0444: 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_047d: Unknown result type (might be due to invalid IL or missing references)
//IL_0484: Expected O, but got Unknown
//IL_04be: Unknown result type (might be due to invalid IL or missing references)
//IL_04df: 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_0518: Unknown result type (might be due to invalid IL or missing references)
//IL_051f: Expected O, but got Unknown
//IL_0559: Unknown result type (might be due to invalid IL or missing references)
//IL_057a: Unknown result type (might be due to invalid IL or missing references)
//IL_059b: Unknown result type (might be due to invalid IL or missing references)
//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
//IL_05dc: Expected O, but got Unknown
//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
//IL_060b: Unknown result type (might be due to invalid IL or missing references)
//IL_0620: Unknown result type (might be due to invalid IL or missing references)
//IL_062b: Unknown result type (might be due to invalid IL or missing references)
//IL_0632: Expected O, but got Unknown
//IL_066c: Unknown result type (might be due to invalid IL or missing references)
//IL_068d: Unknown result type (might be due to invalid IL or missing references)
//IL_069f: Unknown result type (might be due to invalid IL or missing references)
//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
//IL_06be: Expected O, but got Unknown
//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0719: Unknown result type (might be due to invalid IL or missing references)
//IL_072b: 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_074a: Expected O, but got Unknown
//IL_0784: Unknown result type (might be due to invalid IL or missing references)
//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
//IL_07b7: 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_07d6: Expected O, but got Unknown
//IL_0810: Unknown result type (might be due to invalid IL or missing references)
//IL_0831: Unknown result type (might be due to invalid IL or missing references)
//IL_0852: Unknown result type (might be due to invalid IL or missing references)
//IL_086a: Unknown result type (might be due to invalid IL or missing references)
//IL_0871: Expected O, but got Unknown
//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
//IL_08cc: Unknown result type (might be due to invalid IL or missing references)
//IL_08de: Unknown result type (might be due to invalid IL or missing references)
//IL_08f6: Unknown result type (might be due to invalid IL or missing references)
//IL_08fd: Expected O, but got Unknown
//IL_0937: Unknown result type (might be due to invalid IL or missing references)
//IL_0958: Unknown result type (might be due to invalid IL or missing references)
//IL_0979: Unknown result type (might be due to invalid IL or missing references)
//IL_0991: Unknown result type (might be due to invalid IL or missing references)
//IL_0998: Expected O, but got Unknown
//IL_09d2: Unknown result type (might be due to invalid IL or missing references)
//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0a14: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)screenSpotsParent == (Object)null)
{
screenSpots.Clear();
if (currentScene == "Map0")
{
screenSpotsParent = new GameObject();
((Object)screenSpotsParent).name = "TwitchChatBoxSpots";
screenSpotsParent.transform.position = Vector3.zero;
screenSpotsParent.transform.rotation = Quaternion.identity;
screenSpotsParent.transform.localScale = Vector3.one;
GameObject val = new GameObject();
((Object)val).name = "TwitchChatBoxSpot";
val.transform.parent = screenSpotsParent.transform;
val.transform.position = new Vector3(0f, 3.3564f, -17.784f);
val.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
val.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f);
screenSpots.Add(val);
}
else if (currentScene == "Map1")
{
screenSpotsParent = new GameObject();
((Object)screenSpotsParent).name = "TwitchChatBoxSpots";
screenSpotsParent.transform.position = Vector3.zero;
screenSpotsParent.transform.rotation = Quaternion.identity;
screenSpotsParent.transform.localScale = Vector3.one;
GameObject val2 = new GameObject();
((Object)val2).name = "TwitchChatBoxSpot";
val2.transform.parent = screenSpotsParent.transform;
val2.transform.position = new Vector3(-14.1509f, 5.7582f, -2.8364f);
val2.transform.rotation = Quaternion.Euler(0f, 244.3657f, 0f);
val2.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f);
screenSpots.Add(val2);
}
else if (currentScene == "Gym")
{
screenSpotsParent = new GameObject();
((Object)screenSpotsParent).name = "TwitchChatBoxSpots";
screenSpotsParent.transform.position = Vector3.zero;
screenSpotsParent.transform.rotation = Quaternion.identity;
screenSpotsParent.transform.localScale = Vector3.one;
GameObject val3 = new GameObject();
((Object)val3).name = "TwitchChatBoxSpot";
val3.transform.parent = screenSpotsParent.transform;
val3.transform.position = new Vector3(-0.5035f, 1.5563f, -2.3288f);
val3.transform.rotation = Quaternion.Euler(0f, 280.8829f, 0f);
val3.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f);
screenSpots.Add(val3);
GameObject val4 = new GameObject();
((Object)val4).name = "TwitchChatBoxSpot";
val4.transform.parent = screenSpotsParent.transform;
val4.transform.position = new Vector3(15.5529f, -1.9519f, -12.4259f);
val4.transform.rotation = Quaternion.Euler(0f, 62.4684f, 0f);
val4.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
screenSpots.Add(val4);
GameObject val5 = new GameObject();
((Object)val5).name = "TwitchChatBoxSpot";
val5.transform.parent = screenSpotsParent.transform;
val5.transform.position = new Vector3(-15.2944f, 0.7143f, 2.0057f);
val5.transform.rotation = Quaternion.Euler(0f, 290.1123f, 0f);
val5.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
screenSpots.Add(val5);
GameObject val6 = new GameObject();
((Object)val6).name = "TwitchChatBoxSpot";
val6.transform.parent = screenSpotsParent.transform;
val6.transform.position = new Vector3(-27.2884f, 4.2261f, 2.7007f);
val6.transform.rotation = Quaternion.Euler(0f, 97.1124f, 0f);
val6.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
screenSpots.Add(val6);
GameObject val7 = new GameObject();
((Object)val7).name = "TwitchChatBoxSpot";
val7.transform.parent = screenSpotsParent.transform;
val7.transform.position = new Vector3(-23.8473f, 0.9042f, -21.8762f);
val7.transform.rotation = Quaternion.Euler(0f, 258.3796f, 0f);
val7.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
screenSpots.Add(val7);
}
else if (currentScene == "Park")
{
screenSpotsParent = new GameObject();
((Object)screenSpotsParent).name = "TwitchChatBoxSpots";
screenSpotsParent.transform.position = Vector3.zero;
screenSpotsParent.transform.rotation = Quaternion.identity;
screenSpotsParent.transform.localScale = Vector3.one;
GameObject val8 = new GameObject();
((Object)val8).name = "TwitchChatBoxSpot";
val8.transform.parent = screenSpotsParent.transform;
val8.transform.position = new Vector3(7.245f, -3.7736f, 3.8686f);
val8.transform.rotation = Quaternion.Euler(0f, 63.7015f, 0f);
val8.transform.localScale = Vector3.one;
screenSpots.Add(val8);
GameObject val9 = new GameObject();
((Object)val9).name = "TwitchChatBoxSpot";
val9.transform.parent = screenSpotsParent.transform;
val9.transform.position = new Vector3(-29.3567f, -4.0141f, 7.6952f);
val9.transform.rotation = Quaternion.Euler(0f, 253.9577f, 0f);
val9.transform.localScale = Vector3.one;
screenSpots.Add(val9);
GameObject val10 = new GameObject();
((Object)val10).name = "TwitchChatBoxSpot";
val10.transform.parent = screenSpotsParent.transform;
val10.transform.position = new Vector3(-16.175f, -1.6388f, -17.111f);
val10.transform.rotation = Quaternion.Euler(0f, 163.0112f, 0f);
val10.transform.localScale = Vector3.one;
screenSpots.Add(val10);
GameObject val11 = new GameObject();
((Object)val11).name = "TwitchChatBoxSpot";
val11.transform.parent = screenSpotsParent.transform;
val11.transform.position = new Vector3(22.8701f, -1.7166f, -9.9974f);
val11.transform.rotation = Quaternion.Euler(0f, 78.1961f, 0f);
val11.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
screenSpots.Add(val11);
GameObject val12 = new GameObject();
((Object)val12).name = "TwitchChatBoxSpot";
val12.transform.parent = screenSpotsParent.transform;
val12.transform.position = new Vector3(34.8067f, 3.35f, 4.1303f);
val12.transform.rotation = Quaternion.Euler(0f, 78.1961f, 0f);
val12.transform.localScale = Vector3.one;
screenSpots.Add(val12);
GameObject val13 = new GameObject();
((Object)val13).name = "TwitchChatBoxSpot";
val13.transform.parent = screenSpotsParent.transform;
val13.transform.position = new Vector3(20.7936f, 5.5078f, 27.1216f);
val13.transform.rotation = Quaternion.Euler(0f, 43.9476f, 0f);
val13.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
screenSpots.Add(val13);
GameObject val14 = new GameObject();
((Object)val14).name = "TwitchChatBoxSpot";
val14.transform.parent = screenSpotsParent.transform;
val14.transform.position = new Vector3(-6.2776f, -1.6804f, 24.1848f);
val14.transform.rotation = Quaternion.Euler(0f, 320.6074f, 0f);
val14.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
screenSpots.Add(val14);
}
}
if (whereToPinChat == 0)
{
activeScreen.transform.parent = screenSpots[0].transform;
activeScreen.transform.localPosition = Vector3.zero;
activeScreen.transform.localRotation = Quaternion.identity;
activeScreen.transform.localScale = new Vector3(0.005f, 0.005f, 0.005f);
}
}
[IteratorStateMachine(typeof(<ScreenFade>d__75))]
private static IEnumerator ScreenFade()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ScreenFade>d__75(0);
}
[IteratorStateMachine(typeof(<ReadEntries>d__76))]
private IEnumerator ReadEntries()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ReadEntries>d__76(0)
{
<>4__this = this
};
}
public override void OnApplicationQuit()
{
if (fileFound)
{
Log("Stopping Twitch Bot");
}
fileFound = false;
chat.Dispose();
}
private static void Write(string msg, bool overrideResponses = false)
{
if (chatResponses || overrideResponses)
{
msg = msg.Replace("{sender}", chatEntries[0].Sender);
int num = 500;
while (msg.Length > num)
{
string chatMessage = msg.Substring(0, num);
msg = msg.Substring(num);
chat.Write(chatMessage);
}
if (msg != "")
{
chat.Write(msg);
}
}
}
public static void Log(string msg)
{
MelonLogger.Msg(msg);
}
}
}