-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
161 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using HarmonyLib; | ||
using Il2CppSystem.Collections.Generic; | ||
using System; | ||
using BepInEx; | ||
using System.IO; | ||
using BepInEx.Configuration; | ||
|
||
namespace MalumMenu; | ||
|
||
[HarmonyPatch(typeof(PlayerPhysics), nameof(PlayerPhysics.LateUpdate))] | ||
public static class RPC_SaveSpoofDataPostfix | ||
{ | ||
//Postfix patch of PlayerPhysics.LateUpdate to open player pick menu to kick any player | ||
public static bool isActive; | ||
public static ConfigFile userSpoofSaveFile = new ConfigFile(Path.Combine(Paths.ConfigPath, "MM_SavedSpoofData.cfg"), true); | ||
public static void Postfix(PlayerPhysics __instance){ | ||
if (CheatSettings.saveSpoofData){ | ||
|
||
if (!isActive){ | ||
|
||
//Close any player pick menus already open & their cheats | ||
if (Utils_PlayerPickMenu.playerpickMenu != null){ | ||
Utils_PlayerPickMenu.playerpickMenu.Close(); | ||
CheatSettings.spectate = CheatSettings.kickPlayer = CheatSettings.callMeeting = CheatSettings.shapeshiftAll = CheatSettings.copyOutfit = CheatSettings.teleportPlayer = CheatSettings.murderPlayer = false; | ||
} | ||
|
||
List<PlayerControl> playerList = new List<PlayerControl>(); | ||
|
||
//All players are saved to playerList apart from LocalPlayer | ||
foreach (var player in PlayerControl.AllPlayerControls){ | ||
if (!player.AmOwner){ | ||
playerList.Add(player); | ||
} | ||
} | ||
|
||
//New player pick menu made for kicking players | ||
Utils_PlayerPickMenu.openPlayerPickMenu(playerList, (Action) (() => | ||
{ | ||
var friendCode = userSpoofSaveFile.Bind($"SpoofData.{Utils_PlayerPickMenu.targetPlayer.Data.PlayerName}", | ||
"FriendCode", | ||
""); | ||
friendCode.Value = AmongUsClient.Instance.GetClientFromCharacter(Utils_PlayerPickMenu.targetPlayer).FriendCode; | ||
|
||
var puid = userSpoofSaveFile.Bind($"SpoofData.{Utils_PlayerPickMenu.targetPlayer.Data.PlayerName}", | ||
"ProductUserID", | ||
""); | ||
puid.Value = AmongUsClient.Instance.GetClientFromCharacter(Utils_PlayerPickMenu.targetPlayer).ProductUserId; | ||
})); | ||
|
||
isActive = true; | ||
} | ||
|
||
//Deactivate cheat if menu is closed | ||
if (Utils_PlayerPickMenu.playerpickMenu == null){ | ||
CheatSettings.saveSpoofData = false; | ||
} | ||
|
||
}else{ | ||
if (isActive){ | ||
isActive = false; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using HarmonyLib; | ||
|
||
namespace MalumMenu; | ||
|
||
[HarmonyPatch(typeof(EOSManager), nameof(EOSManager.ProductUserId), MethodType.Getter)] | ||
public static class Passive_SpoofedPUIDPostfix | ||
{ | ||
public static void Postfix(ref string __result) | ||
{ | ||
if (CheatSettings.customUserData){ | ||
if (MalumPlugin.spoofPuid.Value != ""){ | ||
__result = MalumPlugin.spoofPuid.Value; | ||
} | ||
} | ||
} | ||
} | ||
|
||
[HarmonyPatch(typeof(EOSManager), nameof(EOSManager.Update))] | ||
public static class Passive_SpoofedFriendCodePostfix | ||
{ | ||
public static void Postfix(EOSManager __instance) | ||
{ | ||
if (CheatSettings.customUserData){ | ||
if (MalumPlugin.spoofPuid.Value != "" && MalumPlugin.spoofPuid.Value != __instance.FriendCode){ | ||
__instance.FriendCode = MalumPlugin.spoofPuid.Value; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters