Update player exploit patched

This commit is contained in:
high 2011-06-03 02:16:28 -04:00
parent 100d7d10f3
commit 1e1216f090
2 changed files with 92 additions and 83 deletions

View file

@ -149,18 +149,16 @@ namespace TShockAPI
if (Main.netMode != 2) { return; } if (Main.netMode != 2) { return; }
if (e.MsgID == 17) if (e.MsgID == 17)
{ {
byte type;
int x = 0;
int y = 0;
using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length)))
{ {
type = br.ReadByte(); byte type = br.ReadByte();
x = br.ReadInt32(); int x = br.ReadInt32();
y = br.ReadInt32(); int y = br.ReadInt32();
}
if (type == 0 && BlacklistTiles[Main.tile[x, y].type] && Main.player[e.Msg.whoAmI].active) if (type == 0 && BlacklistTiles[Main.tile[x, y].type] && Main.player[e.Msg.whoAmI].active)
{ {
players[e.Msg.whoAmI].tileThreshold++; players[e.Msg.whoAmI].tileThreshold++;
}
} }
return; return;
} }
@ -182,6 +180,15 @@ namespace TShockAPI
Tools.Kick(e.Msg.whoAmI, "Spawn NPC abuse"); Tools.Kick(e.Msg.whoAmI, "Spawn NPC abuse");
e.Handled = true; e.Handled = true;
} }
else if (e.MsgID == 0x0D) //Update Player
{
byte plr = e.Msg.readBuffer[e.Index];
if (plr != e.Msg.whoAmI)
{
Tools.Kick(e.Msg.whoAmI, "Update Player abuse");
e.Handled = true;
}
}
else if (e.MsgID == 0x10) else if (e.MsgID == 0x10)
{ {
byte ply; byte ply;

View file

@ -1,80 +1,82 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{49606449-072B-4CF5-8088-AA49DA586694}</ProjectGuid> <ProjectGuid>{49606449-072B-4CF5-8088-AA49DA586694}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TShockAPI</RootNamespace> <RootNamespace>TShockAPI</RootNamespace>
<AssemblyName>TShockAPI</AssemblyName> <AssemblyName>TShockAPI</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json">
<HintPath>.\Newtonsoft.Json.dll</HintPath> <HintPath>.\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="TerrariaServer"> <Reference Include="TerrariaServer">
<HintPath>..\TerrariaServer.exe</HintPath> <HintPath>.\TerrariaServer.exe</HintPath>
</Reference> <Private>False</Private>
<Reference Include="TerrariaServerAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> </Reference>
<SpecificVersion>False</SpecificVersion> <Reference Include="TerrariaServerAPI">
<HintPath>..\..\Program Files (x86)\Steam\steamapps\common\terraria\TerrariaServerAPI.dll</HintPath> <HintPath>.\TerrariaServerAPI.dll</HintPath>
</Reference> <Private>False</Private>
</ItemGroup> </Reference>
<ItemGroup> </ItemGroup>
<Compile Include="Commands.cs" /> <ItemGroup>
<Compile Include="ConfigFile.cs" /> <Compile Include="Commands.cs" />
<Compile Include="ConfigurationManager.cs" /> <Compile Include="ConfigFile.cs" />
<Compile Include="FileTools.cs" /> <Compile Include="ConfigurationManager.cs" />
<Compile Include="Tools.cs" /> <Compile Include="FileTools.cs" />
<Compile Include="TShock.cs" /> <Compile Include="Tools.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="TShock.cs" />
<Compile Include="TSPlayer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> <Compile Include="TSPlayer.cs" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </ItemGroup>
<PropertyGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PreBuildEvent> <PropertyGroup>
</PreBuildEvent> <PreBuildEvent>
</PropertyGroup> </PreBuildEvent>
<PropertyGroup> </PropertyGroup>
<PostBuildEvent>$(SolutionDir)\myass.bat</PostBuildEvent> <PropertyGroup>
</PropertyGroup> <PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>