Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
official-notfishvr committed Feb 25, 2024
1 parent 0685031 commit 8be6b2b
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 15 deletions.
71 changes: 64 additions & 7 deletions MainMenu/ConsoleUtility.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
OKAA Code
https://discord.gg/401
*/

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
Expand All @@ -13,6 +8,68 @@ namespace Fish_Menu.MainMenu
{
public class ConsoleUtility : MonoBehaviour
{
// had to remove bc of fucking okaa his a fucking ass
[DllImport("kernel32.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)]
private static extern int AllocConsole();

[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool SetConsoleTitle(string lpConsoleTitle);

[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool WriteConsole(IntPtr hConsoleOutput, string lpBuffer, uint nNumberOfCharsToWrite, out uint lpNumberOfCharsWritten, IntPtr lpReserved);

[DllImport("kernel32.dll", SetLastError = true)]
private static extern IntPtr GetStdHandle(int nStdHandle);

[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool SetConsoleTextAttribute(IntPtr hConsoleOutput, uint wAttributes);

public static void OpenConsoleWindow()
{
ConsoleUtility.AllocConsole();
ConsoleUtility.SetConsoleTitle("Console [Initializing]");
ConsoleUtility.WriteToConsole("Debug log started!", ConsoleColor.Green);
Debug.Log("Console was started!");
ConsoleUtility.SetConsoleTitle("Console [Ready]");
}
public static void WriteToConsole(string message, ConsoleColor color)
{
IntPtr stdHandle = ConsoleUtility.GetStdHandle(-11);
message += "\n";
ConsoleUtility.SetConsoleTextAttribute(stdHandle, (uint)color);
uint num;
ConsoleUtility.WriteConsole(stdHandle, message, (uint)message.Length, out num, IntPtr.Zero);
ConsoleUtility.SetConsoleTextAttribute(stdHandle, 15U);
}
public static void WriteLine(string text)
{
string text2 = "[INFO]: " + text;
IntPtr stdHandle = ConsoleUtility.GetStdHandle(-11);
text2 += "\n";
ConsoleUtility.SetConsoleTextAttribute(stdHandle, 15U);
uint num;
ConsoleUtility.WriteConsole(stdHandle, text2, (uint)text2.Length, out num, IntPtr.Zero);
ConsoleUtility.SetConsoleTextAttribute(stdHandle, 15U);
}
public static void LCE(string message)
{
IntPtr stdHandle = ConsoleUtility.GetStdHandle(-11);
message += "\n";
ConsoleUtility.SetConsoleTextAttribute(stdHandle, 12U);
uint num;
ConsoleUtility.WriteConsole(stdHandle, message, (uint)message.Length, out num, IntPtr.Zero);
ConsoleUtility.SetConsoleTextAttribute(stdHandle, 15U);
}
public static IntPtr FindConsoleWindow(string windowName)
{
return ConsoleUtility.FindWindow(null, windowName);
}
public static IntPtr GetConsole()
{
return ConsoleUtility.FindWindow("cmd", null);
}
private static int co;
}
}
}
75 changes: 67 additions & 8 deletions MainMenu/Main.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Debug = UnityEngine.Debug;
using Debug = UnityEngine.Debug;
using Random = UnityEngine.Random;
using Color = UnityEngine.Color;
using Object = UnityEngine.Object;
Expand Down Expand Up @@ -38,6 +38,7 @@
using ExitGames.Client.Photon.StructWrapping;
using static UnityEngine.Rendering.DebugUI;
using static UnityEngine.UI.GridLayoutGroup;
using UnityEngine.UIElements;

namespace Fish_Menu.MainMenu
{
Expand All @@ -47,6 +48,7 @@ public class Loader : BaseUnityPlugin
{
public void FixedUpdate()
{
Debug.unityLogger.logEnabled = false;
if (!GameObject.Find("Loader") && GorillaLocomotion.Player.hasInstance)
{
GameObject Loader = new GameObject("Loader");
Expand Down Expand Up @@ -212,7 +214,10 @@ public class MenuPatch : MonoBehaviourPunCallbacks
"Acid Gun", // 3
"Acid Mat Spam", // 4
"Crash All", // 5
"a", // 5
"Score Board FUp", // 6
"Rise Lava", // 7
"Drain Lava", // 8
"Erupt Lava", // 9
};
#endregion
#endregion
Expand Down Expand Up @@ -2441,10 +2446,48 @@ private static void Prefix()
PhotonNetwork.CurrentRoom.CustomProperties.TryGetValue("gameMode", out obj);
if (obj.ToString().Contains("MODDED"))
{

foreach (GorillaScoreBoard sB in UnityEngine.Object.FindObjectsOfType(typeof(GorillaScoreBoard)))
{
for (int i = 0; i < sB.lines.Count; i++)
{
GorillaPlayerScoreboardLine gorillaPlayerScoreboardLine = sB.lines[i];
gorillaPlayerScoreboardLine.ResetData();
}
}
/*for (int j = 0; j < GorillaScoreboardTotalUpdater.allScoreboards.Count; j++)
{
if (string.IsNullOrEmpty(GorillaScoreboardTotalUpdater.allScoreboards[j].initialGameMode))
{
GorillaScoreboardTotalUpdater.instance.UpdateScoreboard(GorillaScoreboardTotalUpdater.allScoreboards[j]);
}
}*/
foreach (GorillaPlayerScoreboardLine sB in UnityEngine.Object.FindObjectsOfType(typeof(GorillaPlayerScoreboardLine)))
{
foreach (Photon.Realtime.Player player in PhotonNetwork.PlayerList)
{
sB.linePlayer = player;
sB.toxicityButton.SetActive(true);
sB.reportButton.isOn = sB.reportedToxicity;
sB.reportButton.UpdateColor();
//PlayerPrefs.SetInt(sB.linePlayer.UserId, 1);
sB.muteButton.UpdateColor();
sB.SetLineData(player);
sB.UpdateLine();
sB.parentScoreboard.RedrawPlayerLines();
}
foreach (GorillaScoreboardTotalUpdater sB2 in UnityEngine.Object.FindObjectsOfType(typeof(GorillaScoreboardTotalUpdater)))
{
GorillaScoreboardTotalUpdater.lineIndex = 11;
GorillaScoreboardTotalUpdater.allScoreboardLines[GorillaScoreboardTotalUpdater.lineIndex].UpdateLine();
sB2.UpdateLineState(sB);
}
}
return;
}
}
if (OPButtonsActive[7] == true) { Mods.MainStuff.OpMods.SetLavaState(InfectionLavaController.RisingLavaState.Full); }
if (OPButtonsActive[8] == true) { Mods.MainStuff.OpMods.SetLavaState(InfectionLavaController.RisingLavaState.Drained); }
if (OPButtonsActive[9] == true) { Mods.MainStuff.OpMods.SetLavaState(InfectionLavaController.RisingLavaState.Erupting); }
#endregion
}
catch (Exception ex)
Expand Down Expand Up @@ -2875,6 +2918,23 @@ public static void AcidKid(Player player)
Traverse.Create(ScienceExperimentManager.instance).Field("inGamePlayerStates").SetValue(playerStates);
}
}
public static void SetLavaState(InfectionLavaController.RisingLavaState state)
{
InfectionLavaController instance = InfectionLavaController.Instance;

Type type = typeof(InfectionLavaController);
FieldInfo reliableStateField = type.GetField("reliableState", BindingFlags.Instance | BindingFlags.NonPublic);

object reliableState = reliableStateField.GetValue(instance);

Type reliableStateType = reliableState.GetType();
FieldInfo stateField = reliableStateType.GetField("state");
FieldInfo stateStartTimeField = reliableStateType.GetField("stateStartTime");

stateField.SetValue(reliableState, state);
stateStartTimeField.SetValue(reliableState, PhotonNetwork.Time);
reliableStateField.SetValue(instance, reliableState);
}
}
public class BasicMods
{
Expand Down Expand Up @@ -4520,6 +4580,8 @@ public static void Toggle(string relatedText, string[] btns, bool[] btnsActive)
private float startingToLookForFriend;
public static bool AntiBanOn = false;
public static string OldName;
public static FieldInfo fi1 = typeof(InfectionLavaController).GetField("fullTime", BindingFlags.NonPublic);
public static InfectionLavaController.RisingLavaState fi1a;
private static readonly RaiseEventOptions KickOptions = new RaiseEventOptions
{
CachingOption = EventCaching.AddToRoomCacheGlobal
Expand Down Expand Up @@ -4689,7 +4751,6 @@ private void DrawMainTab()

ToggleMain[1] = ToggleButton("Disconnect", ToggleMain[1]);
ToggleMain[2] = ToggleButton("Join Random Room", ToggleMain[2]);
ToggleMain[3] = ToggleButton("Kick All", ToggleMain[3]);

GUILayout.EndScrollView();
}
Expand Down Expand Up @@ -5023,8 +5084,7 @@ public void Update()
}
if (ToggleMain[3])
{
ExecuteCloudScriptRequest executeCloudScriptRequest = new ExecuteCloudScriptRequest();
Debug.Log($"{executeCloudScriptRequest.FunctionName}");

}
}
#region Main GUI
Expand Down Expand Up @@ -5275,7 +5335,6 @@ public bool HasPlayerTouchedLiquid(Photon.Realtime.Player player)
}
private IEnumerator AntiBan()
{

if (!PhotonNetwork.CurrentRoom.CustomProperties["gameMode"].ToString().Contains("MODDED"))
{
ExecuteCloudScriptRequest executeCloudScriptRequest = new ExecuteCloudScriptRequest();
Expand Down Expand Up @@ -5645,4 +5704,4 @@ public static Player GetRandomPlayer(bool includeSelf)
}
}
#endregion
}
}

0 comments on commit 8be6b2b

Please sign in to comment.