Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Commit

Permalink
Add Deli (#13)
Browse files Browse the repository at this point in the history
* Initial deli support

* Update README.md

add Deli instruction

* Delete mainmenu3-panel.txt

removing as Deli can do this better

* rename changelog text asset

* removed discord assembly load
Deli will do this for us

* Update README.md

update readme for deli some more

* Update link_builds.bat

update for Deli path

* Added Deli manifest

* Update README.md

* Removed csproj junk

* Update README.md

* fix invite

* Update to Deli v0.2.1

* Add temp changelog panel text for Deli

* Update uninstall instructions

-.zip to .deli moment

* Add Meatmas2020 scene to scene dict

* Remove unnecessary install info

Deli mods are now .deli instead of .zip, no need to warn about this now (hopefully..)

* Update manifest to Deli v0.2.1

* Get values from manifest now
-get rid of unnecessary Source
-replace user facing hardcoded H3MP strings to get from plugin

* Update README.md

* Create nuget.config for BepInEx

* Remove changelog panel (made redundant)
- Deli does this via sourceUrl in manifest now
- Bump manifest Deli requirement to v0.2.2
- Fix HarmonyState logger

* this file is pointless

* Fix for WristMenuButtons & WurstMod compatibility

* Bump Deli to v0.2.5
  • Loading branch information
Maiq-The-Dude committed Dec 5, 2020
1 parent ffa92ec commit 44e60d3
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 218 deletions.
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
# H3MP ![functions: barely](https://img.shields.io/badge/functions-barely-c28411?style=for-the-badge) ![made with: pain](https://img.shields.io/badge/made%20with-pain-red?style=for-the-badge)
# H3MP
[![version](https://img.shields.io/github/v/release/ash-hat/H3MP?&label=version&style=flat-square)](https://github.com/ash-hat/H3MP/releases/latest) [![discord](https://img.shields.io/discord/777351065950879744?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square)](https://discord.gg/g8xeFyt42j)

A **WIP** multiplayer mod for Hot Dogs, Horseshoes, and Hand Grenades.

## Features
- Configs
- [x] Player limit
- [x] Scene loading/reloading permissions
- [x] Tick rate
- *refer to `BepInEx\config\Ash.H3MP.cfg` for additional config options*
- Player
- [x] Movement
- [ ] Held items
- [ ] Avatar
- Player
- [x] Movement
- [ ] Held items
- [ ] Avatar
- [x] Basic sosig body
- [ ] Advanced sosig body
- Configs
- [x] Player limit
- [x] Scene loading/reloading permissions
- [x] Tick rate
- *refer to `mods\configs\ash.h3mp.cfg` for additional config options*
- Miscellaneous
- [x] Discord Rich Presence
- [x] Scene loading
- [ ] Items
- [x] Discord Rich Presence
- [x] Scene loading
- [ ] Items

## Installation
1. Have [Discord](https://discord.com/download) installed and running. Discord Rich Presence is the only way to join or invite other players.
2. Download the [most recent x64 release of BepInEx](https://github.com/BepInEx/BepInEx/releases/latest) and extract it to your **H3VR** directory.
3. Download the [most recent release of H3MP](https://github.com/ash-hat/H3MP/releases/latest) and extract it to your **H3VR** directory.
4. If you are hosting, you must have port **7777 UDP** open and forwarded to your computer. The desired port number can also be changed in the config.
5. Start the game
2. Download the [latest x64 release of BepInEx](https://github.com/BepInEx/BepInEx/releases/latest) and extract it to your H3VR directory.
3. Download the [latest release of Deli](https://github.com/nrgill28/Deli/releases/latest) and extract it to your H3VR directory.
4. Download the [latest release of H3MP](https://github.com/ash-hat/H3MP/releases/latest) and place it in your `H3VR\mods` directory.
5. If you are hosting, you must have port **7777 UDP** open and forwarded to your computer. The desired port number can also be changed in the config.
6. Start the game
- Join a party by clicking the "Join" button on a Discord invite. In the future, you can join off of invites and the game will start automatically.
- Invite players to your party by clicking the plus button in a Discord text channel, and select "Invite ... to Play H3MP".



## Uninstallation
To uninstall, you only need to delete the `BepInEx\plugins\H3MP` directory.
To uninstall, you only need to delete the `mods\H3MP.deli` file.

## Documentation
Installation and uninstallation have been listed here for convenience, but further documentation is included in the [docs](docs/) directory.
Expand Down
6 changes: 6 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BepInExLibs" value="https://pkgs.dev.azure.com/bepinex/BepInEx/_packaging/BepInExLibs/nuget/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion scripts/link_builds.bat
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if not exist "%H3MP_H3VR_PATH%\BepInEx\plugins" (
exit /b 2
)

set "H3MP_PLUGIN=%H3MP_H3VR_PATH%\BepInEx\plugins\H3MP"
set "H3MP_PLUGIN=%H3MP_H3VR_PATH%\mods\H3MP"
if not exist "%H3MP_PLUGIN%" (
mkdir "%H3MP_PLUGIN%"
)
Expand Down
8 changes: 4 additions & 4 deletions src/H3MP.Networking/H3MP.Networking.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -31,9 +31,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BepInEx">
<HintPath>..\..\game\BepInEx\core\BepInEx.dll</HintPath>
</Reference>
<PackageReference Include="BepInEx.Core" Version="5.4.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="LiteNetLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\LiteNetLib.0.9.3.2\lib\net35\LiteNetLib.dll</HintPath>
</Reference>
Expand Down
20 changes: 9 additions & 11 deletions src/H3MP/H3MP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,22 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony20, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\game\BepInEx\core\0Harmony20.dll</HintPath>
</Reference>
<PackageReference Include="BepInEx.Core" Version="5.4.0" />
<PackageReference Include="Deli">
<Version>0.2.4</Version>
</PackageReference>
<PackageReference Include="Deli.Runtime">
<Version>0.2.4</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\game\h3vr_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\..\game\BepInEx\core\BepInEx.dll</HintPath>
</Reference>
<Reference Include="LiteNetLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\LiteNetLib.0.9.3.2\lib\net35\LiteNetLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine">
<HintPath>..\..\game\h3vr_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\game\h3vr_Data\Managed\UnityEngine.UI.dll</HintPath>
Expand Down Expand Up @@ -87,7 +86,6 @@
<Compile Include="HarmonyPatches\LoadLevelPatch.cs" />
<Compile Include="HarmonyPatches\SetLinkAccessoryPatch.cs" />
<Compile Include="Utils\WristMenuButtons.cs" />
<Compile Include="Utils\ChangelogPanel.cs" />
<Compile Include="Utils\MovingAverages\ExponentialMovingAverage.cs" />
<Compile Include="Utils\MovingAverages\IMovingAverage.cs" />
<Compile Include="Utils\MovingAverages\SimpleMovingAverage.cs" />
Expand Down
4 changes: 2 additions & 2 deletions src/H3MP/HarmonyPatches/HarmonyState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace H3MP.HarmonyPatches
{
internal static class HarmonyState
{
public static ManualLogSource Log { get; } = BepInEx.Logging.Logger.CreateLogSource(Plugin.NAME + "-HM");
public static ManualLogSource Log { get; } = BepInEx.Logging.Logger.CreateLogSource("H3MP-HM");

public static StatefulActivity DiscordActivity { get; private set; }

Expand All @@ -22,7 +22,7 @@ public static string CurrentLevel
}

public static bool LockLoadLevel { get; set; } = true;
public static event Action<SosigOutfitConfig> OnSpectatorOutfitRandomized;

public static void Init(StatefulActivity discordActivity, WristMenuButtons wristmenubuttons)
Expand Down
1 change: 1 addition & 0 deletions src/H3MP/HarmonyPatches/LoadLevelPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ internal class LoadLevelPatch
["TileSetTest1"] = "Mini-Arena",
["TileSetTest_BigHallPerfTest"] = "Take & Hold (Legacy)",
["WarehouseRange_Rebuilt"] = "Warehouse Range",
["WinterWasteland"] = "Winter Wasteland",
["Wurstwurld1"] = "Wurstwurld",
["Xmas"] = "Meatmas Snowglobe"
};
Expand Down
24 changes: 7 additions & 17 deletions src/H3MP/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Deli;
using Discord;
using HarmonyLib;
using H3MP.Configs;
Expand All @@ -21,13 +21,11 @@

namespace H3MP
{
[BepInPlugin(Plugin.GUID, Plugin.NAME, Plugin.VERSION)]
[BepInProcess("h3vr.exe")]
public class Plugin : BaseUnityPlugin
public class Plugin : DeliBehaviour
{
public const string GUID = "Ash.H3MP";
public const string NAME = "H3MP";
public const string VERSION = "0.1.2";
public string GUID => Info.Guid;
public string NAME => Info.Name.Unwrap();
public string VERSION => Info.Version.ToString();

private const long DISCORD_APP_ID = 762557783768956929; // 3rd party RPC application
private const uint STEAM_APP_ID = 450540; // H3VR
Expand All @@ -47,7 +45,6 @@ public class Plugin : BaseUnityPlugin
private readonly ManualLogSource _serverLog;
private readonly ManualLogSource _discordLog;

private readonly ChangelogPanel _changelogPanel;
private readonly WristMenuButtons _wristMenuButtons;
private readonly PrivacyManager _privacyManager;

Expand Down Expand Up @@ -88,8 +85,6 @@ public Plugin()

Logger.LogDebug("Initializing Discord game SDK...");
{
LoadLibrary("BepInEx\\plugins\\H3MP\\" + Discord.Constants.DllName + ".dll");

DiscordClient = new Discord.Discord(DISCORD_APP_ID, (ulong) CreateFlags.Default);
DiscordClient.SetLogHook(Discord.LogLevel.Debug, (level, message) =>
{
Expand Down Expand Up @@ -158,10 +153,6 @@ public Plugin()

Logger.LogDebug("Initializing shared Harmony state...");
HarmonyState.Init(Activity, _wristMenuButtons);

Logger.LogDebug("Hooking into sceneLoaded...");
_changelogPanel = new ChangelogPanel(Logger, StartCoroutine, _version);

}

private void DiscordCallbackHandler(Result result)
Expand Down Expand Up @@ -270,7 +261,6 @@ private IEnumerator _HostUnsafe()
publicEndPoint = new IPEndPoint(publicAddress, publicPort);
}


float ups = 1 / Time.fixedDeltaTime; // 90
double tps = config.TickRate.Value;
if (tps <= 0)
Expand Down Expand Up @@ -351,7 +341,7 @@ private void Awake()
{
Instance = this;

new Harmony(Info.Metadata.GUID).PatchAll();
new Harmony(GUID).PatchAll();
}

private void Start()
Expand Down Expand Up @@ -380,7 +370,7 @@ private void FixedUpdate()
private void OnDestroy()
{
DiscordClient.Dispose();
_changelogPanel.Dispose();
_wristMenuButtons.Dispose();

Server?.Dispose();
Client?.Dispose();
Expand Down
129 changes: 0 additions & 129 deletions src/H3MP/Utils/ChangelogPanel.cs

This file was deleted.

Loading

0 comments on commit 44e60d3

Please sign in to comment.