Skip to content

Commit

Permalink
fix: delete duplicate names causing server to fail to hook and crashi…
Browse files Browse the repository at this point in the history
…ng as a result
  • Loading branch information
Lazrius committed Nov 18, 2023
1 parent 0822183 commit fab0554
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
7 changes: 0 additions & 7 deletions include/Core/FLHook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ class FLHook final
inline static HMODULE remoteClient;
inline static HMODULE flProc;

inline static FARPROC oldShipDestroyed;
inline static FARPROC oldNonGunWeaponHitsBase;
inline static FARPROC oldDamageHit;
inline static FARPROC oldDamageHit2;
inline static FARPROC oldDisconnectPacketSent;
inline static FARPROC oldGuidedHit;

inline static RCSendChatMsgT rcSendChatMsg;
inline static CRCAntiCheatT crcAntiCheat;
inline static GetShipInspectT getShipInspect;
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void FLHook::TimerCheckKick()
{
TryHook
{
const auto time = TimeUtils::UnixTime<std::chrono::milliseconds>();
const auto time = TimeUtils::UnixTime<std::chrono::seconds>();
for (auto& client : Clients())
{
if (client.kickTime)
Expand Down
12 changes: 6 additions & 6 deletions source/Hooks/HookInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ FLHook::PatchInfo FLHook::serverPatch = {
"server.dll",
0x6CE0000,
{
{ 0x6D67274, &IEngineHook::NakedShipDestroyed, 4, &oldShipDestroyed, false },
{ 0x6D67274, &IEngineHook::NakedShipDestroyed, 4, &IEngineHook::oldShipDestroyed, false },
{ 0x6D641EC, &IEngineHook::NakedAddDamageEntry, 4, nullptr, false },
{ 0x6D67320, &IEngineHook::NakedGuidedHit, 4, &oldGuidedHit, false },
{ 0x6D67320, &IEngineHook::NakedGuidedHit, 4, &IEngineHook::oldGuidedHit, false },
{ 0x6D65448, &IEngineHook::NakedGuidedHit, 4, nullptr, false },
{ 0x6D67670, &IEngineHook::NakedGuidedHit, 4, nullptr, false },
{ 0x6D653F4, &IEngineHook::NakedDamageHit, 4, &oldDamageHit, false },
{ 0x6D653F4, &IEngineHook::NakedDamageHit, 4, &IEngineHook::oldDamageHit, false },
{ 0x6D672CC, &IEngineHook::NakedDamageHit, 4, nullptr, false },
{ 0x6D6761C, &IEngineHook::NakedDamageHit, 4, nullptr, false },
{ 0x6D65458, &IEngineHook::NakedDamageHit2, 4, &oldDamageHit2, false },
{ 0x6D65458, &IEngineHook::NakedDamageHit2, 4, &IEngineHook::oldDamageHit2, false },
{ 0x6D67330, &IEngineHook::NakedDamageHit2, 4, nullptr, false },
{ 0x6D67680, &IEngineHook::NakedDamageHit2, 4, nullptr, false },
{ 0x6D67668, &IEngineHook::NakedNonGunWeaponHitsBase, 4, &oldNonGunWeaponHitsBase, false },
{ 0x6D67668, &IEngineHook::NakedNonGunWeaponHitsBase, 4, &IEngineHook::oldNonGunWeaponHitsBase, false },
{ 0x6D6420C, &IEngineHook::NakedLaunchPosition, 4, &IEngineHook::oldLaunchPosition, false },
{ 0x6D648E0, &IEngineHook::FreeReputationVibe, 4, nullptr, false },
}
Expand All @@ -68,7 +68,7 @@ FLHook::PatchInfo FLHook::dalibPatch = {
"dalib.dll",
0x65C0000,
{
{ 0x65C4BEC, &IEngineHook::NakedDisconnectPacketSent, 4, &oldDisconnectPacketSent, false },
{ 0x65C4BEC, &IEngineHook::NakedDisconnectPacketSent, 4, &IEngineHook::oldDisconnectPacketSent, false },
}
};

Expand Down

0 comments on commit fab0554

Please sign in to comment.