This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30907.101 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AntiCustomDeath", "AntiCustomDeath\AntiCustomDeath.csproj", "{75D3F123-EED2-4CAE-827E-AAB1101EAEC8}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{75D3F123-EED2-4CAE-827E-AAB1101EAEC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{75D3F123-EED2-4CAE-827E-AAB1101EAEC8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{75D3F123-EED2-4CAE-827E-AAB1101EAEC8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{75D3F123-EED2-4CAE-827E-AAB1101EAEC8}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5A0D4605-00B6-4855-A099-A96E3A7D9B33} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?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> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{75D3F123-EED2-4CAE-827E-AAB1101EAEC8}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>AntiCustomDeath</RootNamespace> | ||
<AssemblyName>AntiCustomDeath</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Newtonsoft.Json"> | ||
<HintPath>..\..\..\..\..\..\TShockRefs\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
<Reference Include="OTAPI"> | ||
<HintPath>..\..\..\..\..\..\TShockRefs\OTAPI.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="TerrariaServer"> | ||
<HintPath>..\..\..\..\..\..\TShockRefs\TerrariaServer.exe</HintPath> | ||
</Reference> | ||
<Reference Include="TShockAPI"> | ||
<HintPath>..\..\..\..\..\..\TShockRefs\TShockAPI.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Plugin.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TShockAPI; | ||
using TShockAPI.Hooks; | ||
using Terraria; | ||
using TerrariaApi.Server; | ||
using System.IO; | ||
using Terraria.DataStructures; | ||
|
||
namespace AntiCustomDeath | ||
{ | ||
[ApiVersion(2, 1)] | ||
public class Plugin : TerrariaPlugin | ||
{ | ||
public override string Author => "Zoom L1"; | ||
public override string Name => "AntiCustomDeath"; | ||
public Plugin(Main game) : base(game) { } | ||
|
||
public override void Initialize() | ||
{ | ||
ServerApi.Hooks.NetGetData.Register(this, OnGetData); | ||
} | ||
|
||
public static void OnGetData(GetDataEventArgs args) | ||
{ | ||
if (args.MsgID == PacketTypes.PlayerDeathV2) | ||
{ | ||
using (var reader = new BinaryReader(new MemoryStream(args.Msg.readBuffer, args.Index, args.Length))) | ||
{ | ||
int Index = reader.ReadByte(); | ||
PlayerDeathReason pdr = PlayerDeathReason.FromReader(reader); | ||
|
||
if (pdr._sourceCustomReason != null) | ||
{ | ||
args.Handled = true; | ||
return; | ||
} | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// Общие сведения об этой сборке предоставляются следующим набором | ||
// набора атрибутов. Измените значения этих атрибутов для изменения сведений, | ||
// связанные со сборкой. | ||
[assembly: AssemblyTitle("AntiCustomDeath")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("AntiCustomDeath")] | ||
[assembly: AssemblyCopyright("Copyright © 2021")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми | ||
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через | ||
// COM, задайте атрибуту ComVisible значение TRUE для этого типа. | ||
[assembly: ComVisible(false)] | ||
|
||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM | ||
[assembly: Guid("75d3f123-eed2-4cae-827e-aab1101eaec8")] | ||
|
||
// Сведения о версии сборки состоят из указанных ниже четырех значений: | ||
// | ||
// Основной номер версии | ||
// Дополнительный номер версии | ||
// Номер сборки | ||
// Редакция | ||
// | ||
// Можно задать все значения или принять номера сборки и редакции по умолчанию | ||
// используя "*", как показано ниже: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |