Browse Source

Added monitoring for packets that are double sent - should be more accurate

master
Lolwutt 7 years ago
parent
commit
cf1e9df70f
  1. 2
      Deeps/Deeps.h
  2. 9
      Deeps/Deeps.vcxproj
  3. 25
      Deeps/main.cpp
  4. BIN
      release/plugins/Deeps.dll

2
Deeps/Deeps.h

@ -48,6 +48,7 @@ enum SPECEFFECT @@ -48,6 +48,7 @@ enum SPECEFFECT
* @brief Required includes for an extension.
*/
#include "C:\Ashita 3\plugins\ADK\Ashita.h"
#include <list>
#include <map>
#include <functional>
#include <stdint.h>
@ -166,6 +167,7 @@ class Deeps : IPlugin @@ -166,6 +167,7 @@ class Deeps : IPlugin
ILogManager* m_LogManager;
DWORD m_PluginId;
IDirect3DDevice8* m_Direct3DDevice;
std::list<void*> m_Packets;
private:
source_t* getDamageSource(entitysources_t* entityInfo, uint8_t actionType, uint16_t actionID);

9
Deeps/Deeps.vcxproj

@ -77,10 +77,11 @@ @@ -77,10 +77,11 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\..\..\..\..\..\Ashita 3\plugins</OutDir>
<OutDir>..\..\bin\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\bin\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@ -133,6 +134,9 @@ @@ -133,6 +134,9 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>Exports.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>copy "..\..\bin\Deeps.dll" "C:\Ashita 3\plugins\Deeps.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@ -152,6 +156,9 @@ @@ -152,6 +156,9 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>Exports.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>copy "..\..\bin\Deeps.dll" "C:\Ashita 3\plugins\Deeps.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Deeps.h" />

25
Deeps/main.cpp

@ -159,6 +159,11 @@ bool Deeps::Initialize(IAshitaCore* core, ILogManager* log, uint32_t id) @@ -159,6 +159,11 @@ bool Deeps::Initialize(IAshitaCore* core, ILogManager* log, uint32_t id)
*/
void Deeps::Release(void)
{
while (m_Packets.size() > 0)
{
free(*m_Packets.begin());
m_Packets.pop_front();
}
}
/**
@ -296,6 +301,24 @@ bool Deeps::HandleIncomingText(int16_t mode, const char* message, int16_t* modif @@ -296,6 +301,24 @@ bool Deeps::HandleIncomingText(int16_t mode, const char* message, int16_t* modif
*/
bool Deeps::HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked)
{
for (std::list<void*>::iterator it = m_Packets.begin(); it != m_Packets.end(); it++)
{
if (memcmp(data, (*it), size) == 0)
{
return false;
}
}
void* packet = malloc(1024);
memset(packet, 0, 1024);
memcpy(packet, data, size);
m_Packets.push_back(packet);
while (m_Packets.size() > 200)
{
free(*m_Packets.begin());
m_Packets.pop_front();
}
if (id == 0x28) //action
{
uint8_t actionNum = (uint8_t)(unpackBitsBE((unsigned char*)data, 182, 4));
@ -353,7 +376,7 @@ bool Deeps::HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* m @@ -353,7 +376,7 @@ bool Deeps::HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* m
{
uint8_t reaction = (uint8_t)(unpackBitsBE((unsigned char*)data, startBit + 36, 5));
uint16_t animation = (uint16_t)(unpackBitsBE((unsigned char*)data, startBit + 41, 12));
uint32_t mainDamage = (uint16_t)(unpackBitsBE((unsigned char*)data, startBit + 63, 17));
uint32_t mainDamage = (uint32_t)(unpackBitsBE((unsigned char*)data, startBit + 63, 17));
uint8_t speceffect = (uint8_t)(unpackBitsBE((unsigned char*)data, startBit + 53, 9));
if (m_debug)

BIN
release/plugins/Deeps.dll

Binary file not shown.
Loading…
Cancel
Save