False Positives in Replay Detect Code.

Terrabull

Veteran Member (Done that)
Reaction score
38
I am using the Replay Detect code from the Anti-Map Hack System.
I don't know if something has changed in the game that made this code ineffective, or if there is something wrong with the code in the first place.
The problem I am having is that out of the six people in the game, one or two may get told that they are in a game, while the others are told they are in a replay. This is problematic in my map because it shows info about all the players to anyone in a replay, which gives the other players strategic information they shouldn't have.
Removing it also hurts my efforts to error-check the map because I can't see half of the actions in a replay. In a replay the triggers always act like you are Player 1, regardless of which player you select in that drop down.
Anyways, I've found another version of the code which I compared and found it to be functionally equivalent to the one I am using. I will post both here anyways.

http://wc3campaigns.net/showthread.php?t=101256

JASS:
//**************************************************************************************
//*                                                                                    *
//*                         REPLAY DETECT ENGINE V1.30                                 *
//*                     CONFIGURATION SETTINGS START HERE                              *
//*                                                                                    *
//**************************************************************************************
library ReplayDetectEngine
globals
boolean gInGame = true
endglobals

//-> IsInGame created by PandaMine with help from Captain Griffen
//This function is what makes it possible for the system not to break replays,
//simply put if your actually playing the game, this function will return false.
//It will return true if the game is being viewed in a replay

private function IsInGame takes nothing returns boolean
local integer counter = 1
local real camerax
local real cameray
local real x
local real y
local boolean output
//call DisplayTextToPlayer(GetLocalPlayer(),0,0,"Testing The Game now!")
loop
    exitwhen counter > 12
    if GetLocalPlayer() == Player(counter-1) then
        set camerax = GetCameraTargetPositionX()
        set cameray = GetCameraTargetPositionY()
    endif
    set counter = counter + 1
endloop
set counter = 1
call PauseGame(true)
call TriggerSleepAction(0)
loop
    exitwhen counter > 12
    if GetLocalPlayer() == Player(counter-1) then
        call SetCameraPosition(camerax + 1,cameray + 1)
    endif
    set counter = counter + 1
endloop
call TriggerSleepAction(0)
call PauseGame(false)
set counter = 1
loop
    exitwhen counter > 12
    if GetLocalPlayer() == Player(counter-1) then
        set x = GetCameraTargetPositionX()
        if x == camerax + 1 then
            set output = true
        else
            set output = false
        endif
        call SetCameraPosition(camerax,cameray)
    endif
    set counter = counter + 1
endloop
return output
endfunction 

function AMHS_ReplayEngine takes nothing returns nothing
//call DisplayTextToPlayer(GetLocalPlayer(),0,0,"Replay Detect Starting.")
call EnableUserControl(false)
call TriggerSleepAction(.0)
set gInGame = IsInGame()
call EnableUserControl(true)
endfunction
endlibrary


So, anyone got any thoughts?
 

Terrabull

Veteran Member (Done that)
Reaction score
38
Well I tried both of the suggestions, and I'm still getting false positives. Is it just not possible to detect it regularly?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top