generated from Stick_Mods/stick.plugins.tmpl
Compare commits
2 Commits
f2631109fd
...
v0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 11f6144c2b | |||
| dd8db77135 |
@@ -1,13 +0,0 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
[HarmonyPatch(typeof(MultiplayerManager), "OnKicked")]
|
||||
class IgnoreKick
|
||||
{
|
||||
public static bool Prefix(ref byte[] data)
|
||||
{
|
||||
MultiplayerManager.KickResponse kickResponse = (MultiplayerManager.KickResponse)data[0];
|
||||
Debug.LogWarning("Received Kick Message, the reason is: " + kickResponse.ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
105
Plugin.cs
105
Plugin.cs
@@ -1,105 +0,0 @@
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using UnityEngine;
|
||||
using Steamworks;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace stick.plugins.tmpl;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家管理器插件主类
|
||||
/// 提供大厅信息显示、玩家记录、黑名单管理等功能
|
||||
/// </summary>
|
||||
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
|
||||
[BepInProcess("StickFight.exe")]
|
||||
public class Tmpl : BaseUnityPlugin
|
||||
{
|
||||
#region 配置项
|
||||
|
||||
/// <summary>
|
||||
/// 是否屏蔽来自其他玩家的踢出请求
|
||||
/// </summary>
|
||||
private static ConfigEntry<bool> _blockKicks;
|
||||
|
||||
/// <summary>
|
||||
/// 大厅信息开关快捷键
|
||||
/// </summary>
|
||||
private static ConfigEntry<KeyCode> _lobbyInfoToggleKeyCode;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 生命周期方法
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
InitializeConfiguration();
|
||||
ApplyPatches();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
HandleInput();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (PlayerManagerGUI.ShowLobbyInfo)
|
||||
{
|
||||
PlayerManagerGUI.DrawLobbyInfoGUI();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 私有方法
|
||||
|
||||
/// <summary>
|
||||
/// 初始化配置项
|
||||
/// </summary>
|
||||
private void InitializeConfiguration()
|
||||
{
|
||||
_blockKicks = Config.Bind(
|
||||
"General",
|
||||
"BlockKicks",
|
||||
true,
|
||||
"是否屏蔽来自其他玩家的踢出请求"
|
||||
);
|
||||
|
||||
_lobbyInfoToggleKeyCode = Config.Bind(
|
||||
"LobbyInfo",
|
||||
"ToggleKeyCode",
|
||||
KeyCode.F2,
|
||||
"Lobby信息开关快捷键"
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用Harmony补丁
|
||||
/// </summary>
|
||||
private void ApplyPatches()
|
||||
{
|
||||
if (_blockKicks.Value)
|
||||
{
|
||||
Harmony.CreateAndPatchAll(typeof(IgnoreKick));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理输入
|
||||
/// </summary>
|
||||
private void HandleInput()
|
||||
{
|
||||
if (Input.GetKeyDown(_lobbyInfoToggleKeyCode.Value))
|
||||
{
|
||||
ToggleLobbyInfoGUI();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 公共方法
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
# stick.plugins.fixlocalforce
|
||||
|
||||
在本地游戏里复现在线的bug
|
||||
|
||||
~~make laser great again~~
|
||||
|
||||
## 功能
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,62 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net35</TargetFramework>
|
||||
<AssemblyName>stick.plugins.tmpl</AssemblyName>
|
||||
<Product>Tmpl</Product>
|
||||
<Version>0.0.1</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Authors>sleeeeeep</Authors>
|
||||
<RestoreAdditionalProjectSources>
|
||||
https://api.nuget.org/v3/index.json;
|
||||
https://nuget.bepinex.dev/v3/index.json;
|
||||
https://nuget.samboy.dev/v3/index.json
|
||||
</RestoreAdditionalProjectSources>
|
||||
<RootNamespace>stick.plugins.tmpl</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
|
||||
<PackageReference Include="BepInEx.Core" Version="5.*" />
|
||||
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
|
||||
<PackageReference Include="Mono.Cecil" Version="0.10.4" />
|
||||
<PackageReference Include="UnityEngine.Modules" Version="5.6.3.16509117" IncludeAssets="compile" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2"
|
||||
PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>lib/Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp-firstpass">
|
||||
<HintPath>lib/Assembly-CSharp-firstpass.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="Lidgren.Network">
|
||||
<HintPath>lib/Lidgren.Network.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Assembly-CSharp.dll" />
|
||||
<None Remove="Assembly-CSharp-firstpass.dll" />
|
||||
<None Remove="Lidgren.Network.dll" />
|
||||
<None Remove="TextMeshPro-1.0.55.56.0b9.dll" />
|
||||
<None Remove="UnityEngine.UI.dll" />
|
||||
<None Remove="Mono.Security.dll" />
|
||||
<None Remove="mscorlib.dll" />
|
||||
<None Remove="System.dll" />
|
||||
<None Remove="System.Core.dll" />
|
||||
<None Remove="System.Xml.dll" />
|
||||
<None Remove="UnityEngine.dll" />
|
||||
<None Remove="UnityEngine.Analytics.dll" />
|
||||
<None Remove="UnityEngine.dll.mdb" />
|
||||
<None Remove="UnityEngine.Networking.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user