v1.9.0.0 update
- made it work in v461 - improved project structure
This commit is contained in:
parent
5df7dca06f
commit
d823e55e92
13 changed files with 112 additions and 71 deletions
26
WBM/Util.cs
26
WBM/Util.cs
|
@ -6,6 +6,7 @@ using System.Text;
|
|||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using CPersonGun = LELHDOPKMBE;
|
||||
|
||||
namespace WBM
|
||||
{
|
||||
|
@ -45,29 +46,34 @@ namespace WBM
|
|||
return String.Format("{0:0.0}", number);
|
||||
}
|
||||
|
||||
public static float getGunZoom(CGMPHDEJMIG gun)
|
||||
public static float getGunZoom(CPersonGun gun)
|
||||
{
|
||||
return gun.EGDGNFIOIPO;
|
||||
// CPersonGun.cameraZoom
|
||||
return gun.CAAABKHHGLM;
|
||||
}
|
||||
|
||||
public static float getGunFireTimer(CGMPHDEJMIG gun)
|
||||
public static float getGunFireTimer(CPersonGun gun)
|
||||
{
|
||||
return gun.ALHAPEJFBMM;
|
||||
// CPersonGun.fireTimer
|
||||
return gun.HDDNCAICDOJ;
|
||||
}
|
||||
|
||||
public static float getGunFireVelocity(CGMPHDEJMIG gun)
|
||||
public static float getGunFireVelocity(CPersonGun gun)
|
||||
{
|
||||
return gun.CPKKPKBEDGG;
|
||||
// CPersonGun.fireVel
|
||||
return gun.IMNMEFPBAAM;
|
||||
}
|
||||
|
||||
public static float getGunFireRate(CGMPHDEJMIG gun)
|
||||
public static float getGunFireRate(CPersonGun gun)
|
||||
{
|
||||
return gun.DPACFNHLIKA;
|
||||
// CPersonGun.fireRate
|
||||
return gun.LCDDGLKGKCO;
|
||||
}
|
||||
|
||||
public static float getGunReloadTimer(CGMPHDEJMIG gun)
|
||||
public static float getGunReloadTimer(CPersonGun gun)
|
||||
{
|
||||
return gun.PMLOOHEKAGB;
|
||||
// CPersonGun.reloadTimer
|
||||
return gun.ILBBFNBJJKI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,9 +8,13 @@ namespace WBM
|
|||
/// are event functions that gets called on specific stages of the component's lifecycle.
|
||||
/// More information can be found in the <see href="https://docs.unity3d.com/Manual/ExecutionOrder.html">unity's documentation page</see>.
|
||||
/// </summary>
|
||||
[BepInPlugin("com.developomp.wbm", "War Brokers Mods", "1.8.0.0")]
|
||||
[BepInPlugin(WBM.programID, WBM.programName, WBM.programVersion)]
|
||||
public partial class WBM : BaseUnityPlugin
|
||||
{
|
||||
public const string programID = "com.developomp.wbm";
|
||||
public const string programName = "War Brokers Mods";
|
||||
public const string programVersion = "1.9.0.0";
|
||||
|
||||
/// This function is called as soon as the component becomes active.
|
||||
/// It is the first event function that's called during the component's lifecycle.
|
||||
private void Awake()
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace WBM
|
|||
|
||||
private void setupClearChat()
|
||||
{
|
||||
this.drawChatMessageFuncRef = webguyType.GetMethod("MEDCOGOAHEN", bindFlags);
|
||||
this.drawChatMessageFuncRef = webguyType.GetMethod(MangledNames.drawChatMessage, bindFlags);
|
||||
this.clearChatShortcut = Config.Bind("Hotkeys", "clear chat", new KeyboardShortcut(KeyCode.Z, KeyCode.RightShift));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
using BepInEx.Configuration;
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
namespace WBM
|
||||
{
|
||||
partial class WBM
|
||||
{
|
||||
private ConfigEntry<KeyboardShortcut> clearDeathLogShortcut;
|
||||
|
||||
private MethodInfo clearMessagesFuncRef;
|
||||
|
||||
private void setupClearMessage()
|
||||
{
|
||||
this.clearMessagesFuncRef = webguyType.GetMethod(MangledNames.clearMessages, bindFlags);
|
||||
}
|
||||
|
||||
private void doclearMessage()
|
||||
{
|
||||
if (this.clearDeathLogShortcut.Value.IsDown()) this.clearMessagesFuncRef.Invoke(this.webguy, new object[] { });
|
||||
|
|
|
@ -9,6 +9,8 @@ using System.IO;
|
|||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using CPersonGun = LELHDOPKMBE;
|
||||
using SPlayerStats = BBOACLMHKLF;
|
||||
|
||||
namespace WBM
|
||||
{
|
||||
|
@ -93,34 +95,32 @@ namespace WBM
|
|||
StartCoroutine(this.UpdateValues);
|
||||
}
|
||||
|
||||
private MethodInfo clearMessagesFuncRef;
|
||||
|
||||
private FieldInfo playerStatsArrayRef;
|
||||
private Data.PlayerStatsStruct[] playerStatsArrayRaw
|
||||
{
|
||||
get
|
||||
{
|
||||
IACNKEGEEAG[] rawPlayerStatsArray = (IACNKEGEEAG[])this.playerStatsArrayRef.GetValue(this.webguy);
|
||||
SPlayerStats[] rawPlayerStatsArray = (SPlayerStats[])this.playerStatsArrayRef.GetValue(this.webguy);
|
||||
Data.PlayerStatsStruct[] result = new Data.PlayerStatsStruct[rawPlayerStatsArray.Length];
|
||||
|
||||
for (int i = 0; i < rawPlayerStatsArray.Length; i++)
|
||||
{
|
||||
IACNKEGEEAG currentlyParsing = rawPlayerStatsArray[i];
|
||||
SPlayerStats currentlyParsing = rawPlayerStatsArray[i];
|
||||
|
||||
result[i] = new Data.PlayerStatsStruct
|
||||
{
|
||||
kills = currentlyParsing.IOOFDGPKMFK,
|
||||
deaths = currentlyParsing.FOKKPNMGKDP,
|
||||
damage = currentlyParsing.HABIHPNAEHO,
|
||||
longestKill = currentlyParsing.CEKBGCGKILN,
|
||||
points = currentlyParsing.FOBEJABPFJJ,
|
||||
headShots = currentlyParsing.NPMFKNDMOHB,
|
||||
vote = currentlyParsing.DGKDCINHCEA,
|
||||
mapVote = currentlyParsing.OCEJJALAMJI,
|
||||
gamesElo = currentlyParsing.EFMOAKCIAJP,
|
||||
gamesEloDelta = currentlyParsing.AAGINDPBBJJ,
|
||||
killsElo = currentlyParsing.FIEJIAFBDJP,
|
||||
killsEloDelta = currentlyParsing.MBJFMGKHFPM,
|
||||
kills = currentlyParsing.GPLIPBNIDNC,
|
||||
deaths = currentlyParsing.DKJCHCPBADP,
|
||||
damage = currentlyParsing.EOPJFDCLCCL,
|
||||
longestKill = currentlyParsing.MPJBKDPMLBD,
|
||||
points = currentlyParsing.IEJEOANMHKI,
|
||||
headShots = currentlyParsing.PEJJONGBLLH,
|
||||
vote = currentlyParsing.BIPKEJFKPGD,
|
||||
mapVote = currentlyParsing.FLOHPDGHOOG,
|
||||
gamesElo = currentlyParsing.EAFMCHFNJAL,
|
||||
gamesEloDelta = currentlyParsing.GPLEHHJJCIN,
|
||||
killsElo = currentlyParsing.GOJIAOADAJJ,
|
||||
killsEloDelta = currentlyParsing.IPICEMAAMBM,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -153,14 +153,14 @@ namespace WBM
|
|||
}
|
||||
|
||||
private FieldInfo personGunRef;
|
||||
private CGMPHDEJMIG personGunRaw
|
||||
private CPersonGun personGunRaw
|
||||
{
|
||||
get
|
||||
{
|
||||
return (CGMPHDEJMIG)this.personGunRef.GetValue(this.webguy);
|
||||
return (CPersonGun)this.personGunRef.GetValue(this.webguy);
|
||||
}
|
||||
}
|
||||
private CGMPHDEJMIG personGun;
|
||||
private CPersonGun personGun;
|
||||
|
||||
private FieldInfo nickListRef;
|
||||
private string[] nickListRaw
|
||||
|
@ -202,7 +202,7 @@ namespace WBM
|
|||
|
||||
private void initCore()
|
||||
{
|
||||
this.harmony = new Harmony("com.developomp.wbm");
|
||||
this.harmony = new Harmony(WBM.programID);
|
||||
this.harmony.PatchAll();
|
||||
}
|
||||
|
||||
|
@ -215,16 +215,15 @@ namespace WBM
|
|||
// References
|
||||
//
|
||||
|
||||
this.playerStatsArrayRef = webguyType.GetField("FLDPBAEABJG", bindFlags);
|
||||
this.teamListRef = webguyType.GetField("BFMPAFOBMKP", bindFlags);
|
||||
this.localPlayerIndexRef = webguyType.GetField("AEILDFPIIGG", bindFlags);
|
||||
this.personGunRef = webguyType.GetField("IDKKPOAJPMC", bindFlags);
|
||||
this.nickListRef = webguyType.GetField("MOOLDAMLJLO", bindFlags);
|
||||
this.gameStateRef = webguyType.GetField("NKADGEOAKKB", bindFlags);
|
||||
this.chatListRef = webguyType.GetField("PODNOOGFEFE", bindFlags);
|
||||
this.playerStatsArrayRef = webguyType.GetField(MangledNames.statsList, bindFlags);
|
||||
this.teamListRef = webguyType.GetField(MangledNames.teamList, bindFlags);
|
||||
this.localPlayerIndexRef = webguyType.GetField(MangledNames.localPlayerIndex, bindFlags);
|
||||
this.personGunRef = webguyType.GetField(MangledNames.personGun, bindFlags);
|
||||
this.nickListRef = webguyType.GetField(MangledNames.nickList, bindFlags);
|
||||
this.gameStateRef = webguyType.GetField(MangledNames.gameState, bindFlags);
|
||||
this.chatListRef = webguyType.GetField(MangledNames.chatList, bindFlags);
|
||||
|
||||
this.addMessageFuncRef = webguyType.GetMethod("NNLPKKPEBOF", bindFlags);
|
||||
this.clearMessagesFuncRef = webguyType.GetMethod("EIHHBPDPNDF", bindFlags);
|
||||
this.addMessageFuncRef = webguyType.GetMethod(MangledNames.addMessage, bindFlags);
|
||||
|
||||
//
|
||||
// Configurations
|
||||
|
|
|
@ -55,9 +55,9 @@ kill streak SFX: {this.killStreakSFX.Value} ({this.killStreakSFXShortcut.Value})
|
|||
{
|
||||
GUI.Box(
|
||||
new Rect(this.GUIOffsetX.Value, this.GUIOffsetY.Value, 220, 60),
|
||||
@"War Brokers Mods
|
||||
$@"{WBM.programName}
|
||||
Made by [LP] POMP
|
||||
v1.8.0.0"
|
||||
v{WBM.programVersion}"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace WBM
|
|||
{
|
||||
/// patch for onFPSChanged function
|
||||
[HarmonyPatch(typeof(webguy))]
|
||||
[HarmonyPatch("LIJHKNOLECJ")]
|
||||
[HarmonyPatch(MangledNames.onFPSChanged)]
|
||||
class FPSSliderPatch
|
||||
{
|
||||
private static int defaultTargetFrameRate = -1;
|
||||
|
@ -15,21 +15,21 @@ namespace WBM
|
|||
|
||||
private static GameObject fpsSliderTextObj = GameObject.Find("fpsSlideFuckText");
|
||||
private static Slider slider = GameObject.Find("fpsSlider").GetComponent<Slider>();
|
||||
private static AccessTools.FieldRef<webguy, float> fpsValueRef = AccessTools.FieldRefAccess<webguy, float>("KLAKEIFEFMH");
|
||||
private static AccessTools.FieldRef<webguy, float> fpsValueRef = AccessTools.FieldRefAccess<webguy, float>(MangledNames.fpsValue);
|
||||
|
||||
static bool Prefix(webguy __instance, float EJPANIOHKEC)
|
||||
static bool Prefix(webguy __instance, float KFBLINBNKHI)
|
||||
{
|
||||
fpsValueRef(__instance) = EJPANIOHKEC;
|
||||
int targetFrameRate = (int)(EJPANIOHKEC * maxTargetFrameRate);
|
||||
fpsValueRef(__instance) = KFBLINBNKHI;
|
||||
int targetFrameRate = (int)(KFBLINBNKHI * maxTargetFrameRate);
|
||||
|
||||
if (targetFrameRate == 0)
|
||||
{
|
||||
((InfernalBehaviour)__instance).NKANMPOLMOA(fpsSliderTextObj, __instance.HOLCODAHDKF("Disabled"));
|
||||
((InfernalBehaviour)__instance).GHLANFKABIH(fpsSliderTextObj, __instance.LMOKBIHLKFK("Disabled"));
|
||||
targetFrameRate = defaultTargetFrameRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
((InfernalBehaviour)__instance).NKANMPOLMOA(fpsSliderTextObj, targetFrameRate.ToString());
|
||||
((InfernalBehaviour)__instance).GHLANFKABIH(fpsSliderTextObj, targetFrameRate.ToString());
|
||||
}
|
||||
|
||||
if (targetFrameRate > 0 && targetFrameRate < 5) targetFrameRate = 5;
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
using BepInEx.Configuration;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
using CAudioClip = HKPCKNFOBNA;
|
||||
using CAudioClip = DMJGLPCLOPG;
|
||||
|
||||
namespace WBM
|
||||
{
|
||||
|
@ -14,14 +12,14 @@ namespace WBM
|
|||
private ConfigEntry<bool> useOldGunSoundConf;
|
||||
|
||||
private FieldInfo oldGunSoundRef;
|
||||
private AudioClip oldGunSoundRaw
|
||||
private CAudioClip oldGunSoundRaw
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((CAudioClip)this.oldGunSoundRef.GetValue(this.webguy)).DDKAHAAKKME;
|
||||
return (CAudioClip)this.oldGunSoundRef.GetValue(this.webguy);
|
||||
}
|
||||
}
|
||||
private AudioClip oldGunSound;
|
||||
private CAudioClip oldGunSound;
|
||||
|
||||
private FieldInfo AKSoundRef;
|
||||
private CAudioClip AKSoundRaw
|
||||
|
@ -35,7 +33,7 @@ namespace WBM
|
|||
this.AKSoundRef.SetValue(this.webguy, value);
|
||||
}
|
||||
}
|
||||
private AudioClip newAKSound;
|
||||
private CAudioClip newAKSound;
|
||||
|
||||
private FieldInfo SMGSoundRef;
|
||||
private CAudioClip SMGSoundRaw
|
||||
|
@ -49,7 +47,7 @@ namespace WBM
|
|||
this.SMGSoundRef.SetValue(this.webguy, value);
|
||||
}
|
||||
}
|
||||
private AudioClip newSMGSound;
|
||||
private CAudioClip newSMGSound;
|
||||
|
||||
private void setupOldGunSound()
|
||||
{
|
||||
|
@ -62,21 +60,21 @@ namespace WBM
|
|||
this.onOldGunSoundChange(new object(), new EventArgs());
|
||||
|
||||
this.oldGunSound = this.oldGunSoundRaw;
|
||||
this.newAKSound = this.AKSoundRaw.DDKAHAAKKME;
|
||||
this.newSMGSound = this.SMGSoundRaw.DDKAHAAKKME;
|
||||
this.newAKSound = this.AKSoundRaw;
|
||||
this.newSMGSound = this.SMGSoundRaw;
|
||||
}
|
||||
|
||||
private void onOldGunSoundChange(object sender, EventArgs e)
|
||||
{
|
||||
if (this.useOldGunSoundConf.Value)
|
||||
{
|
||||
this.AKSoundRaw.DDKAHAAKKME = this.oldGunSound;
|
||||
this.SMGSoundRaw.DDKAHAAKKME = this.oldGunSound;
|
||||
this.AKSoundRaw = this.oldGunSound;
|
||||
this.SMGSoundRaw = this.oldGunSound;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AKSoundRaw.DDKAHAAKKME = this.newAKSound;
|
||||
this.SMGSoundRaw.DDKAHAAKKME = this.newSMGSound;
|
||||
this.AKSoundRaw = this.newAKSound;
|
||||
this.SMGSoundRaw = this.newSMGSound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using BepInEx.Configuration;
|
||||
|
||||
using UnityEngine;
|
||||
using CFPSGuy = BLALJCIJGGH;
|
||||
|
||||
namespace WBM
|
||||
{
|
||||
|
@ -41,7 +42,7 @@ namespace WBM
|
|||
private void setCrouchState(bool crouchState)
|
||||
{
|
||||
// CFPSGuy.inSt.isCrouching
|
||||
GENPAICHGGE.DMBBKHNIMOK.FHJOPAFOHLA = crouchState;
|
||||
CFPSGuy.GODHOHFPIFB.BLACKAOLGNP = crouchState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace WBM
|
|||
|
||||
private void setupShowEloOnLeaderBoard()
|
||||
{
|
||||
this.showEloOnLeaderboardRef = webguyType.GetField("BCFHKALFBLB", bindFlags);
|
||||
this.showEloOnLeaderboardRef = webguyType.GetField(MangledNames.showElo, bindFlags);
|
||||
|
||||
this.showEloOnLeaderboard = Config.Bind("Config", "show Elo on leaderboard", true);
|
||||
this.showEloOnLeaderboard.SettingChanged += this.onShowEloOnLeaderboardChange;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace WBM
|
|||
|
||||
private void setupShowSquadServer()
|
||||
{
|
||||
this.showSquadServerRef = webguyType.GetField("IKOJAEHBIJI", bindFlags);
|
||||
this.showSquadServerRef = webguyType.GetField(MangledNames.isClan, bindFlags);
|
||||
|
||||
this.showSquadServer = Config.Bind("Config", "show squad server", true);
|
||||
this.showSquadServer.SettingChanged += this.onShowSquadServerChange;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace WBM
|
|||
|
||||
private void setupShowTestingServer()
|
||||
{
|
||||
this.showTestingServerRef = webguyType.GetField("CCECDEDJELJ", bindFlags);
|
||||
this.showTestingServerRef = webguyType.GetField(MangledNames.isTesting, bindFlags);
|
||||
|
||||
this.showTestingServer = Config.Bind("Config", "show testing server", true);
|
||||
this.showTestingServer.SettingChanged += this.onShowTestingServerChange;
|
||||
|
|
|
@ -5,8 +5,32 @@ namespace WBM
|
|||
{
|
||||
public static class MangledNames
|
||||
{
|
||||
public static readonly string gunShotClip = "ICMCDLNEIAI";
|
||||
public static readonly string AKRifleShotClip = "DGEJAAPKEAD";
|
||||
public static readonly string SMGShotClip = "OFAALIJFKEI";
|
||||
// CAudio
|
||||
public const string gunShotClip = "BJAJGLKBGIK";
|
||||
public const string AKRifleShotClip = "AMLFKFMFNHJ";
|
||||
public const string SMGShotClip = "JBPCEBHIPOA";
|
||||
// fps limit value
|
||||
public const string fpsValue = "DDMMENCGNNJ";
|
||||
public const string showElo = "GOLMFEFNGEO";
|
||||
// show squad servers
|
||||
public const string isClan = "DMKFINANCKN";
|
||||
// show testing servers
|
||||
public const string isTesting = "IMIBKMIHNEF";
|
||||
public const string chatList = "NPGFEBBFCKM";
|
||||
public const string gameState = "HJKIAMIDEMB";
|
||||
public const string nickList = "PAGBLNDBFFM";
|
||||
public const string personGun = "DOKPBFNBIMP";
|
||||
public const string localPlayerIndex = "HHMPKKFMJCN";
|
||||
public const string teamList = "MGHADKEDFHK";
|
||||
public const string statsList = "CHNEHJPEKGM";
|
||||
|
||||
//
|
||||
// functions
|
||||
//
|
||||
|
||||
public const string drawChatMessage = "CIHAFDBGGDP";
|
||||
public const string clearMessages = "FOLIGEPKOMI";
|
||||
public const string onFPSChanged = "NGENLDFJGLK";
|
||||
public const string addMessage = "HAFDILLPPMB";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue