Update to netstandard2.1 and add CWOffline support
All checks were successful
Build SpookTubeEX / Build (push) Successful in 1m58s

This commit is contained in:
RedBigz 2024-07-01 10:40:02 +10:00
parent fd81989b75
commit 84ccd8cbfa
4 changed files with 15 additions and 3 deletions

View File

@ -8,12 +8,14 @@ using Photon.Pun;
using BepInEx.Logging;
using UnityEngine.Localization.PropertyVariants;
using System;
using CWOffline;
namespace SpookTubeEX;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInIncompatibility("me.loaforc.Flashcard")] // No flashcard support
[ContentWarningPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, true)]
[BepInDependency("CWOffline", BepInDependency.DependencyFlags.HardDependency)]
public class Plugin : BaseUnityPlugin
{
Harmony harmony;
@ -52,9 +54,15 @@ class ReplayPatch
[HarmonyPrefix]
static bool Prefix(UploadCompleteUI __instance)
{
if (CWOfflineAPI.IsGameOffline())
{
Modal.ShowError("Upload Error", "Your device is offline.");
return false;
}
if (!PhotonNetwork.IsMasterClient)
{
// Modal.ShowError("Upload Error", "Only the host can upload videos to SpookedTube.");
Modal.ShowError("Upload Error", "Only the host can upload videos to SpookTube.");
return false;
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>com.redbigz.SpookTubeEX</AssemblyName>
<Product>SpookTubeEX</Product>
<Description>Upload your videos to a website and watch others' videos!</Description>
@ -75,5 +75,9 @@
<Reference Include="Photon3Unity3D">
<HintPath>./lib/Photon3Unity3D.dll</HintPath>
</Reference>
<Reference Include="CWOffline">
<HintPath>./apis/CWOffline.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

BIN
apis/CWOffline.dll Normal file

Binary file not shown.

View File

@ -3,5 +3,5 @@ cp buildResources/* .build
cp README.md .build
sed -i -e "s/img\//https\:\/\/git.redbigz.com\/SpookTube\/SpookTubeEX\/media\/branch\/main\/img\//g" .build/README.md
dotnet build -c release
cp -r bin/Release/net472/com.redbigz.SpookTubeEX.dll .build/BepInEx/plugins
cp -r bin/Release/netstandard2.1/com.redbigz.SpookTubeEX.dll .build/BepInEx/plugins
jar -cf SpookTubeEX.zip -C .build/ .