mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2026-06-24 07:18:28 +00:00
[NAK_CVR_Mods] Unfucked for 2026r182
This commit is contained in:
parent
c13dc8375a
commit
281403d68b
209 changed files with 3936 additions and 1122 deletions
6
.Deprecated/FastStartup/FastStartup.csproj
Normal file
6
.Deprecated/FastStartup/FastStartup.csproj
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<RootNamespace>ASTExtension</RootNamespace>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
237
.Deprecated/FastStartup/Main.cs
Normal file
237
.Deprecated/FastStartup/Main.cs
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using ABI_RC.Core.Base;
|
||||
using ABI_RC.Core.EventSystem;
|
||||
using ABI_RC.Core.Networking;
|
||||
using ABI_RC.Core.Networking.API;
|
||||
using ABI_RC.Core.Networking.API.Responses;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Core.Savior.SceneManagers;
|
||||
using ABI_RC.Systems.InputManagement;
|
||||
using ABI_RC.Systems.UI;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace NAK.FastStartup;
|
||||
|
||||
public class FastStartupMod : MelonMod
|
||||
{
|
||||
private const string APIAddress = "https://api.chilloutvr.net";
|
||||
private const string APIVersion = "1";
|
||||
|
||||
private static MelonLogger.Instance Logger;
|
||||
private static LoginProfile _profile;
|
||||
private static Task<BaseResponse<UserAuthResponse>> _pendingAuth;
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
|
||||
LoginRoom.IsPlayerIn = true;
|
||||
|
||||
// Load profile and fire auth request as early as possible
|
||||
_profile = LoadFirstProfile();
|
||||
if (_profile != null)
|
||||
{
|
||||
Logger.Msg($"Firing early auth for {_profile.Username}...");
|
||||
_pendingAuth = AuthenticateAsync(_profile.Username, _profile.AccessKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Error("No valid profile found.");
|
||||
}
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(Preparation).GetMethod(nameof(Preparation.Start),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(FastStartupMod).GetMethod(nameof(OnPrePreparationStart),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(Init).GetMethod(nameof(Init.Start),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(FastStartupMod).GetMethod(nameof(OnMethodWeDontCareAboutAndWantToFuckOff),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
HarmonyInstance.Patch(
|
||||
typeof(IntroManager).GetMethod(nameof(IntroManager.Start),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(FastStartupMod).GetMethod(nameof(OnMethodWeDontCareAboutAndWantToFuckOff),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
HarmonyInstance.Patch(
|
||||
typeof(IntroManager).GetMethod(nameof(IntroManager.OnDestroy),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(FastStartupMod).GetMethod(nameof(OnMethodWeDontCareAboutAndWantToFuckOff),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
HarmonyInstance.Patch(
|
||||
typeof(LoginRoom).GetMethod(nameof(LoginRoom.Start),
|
||||
BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
prefix: new HarmonyMethod(typeof(FastStartupMod).GetMethod(nameof(OnLoginRoomStart),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
Logger.Msg("FastStartup initialized");
|
||||
}
|
||||
|
||||
private static bool OnPrePreparationStart()
|
||||
{
|
||||
MelonCoroutines.Start(WaitForAuthAndContinue());
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool OnMethodWeDontCareAboutAndWantToFuckOff() => false;
|
||||
|
||||
private static void OnLoginRoomStart() => WorldTransitionSystem.Instance.ContinueTransition();
|
||||
|
||||
private static IEnumerator WaitForAuthAndContinue()
|
||||
{
|
||||
Logger.Msg("Waiting for early auth to complete...");
|
||||
|
||||
// Load init scene
|
||||
SceneManager.LoadScene("Init");
|
||||
yield return null;
|
||||
|
||||
PlayerSetup.Instance.ToggleCameras(true, true);
|
||||
WorldTransitionSystem.Instance.StartTransition(true);
|
||||
CursorLockManager.Instance.UpdateCursorState();
|
||||
|
||||
if (_pendingAuth == null)
|
||||
{
|
||||
MelonCoroutines.Start(LoginRoom.LoadScene());
|
||||
yield break;
|
||||
}
|
||||
|
||||
while (!_pendingAuth.IsCompleted)
|
||||
yield return null;
|
||||
|
||||
if (_pendingAuth.IsFaulted || _pendingAuth.Result?.Data == null)
|
||||
{
|
||||
Logger.Error($"Early auth failed: {_pendingAuth.Exception?.Message ?? "null response"}");
|
||||
MelonCoroutines.Start(LoginRoom.LoadScene());
|
||||
yield break;
|
||||
}
|
||||
|
||||
var authData = _pendingAuth.Result.Data;
|
||||
Logger.Msg($"Early auth succeeded: {authData.Username} ({authData.UserId})");
|
||||
|
||||
MelonCoroutines.Start(AuthManager.AuthenticationSucceeded(_pendingAuth.Result, AuthManager.AuthEntity.ABIProfile));
|
||||
MelonCoroutines.Start(LoadOurContent());
|
||||
}
|
||||
|
||||
private static IEnumerator LoadOurContent()
|
||||
{
|
||||
yield return null;
|
||||
Content.LoadIntoWorld(MetaPort.Instance.homeWorldGuid, true);
|
||||
AssetManagement.Instance.LoadLocalAvatar(MetaPort.Instance.currentAvatarGuid);
|
||||
}
|
||||
|
||||
#region Profile Loading
|
||||
|
||||
private static LoginProfile LoadFirstProfile()
|
||||
{
|
||||
try
|
||||
{
|
||||
/*var profileFiles = Directory.GetFiles(Application.dataPath, "*.profile");
|
||||
if (profileFiles.Length == 0)
|
||||
{
|
||||
Logger.Warning("No .profile files found");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Load first valid profile found
|
||||
foreach (var file in profileFiles)
|
||||
{*/
|
||||
string file = Path.Combine(Application.dataPath, "autologin.profile");
|
||||
if (File.Exists(file))
|
||||
{
|
||||
try
|
||||
{
|
||||
using var reader = new StreamReader(file);
|
||||
var serializer = new XmlSerializer(typeof(LoginProfile));
|
||||
var profile = (LoginProfile)serializer.Deserialize(reader);
|
||||
|
||||
if (!string.IsNullOrEmpty(profile?.Username) && !string.IsNullOrEmpty(profile?.AccessKey))
|
||||
{
|
||||
Logger.Msg($"Loaded profile: {profile.Username}");
|
||||
return profile;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Warning($"Failed to load {Path.GetFileName(file)}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error($"Profile loading failed: {ex.Message}");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion Profile Loading
|
||||
|
||||
#region Auth Request
|
||||
|
||||
private static async Task<BaseResponse<UserAuthResponse>> AuthenticateAsync(string username, string accessKey)
|
||||
{
|
||||
using var client = new HttpClient();
|
||||
client.Timeout = TimeSpan.FromSeconds(30);
|
||||
|
||||
client.DefaultRequestHeaders.Add(ApiConnection.HeaderUsername, username);
|
||||
client.DefaultRequestHeaders.Add(ApiConnection.HeaderAccessKey, accessKey);
|
||||
client.DefaultRequestHeaders.Add(ApiConnection.HeaderUserAgent, $"ChilloutVR/{Application.version} (fuck you)");
|
||||
client.DefaultRequestHeaders.Add(ApiConnection.HeaderPlatform, MetaPort.Platform);
|
||||
client.DefaultRequestHeaders.Add(ApiConnection.HeaderCompatibleVersions, MetaPort.CompatibleVersions);
|
||||
|
||||
var payload = JsonConvert.SerializeObject(new
|
||||
{
|
||||
Username = username,
|
||||
Password = accessKey,
|
||||
AuthType = 1,
|
||||
get = "?acceptTOS=true"
|
||||
});
|
||||
|
||||
var url = $"{APIAddress}/{APIVersion}/users/auth?acceptTOS=true";
|
||||
|
||||
try
|
||||
{
|
||||
var response = await client.PostAsync(url, new StringContent(payload, Encoding.UTF8, "application/json"));
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
Logger.Error($"Auth failed: {response.StatusCode}");
|
||||
return null;
|
||||
}
|
||||
|
||||
var body = await response.Content.ReadAsStringAsync();
|
||||
return JsonConvert.DeserializeObject<BaseResponse<UserAuthResponse>>(body);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error($"Auth request failed: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Auth Request
|
||||
}
|
||||
|
||||
[XmlRoot("LoginProfile")]
|
||||
public class LoginProfile
|
||||
{
|
||||
[XmlElement("Username")] public string Username { get; set; }
|
||||
[XmlElement("AccessKey")] public string AccessKey { get; set; }
|
||||
}
|
||||
32
.Deprecated/FastStartup/Properties/AssemblyInfo.cs
Normal file
32
.Deprecated/FastStartup/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using MelonLoader;
|
||||
using NAK.FastStartup.Properties;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.FastStartup))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.FastStartup))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.FastStartup.FastStartupMod),
|
||||
nameof(NAK.FastStartup),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/FastStartup"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("ChilloutVR", "ChilloutVR")]
|
||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||
[assembly: MelonColor(255, 246, 25, 99)] // red-pink
|
||||
[assembly: MelonAuthorColor(255, 158, 21, 32)] // red
|
||||
[assembly: HarmonyDontPatchAll]
|
||||
|
||||
namespace NAK.FastStartup.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.5";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
||||
54
.Deprecated/FastStartup/README.md
Normal file
54
.Deprecated/FastStartup/README.md
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# ASTExtension
|
||||
|
||||
Extension mod for [Avatar Scale Tool](https://github.com/NotAKidoS/AvatarScaleTool):
|
||||
- VR Gesture to scale
|
||||
- Persistent height
|
||||
- Copy height from others
|
||||
|
||||
Best used with Avatar Scale Tool, but will attempt to work with found scaling setups.
|
||||
Requires already having Avatar Scaling on the avatar. This is **not** Universal Scaling.
|
||||
|
||||
## Supported Setups
|
||||
|
||||
ASTExtension will attempt to work with the following setups:
|
||||
|
||||
**Parameter Names:**
|
||||
- AvatarScale
|
||||
- Scale
|
||||
- Scaler
|
||||
- Scale/Scale
|
||||
- Height
|
||||
- LoliModifier
|
||||
- AvatarSize
|
||||
- Size
|
||||
- SizeScale
|
||||
- Scaling
|
||||
|
||||
These parameter names are not case sensitive and have been gathered from polling the community for common parameter names.
|
||||
|
||||
Assuming the parameter is a float, ASTExtension will attempt to use it as the height parameter. Will automatically calibrate to the height range of the found parameter, assuming the scaling animation is in a blend tree / state using motion time & is linear. The scaling animation state **must be active** at time of avatar load.
|
||||
|
||||
The max value ASTExtension will drive the parameter to is 100. As the mod is having to guess the max height, it may not be accurate if the max height is not capped at a multiple of 10.
|
||||
|
||||
Examples:
|
||||
- `AvatarScale` - 0 to 1 (slider)
|
||||
- This is the default setup for Avatar Scale Tool and will work perfectly.
|
||||
- `Scale` - 0 to 100 (input single)
|
||||
- This will also work perfectly as the max height is a multiple of 10.
|
||||
- `Height` - 0 to 2 (input single)
|
||||
- This will not work properly. The max value to drive the parameter to is not a multiple of 10, and as such ASTExtension will believe the parameter range is 0 to 1.
|
||||
- `BurntToast` - 0 to 10 (input single)
|
||||
- This will not work properly. The parameter name is not recognized by ASTExtension.
|
||||
|
||||
If your setup is theoretically supported but not working, it is likely the scaling animation is not linear or has loop enabled if using Motion Time, making the first and last frame identical height. In this case, you will need to fix your animation clip curves / blend tree to be linear &|| not loop, or use Avatar Scale Tool to generate a new scaling animation.
|
||||
|
||||
---
|
||||
|
||||
Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI.
|
||||
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
|
||||
|
||||
> This mod is an independent creation not affiliated with, supported by, or approved by Alpha Blend Interactive.
|
||||
|
||||
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
|
||||
|
||||
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.
|
||||
24
.Deprecated/FastStartup/format.json
Normal file
24
.Deprecated/FastStartup/format.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"_id": 223,
|
||||
"name": "ASTExtension",
|
||||
"modversion": "1.0.5",
|
||||
"gameversion": "2025r181",
|
||||
"loaderversion": "0.7.2",
|
||||
"modtype": "Mod",
|
||||
"author": "NotAKidoS",
|
||||
"description": "Extension mod for [Avatar Scale Tool](https://github.com/NotAKidoS/AvatarScaleTool):\n- VR Gesture to scale\n- Persistent height\n- Copy height from others\n\nBest used with Avatar Scale Tool, but will attempt to work with found scaling setups.\nRequires already having Avatar Scaling on the avatar. This is **not** Universal Scaling.",
|
||||
"searchtags": [
|
||||
"tool",
|
||||
"scaling",
|
||||
"height",
|
||||
"extension",
|
||||
"avatar"
|
||||
],
|
||||
"requirements": [
|
||||
"BTKUILib"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r48/ASTExtension.dll",
|
||||
"sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/ASTExtension/",
|
||||
"changelog": "- Rebuilt for CVR 2025r181",
|
||||
"embedcolor": "#f61963"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue