This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
forked from LiteLDev/LeviLamina
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request LiteLDev#61 from LiteLDev/dev
Add FixListenPort
- Loading branch information
Showing
2 changed files
with
31 additions
and
5 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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
#include "pch.h" | ||
|
||
bool isFixDisconnectBug(); | ||
bool isFixListenPort(); | ||
|
||
//Fix disconnect packet crash bug | ||
THook(void, "?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVDisconnectPacket@@@Z", ServerNetworkHandler* thi, NetworkIdentifier* ni, void* packet) { | ||
if (isFixDisconnectBug()) { | ||
return; | ||
} | ||
return original(thi, ni, packet); | ||
} | ||
//Fix the listening port twice | ||
//From /~https://github.com/Redbeanw44602/FixIPLogger | ||
bool a_call = true; | ||
THook(__int64, "?LogIPSupport@RakPeerHelper@@AEAAXXZ", | ||
void* _this) { | ||
if (isFixListenPort()) { | ||
if (a_call) { | ||
a_call = false; | ||
return original(_this); | ||
} | ||
return 0; | ||
} else { | ||
return original(_this); | ||
} | ||
} |
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