-
Notifications
You must be signed in to change notification settings - Fork 7
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
spumer
committed
Jul 8, 2013
1 parent
7e2ac80
commit 440fec0
Showing
19 changed files
with
261 additions
and
67 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
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,4 +1,5 @@ | ||
Left4Fix | ||
======== | ||
|
||
Extension for SourceMod written on C++ and fix major bug on servers more than 8 players: incorrect completion score calculation. | ||
Extension for SourceMod written on C++ and fix major bug on servers more than 8 players: incorrect completion score calculation. | ||
Main thread on the forum: http://forums.alliedmods.net/showthread.php?t=219774 |
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,44 @@ | ||
|
||
UpdateMarkersReached: E8 ? ? ? ? F3 0F 2A ? ? C1 F8 02 (EAX, EBX, EDX) | ||
AddSurvivorStats: E8 ? ? ? ? C1 F8 02 (EAX, ECX, EDX) | ||
GetVersusCompletion: 8B 55 ? A1 ? ? ? ? 8B BA E8 0D 00 00 89 ? ? C1 FF 02 (EAX, EDI, EDX) | ||
|
||
|
||
UpdateMarkersReached_patch: | ||
|
||
E9 ? ? ? ? /* JMP [address] */ | ||
8B 80 E8 0D 00 00 /* mov eax, [eax+3560] */ | ||
31 D2 /* xor edx, edx */ | ||
BB 0A 00 00 00 /* mov ebx, 10 */ | ||
F7 F3 /* div ebx */ | ||
E9 ? ? ? ? /* JMP [address] ;jump to next instruction */ | ||
/* NOP 3 bytes (sar eax, 2) */ | ||
|
||
Result: | ||
{ 0x8B, 0x80, 0xE8, 0x0D, 0x00, 0x00, 0x31, 0xD2, 0xBB, 0x0A, 0x00, 0x00, 0x00, 0xF7, 0xF3 } | ||
|
||
AddSurvivorStats_patch: | ||
E9 ? ? ? ? /* JMP [address] */ | ||
8B 80 E8 0D 00 00 /* mov eax, [eax+3560] */ | ||
31 D2 /* xor edx, edx */ | ||
B9 0A 00 00 00 /* mov ecx, 10 */ | ||
F7 F1 /* div ecx */ | ||
E9 ? ? ? ? /* JMP [address] ;jump to next instruction */ | ||
Result: | ||
{ 0x8B, 0x80, 0xE8, 0x0D, 0x00, 0x00, 0x31, 0xD2, 0xB9, 0x0A, 0x00, 0x00, 0x00, 0xF7, 0xF1 } | ||
|
||
GetVersusCompletion_patch: | ||
|
||
E9 ? ? ? ? /* JMP [address] */ | ||
8B 45 08 /* mov eax, [ebp+arg_0] */ | ||
/* copy A1 ? ? ? ? to trampoline end */ | ||
8B 80 E8 0D 00 00 /* mov eax, [eax+3560] */ | ||
/* copy 89 ? ? to trampoline end */ | ||
31 D2 /* xor edx, edx */ | ||
BF 0A 00 00 00 /* mov edi, 10 */ | ||
F7 F7 /* div edi */ | ||
89 C7 /* mov edi, eax */ | ||
E9 ? ? ? ? /* JMP [address] ;jump to next instruction */ | ||
Result: | ||
{ 0x8B, 0x45, 0x08, 0x8B, 0x80, 0xE8, 0x0D, 0x00, 0x00, 0x31, 0xD2, 0xBF, 0x0A, 0x00, 0x00, 0x00, 0xF7, 0xF7, 0x89, 0xC7 } | ||
|
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
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,49 @@ | ||
/** | ||
* vim: set ts=4 : | ||
* ============================================================================= | ||
* Left 4 Fix SourceMod Extension | ||
* Copyright (C) 2013 Spumer. | ||
* ============================================================================= | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, version 3.0, as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* As a special exception, AlliedModders LLC gives you permission to link the | ||
* code of this program (as well as its derivative works) to "Half-Life 2," the | ||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software | ||
* by the Valve Corporation. You must obey the GNU General Public License in | ||
* all respects for all other code used. Additionally, AlliedModders LLC grants | ||
* this exception to all derivative works. AlliedModders LLC defines further | ||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), | ||
* or <http://www.sourcemod.net/license.php>. | ||
* | ||
* Version: $Id$ | ||
*/ | ||
|
||
#include "end_versus_mode_round.h" | ||
#include "extension.h" | ||
|
||
namespace Detours | ||
{ | ||
void l4fx_EndVersusModeRound::OnEndVersusModeRound(bool countSurvivors) | ||
{ | ||
if(g_bRoundEnd_Pre) return; | ||
g_bRoundEnd_Pre = true; | ||
(this->*(GetTrampoline()))(countSurvivors); | ||
|
||
memset(g_iHighestVersusSurvivorCompletion, 0, sizeof(g_iHighestVersusSurvivorCompletion)); | ||
memset(g_players, 0, sizeof(g_players)); | ||
memset(g_scores, 0, sizeof(g_scores)); | ||
__sync_and_and_fetch(&g_totalResult, 0); // g_totalResult = 0; | ||
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,62 @@ | ||
/** | ||
* vim: set ts=4 : | ||
* ============================================================================= | ||
* Left 4 Fix SourceMod Extension | ||
* Copyright (C) 2013 Spumer. | ||
* ============================================================================= | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, version 3.0, as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* As a special exception, AlliedModders LLC gives you permission to link the | ||
* code of this program (as well as its derivative works) to "Half-Life 2," the | ||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software | ||
* by the Valve Corporation. You must obey the GNU General Public License in | ||
* all respects for all other code used. Additionally, AlliedModders LLC grants | ||
* this exception to all derivative works. AlliedModders LLC defines further | ||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), | ||
* or <http://www.sourcemod.net/license.php>. | ||
* | ||
* Version: $Id$ | ||
*/ | ||
|
||
#ifndef _INCLUDE_SOURCEMOD_DETOUR_END_VERSUS_MODE_ROUND_H_ | ||
#define _INCLUDE_SOURCEMOD_DETOUR_END_VERSUS_MODE_ROUND_H_ | ||
|
||
#include "detour_template.h" | ||
|
||
namespace Detours { | ||
|
||
class l4fx_EndVersusModeRound; | ||
typedef void (l4fx_EndVersusModeRound::*EndVersusModeRoundFunc)(bool); | ||
|
||
class l4fx_EndVersusModeRound : public DetourTemplate<EndVersusModeRoundFunc, l4fx_EndVersusModeRound> | ||
{ | ||
private: //note: implementation of DetourTemplate abstracts | ||
|
||
void OnEndVersusModeRound(bool countSurvivors); | ||
|
||
// get the signature name from the game conf | ||
virtual const char *GetSignatureName() | ||
{ | ||
return "EndVersusModeRound"; | ||
} | ||
|
||
//notify our patch system which function should be used as the detour | ||
virtual EndVersusModeRoundFunc GetDetour() | ||
{ | ||
return &l4fx_EndVersusModeRound::OnEndVersusModeRound; | ||
} | ||
}; | ||
|
||
}; | ||
#endif |
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
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
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
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
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
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
Oops, something went wrong.