Upload files to "/"
This commit is contained in:
1 parent
78be500f5c
commit
0ac2e91f67
5 files changed
+186
No files matched your search
@@ -0,0 +1,10 @@
|
||||
namespace TooMuchInfo
|
||||
{
|
||||
internal class Constants
|
||||
{
|
||||
public const string Guid = "deez.toomuchinfo";
|
||||
public const string Name = "Deez's TooMuchInfo";
|
||||
public const string Version = "1.2.3";
|
||||
public const string HashKey = "deez.uk/discord";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GamePath>C:\Program Files (x86)\Steam\steamapps\common\Gorilla Tag</GamePath>
|
||||
<GameAssemblyPath>$(GamePath)\Gorilla Tag_Data\Managed</GameAssemblyPath>
|
||||
<BepInExAssemblyPath>$(GamePath)\BepInEx\core</BepInExAssemblyPath>
|
||||
<PluginsPath>$(GamePath)\BepInEx\plugins</PluginsPath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Project>
|
||||
<Target Name="CopyToPlugins" AfterTargets="Build" Condition="'$(CI)' != 'TRUE'">
|
||||
<ItemGroup>
|
||||
<FilesToCopy Include="$(TargetPath)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(FilesToCopy)" DestinationFiles="@(FilesToCopy->'$(PluginsPath)\%(Filename)%(Extension)')"/>
|
||||
<Message Text="Copied $(TargetFileName)" Importance="high"/>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -0,0 +1,56 @@
|
||||
using GorillaNetworking;
|
||||
using HarmonyLib;
|
||||
using Photon.Pun;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TooMuchInfo.Tools;
|
||||
|
||||
namespace TooMuchInfo.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(VRRig))]
|
||||
[HarmonyPatch("SerializeReadShared", MethodType.Normal)]
|
||||
public static class OnDataReceived
|
||||
{
|
||||
private static void Postfix(VRRig __instance)
|
||||
{
|
||||
UpdatePlayerPing(__instance);
|
||||
UpdatePlayerCosmetXState(__instance);
|
||||
__instance.UpdateName();
|
||||
}
|
||||
|
||||
private static void UpdatePlayerPing(VRRig rig)
|
||||
{
|
||||
double estimatedPing = Math.Abs((rig.velocityHistoryList[0].time - PhotonNetwork.Time) * 1000);
|
||||
int clampedPing = (int)Math.Clamp(Math.Round(estimatedPing), 0, int.MaxValue);
|
||||
|
||||
Extensions.PlayerPing[rig] = clampedPing;
|
||||
}
|
||||
|
||||
private static void UpdatePlayerCosmetXState(VRRig rig)
|
||||
{
|
||||
if (!Extensions.PlayerMods.ContainsKey(rig))
|
||||
Extensions.PlayerMods[rig] = [];
|
||||
|
||||
if (!rig.HasCosmetics())
|
||||
return;
|
||||
|
||||
CosmeticsController.CosmeticSet cosmeticSet = rig.cosmeticSet;
|
||||
bool hasCosmetx =
|
||||
cosmeticSet.items.Any(cosmetic => !cosmetic.isNullItem &&
|
||||
!rig._playerOwnedCosmetics.Contains(
|
||||
cosmetic.itemName)) && !rig.inTryOnRoom;
|
||||
|
||||
switch (hasCosmetx)
|
||||
{
|
||||
case true when !Extensions.PlayerMods[rig].Contains("[<color=red>COSMETX</color>]"):
|
||||
Extensions.PlayerMods[rig].Add("[<color=red>COSMETX</color>]");
|
||||
|
||||
break;
|
||||
|
||||
case false when Extensions.PlayerMods[rig].Contains("[<color=red>COSMETX</color>]"):
|
||||
Extensions.PlayerMods[rig].Remove("[<color=red>COSMETX</color>]");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using BepInEx;
|
||||
using ExitGames.Client.Photon;
|
||||
using HarmonyLib;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Photon.Pun;
|
||||
using TooMuchInfo.Tools;
|
||||
using Extensions = TooMuchInfo.Tools.Extensions;
|
||||
|
||||
namespace TooMuchInfo;
|
||||
|
||||
[BepInPlugin(Constants.Guid, Constants.Name, Constants.Version)]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
public static bool ShowSpecialCosmetics;
|
||||
public static bool ShowKnownPeople;
|
||||
public static bool ShowFpsPlatformPing;
|
||||
public static bool ShowCreationDate;
|
||||
public static bool ShowMods;
|
||||
|
||||
public static List<string> LineOrder;
|
||||
|
||||
public static Dictionary<string, string> KnownMods;
|
||||
public static Dictionary<string, string> KnownCheats;
|
||||
public static Dictionary<string, string> KnownPeople;
|
||||
public static Dictionary<string, string> KnownCosmetics;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
ShowSpecialCosmetics = Config.Bind("Display", "SpecialCosmetics", true).Value;
|
||||
ShowKnownPeople = Config.Bind("Display", "KnownPeople", true).Value;
|
||||
ShowFpsPlatformPing = Config.Bind("Display", "FpsPlatformPing", true).Value;
|
||||
ShowCreationDate = Config.Bind("Display", "CreationDate", true).Value;
|
||||
ShowMods = Config.Bind("Display", "Mods", true).Value;
|
||||
|
||||
LineOrder = Config.Bind(
|
||||
"Order",
|
||||
"LineOrder",
|
||||
"SpecialCosmetics,Name,FpsPlatformPing,CreationDate,Mods"
|
||||
).Value.Split(',').Select(x => x.Trim()).ToList();
|
||||
|
||||
new Harmony(Constants.Guid).PatchAll();
|
||||
}
|
||||
|
||||
private void Start() => GorillaTagger.OnPlayerSpawned(() =>
|
||||
{
|
||||
Hashtable properties = new() { { $"{Constants.HashKey}", $"Made by Deez - {Constants.Name}" }, }; PhotonNetwork.LocalPlayer.SetCustomProperties(properties);
|
||||
VRRigCache.OnRigDeactivated += rigContainer =>
|
||||
{
|
||||
VRRig vrrig = rigContainer.vrrig;
|
||||
|
||||
Extensions.PlayerWithCosmetics.Remove(vrrig);
|
||||
Extensions.PlayerPlatforms.Remove(vrrig);
|
||||
Extensions.PlayerMods.Remove(vrrig);
|
||||
};
|
||||
|
||||
using HttpClient httpClient = new();
|
||||
HttpResponseMessage response =
|
||||
httpClient.GetAsync(
|
||||
"https://deez.uk/data").Result;
|
||||
|
||||
using Stream deezDataStream =
|
||||
response.Content.ReadAsStreamAsync().Result;
|
||||
|
||||
using StreamReader reader = new(deezDataStream);
|
||||
JObject root = JObject.Parse(reader.ReadToEnd());
|
||||
|
||||
KnownCheats =
|
||||
root["knownCheats"]?
|
||||
.ToObject<Dictionary<string,
|
||||
string>>();
|
||||
|
||||
KnownMods =
|
||||
root["knownMods"]?
|
||||
.ToObject<Dictionary<string,
|
||||
string>>();
|
||||
|
||||
KnownPeople =
|
||||
root["knownPeople"]?
|
||||
.ToObject<Dictionary<string,
|
||||
string>>();
|
||||
|
||||
KnownCosmetics =
|
||||
root["specialCosmetics"]?
|
||||
.ToObject<Dictionary<string,
|
||||
string>>();
|
||||
});
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (VRRig.LocalRig.playerText1 == null || NetworkSystem.Instance.LocalPlayer == null)
|
||||
return;
|
||||
|
||||
VRRig.LocalRig.playerText1.text =
|
||||
NetworkSystem.Instance.LocalPlayer.SanitizedNickName.AnimateGradiant(VRRig.LocalRig.playerColor);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user