• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] AntiCheat Pack Thread =)

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
The First Warcraft 3 Complete Anti Cheat Pack!
Features that block cheats block all things similar to that cheat as well. For example, blocking greedisgood blocks all gold/lumber cheats that can result from cheat packs and hacks.


Features:

Color Key
Description
Red
Unfinished
Yellow
Half Finished
Green
Finished
[c]Description

Blocked Cheats
thedudeabides
remove spell cooldown
itvexesme
disable victory conditions
Motherland
skip campaign levels
SomebodySetUpUsTheBomb
instant defeat
AllYourBaseAreBelongToUs
instant win
SharpAndShiny
research upgrades
WarpTen
fast build speed
IocainePowder
fast death/decay
WhosYourDaddy
god mode
PointBreak
no food limit
ThereIsNoSpoon
infinite mana
StrengthAndHonor
can't lose
Synergy
disable tech tree reqs
IseeDeadPeople
makes map visible
WhoIsJohnGalt
enable research
KeyserSoze
extra gold
LeafitToMe
extra lumber
GreedIsGood
extra gold and lumber
RiseAndShine
set time of day to dawn
LightsOut
time of day to dusk
DayLightSavings
set time of day or halt/resume time of day

Protections

Handle Validation
protection against unauthorized handle creation
Player State Validation
protection against unauthorized player state manipulation
Fog State Validation
protection against fogstate handle manipulation
Unit Handle Validation
protection against movement/manipulation of units
Item Handle Validation
protection against movement/manipulation of items

Updates

  • Fixed up gold/lumber tracking

JASS:
library AntiCheat uses PlayerManager, WorldBounds
    //hiveworkshop.com/forums/jass-functions-413/system-pt-player-tracking-142554/
    //www.hiveworkshop.com/forums/jass-functions-413/snippet-worldbounds-180494/
    
    //v1.0.0.12
    //trading still bugged
    
    globals
        //prevents manipulation of all player states
        constant boolean ANTI_PLAYER_STATE = true
        //prevents manipulation of fog
        constant boolean ANTI_FOG = true
        //prevents players from becoming immortal
        constant boolean ANTI_GOD = false
        //prevents players from warp building
        constant boolean ANTI_WARP = true
        //prevents players from creating handles
        constant boolean ANTI_HANDLE_CREATION = true
        //prevents infinite mana cheat
        constant boolean ANTI_MANA = true
    endglobals
    
    globals
        private constant integer ANTI_GOD = 'aPSN'
        private constant integer ANTI_MH = 'aLSN'
        private constant integer ANTI_MANA_ABI = 'aNSN'
    endglobals
    //!         external ObjectMerger w3u hgtw aPSN unam "AntiCheatGod" unsf "(AntiCheat)" uabi "aNSN" ua1b "1" ua1d "1" ua1s "1" ua1r "64" uwu1 "0" def "0" ucol "0" upap "" usnd "" ubsl "" uibo "1" ucbo "1" uhpm "50000" uhpr "400" uhrt "always" ulum "0" usid "128" usin "128" ureq "" upgr "" utip " " utub " " umpi "12" ua1c ".01" ua1m "" ua1w "instant" umpm "20" umpr "7" uubs "" ushr "0" upat "" uacq "64" usca ".01"
    //!         external ObjectMerger w3u hgtw aLSN unam "AntiCheatMH" unsf "(AntiCheat)" uabi "aNSN" ua1b "1" ua1d "1" ua1s "1" ua1r "64" uwu1 "0" def "0" ucol "0" upap "" usnd "" ubsl "" uibo "1" ucbo "1" uhpm "50000" uhpr "400" uhrt "always" ulum "0" usid "0" usin "0" ureq "" upgr "" utip " " utub " " umpi "12" ua1c ".01" ua1m "" ua1w "instant" umpm "20" umpr "7" uubs "" ushr "0" upat "" uacq "64" usca ".01"
    //!         external ObjectMerger w3a AEim aNSN anam "AntiCheatMana" ansf "(AntiCheat)" aher "0" alev "1" aare 1 "0" amcs 1 "0" atar 1 "" achd "0" atp1 1 " " aub1 1 " " aut1 1 " " auu1 1 " " arhk 1 ""

    globals
        private hashtable table = InitHashtable()
    endglobals
    
    private function PlayerState takes player p, playerstate ps, integer val returns nothing
        call SaveInteger(table, GetPlayerId(p), GetHandleId(ps), val)
    endfunction
    
    hook SetPlayerState PlayerState
    
    private struct AntiCheater extends array
        private static integer gid
        private static integer lid
        
        private static integer tval = 0
        private static integer tps = 0
        private static player tp = null
        private static integer tpd = 0
        private static hashtable tradetable = InitHashtable()
        
        private static integer array bounty
        private static integer array unknowns
        
        public static player cheated = null
        public static trigger cheats = CreateTrigger()
        public static boolean endgame = false
        
        private static real antisyncm = 0
        private static real bountysyncm = 0
        private static real antisyncs = 0
        private static real bountysyncs = 0
        
        private static timer ptime = CreateTimer()
        
        private static timer timestamp = CreateTimer()
        private static real minutes = 0
        
        private static method operator seconds takes nothing returns real
            return TimerGetElapsed(timestamp)
        endmethod
        
        private static method sync takes boolean b returns nothing
            if (b) then
                set bountysyncm = minutes
                set bountysyncs = seconds
            else
                set antisyncm = minutes
                set antisyncs = seconds
            endif
        endmethod
        
        private static method vsyncc takes boolean b returns boolean
            if (b) then
                return bountysyncm == minutes and bountysyncs == seconds
            endif
            return antisyncm == minutes and antisyncs == seconds
        endmethod
        
        private static method operator vsync takes nothing returns boolean
            return bountysyncm == antisyncm and bountysyncs == antisyncs
        endmethod
        
        private static method ptc takes nothing returns nothing
            local Players p = 0
            local boolean gc = false
            loop
                if (unknowns != bounty) then
                    call SetPlayerState(p.get, PLAYER_STATE_RESOURCE_GOLD, LoadInteger(table, p, gid))
                    call SetPlayerState(p.get, PLAYER_STATE_RESOURCE_LUMBER, LoadInteger(table, p, lid))
                    set gc = true
                    if (cheated == null) then
                        set cheated = Players.get
                    endif
                else
                    call SaveInteger(table, p, gid, GetPlayerState(p.get, PLAYER_STATE_RESOURCE_GOLD))
                    call SaveInteger(table, p, lid, GetPlayerState(p.get, PLAYER_STATE_RESOURCE_LUMBER))
                endif
                set p = p.next
                exitwhen p.end
            endloop
            
            if (gc) then
                call TriggerEvaluate(cheats)
            endif
            set cheated = null
        endmethod
        
        private static method anti takes nothing returns boolean
            local player p = GetTriggerPlayer()
            local integer pid = GetPlayerId(p)
            local playerstate e = GetEventPlayerState()
            local integer pstate = GetPlayerState(p, e)
            local integer hid = GetHandleId(e)
            local integer ptable = LoadInteger(table, pid, hid)
            local Players ps = 0
            local integer eid
            local integer eid2 = 0
            
            //Sync and Reset
            ///////////////////////////////////////////////
            if (not vsyncc(false)) then
                call sync(false)
                set ps = 0
                loop
                    set unknowns[ps] = 0
                    set ps = ps.next
                    exitwhen ps.end
                endloop
                set tval = 0
                set tps = 0
                set tp = null
                set tpd = 0
                call FlushChildHashtable(tradetable, 0)
            endif
            
            if (not vsync) then
                set ps = 0
                loop
                    set bounty[ps] = 0
                    set ps = ps.next
                    exitwhen ps.end
                endloop
                call sync(true)
            endif
            ///////////////////////////////////////////////
            
            if (e == PLAYER_STATE_RESOURCE_GOLD or e == PLAYER_STATE_RESOURCE_LUMBER) then
                if (pstate != ptable) then
                    if (e == PLAYER_STATE_RESOURCE_GOLD) then
                        set eid = gid
                    else
                        set eid = lid
                        set eid2 = 1
                    endif
                    
                    if (tp != null and tps == eid and tval == -(pstate-ptable) and tp != p and not LoadBoolean(tradetable, 0, (tpd*17+pid)*10+eid2)) then
                        call SaveBoolean(tradetable, 0, (tpd*17+pid)*10+eid2, true)
                        call SaveBoolean(tradetable, 0, (pid*17+tpd)*10+eid2, true)
                        call SaveInteger(table, pid, hid, -tval+pstate)
                        call SaveInteger(table, tpd, hid, tval+pstate)
                        set tp = null
                        set unknowns[tpd] = unknowns[tpd] - 1
                    else
                        set unknowns[pid] = unknowns[pid] + 1
                        set tval = (pstate-ptable)
                        set tps = pid
                        set tp = p
                        if (cheated == null) then
                            set cheated = tp
                        endif
                    endif
                    
                    call TimerStart(ptime, 0, false, function thistype.ptc)
                endif
            elseif (pstate != ptable) then
                if (cheated == null) then
                    set cheated = Player(pid)
                endif
                call TriggerEvaluate(cheats)
                set cheated = null
                
                call SetPlayerState(p, e, ptable)
            endif
            
            return false
        endmethod
        
        private static method update takes nothing returns boolean
            local eventid e = GetTriggerEventId()
            local Players pid
            
            if (not vsyncc(true)) then
                set pid = 0
                loop
                    set bounty[pid] = 0
                    set pid = pid.next
                    exitwhen pid.end
                endloop
                call sync(true)
            endif
            
            if (e == EVENT_PLAYER_UNIT_SELL) then
                set pid = GetPlayerId(GetTriggerPlayer())
                set bounty[pid] = bounty[pid] + 1
                set pid = GetPlayerId(GetOwningPlayer(GetBuyingUnit()))
                set bounty[pid] = bounty[pid] + 1
            elseif (e == EVENT_PLAYER_UNIT_DEATH) then
                if (GetKillingUnit() != null) then
                    set pid = GetPlayerId(GetOwningPlayer(GetKillingUnit()))
                    set bounty[pid] = bounty[pid] + 1
                endif
            else
                set pid = GetPlayerId(GetTriggerPlayer())
                set bounty[pid] = bounty[pid] + 1
            endif
            
            return false
        endmethod
        
        private static method cheater takes nothing returns boolean
            set cheated = GetTriggerPlayer()
            return false
        endmethod
        
        static if ANTI_FOG then
            private static method antifogc takes nothing returns boolean
                call Cheat("iseedeadpeople")
                
                if (cheated == null) then
                    set cheated = GetOwningPlayer(GetAttacker())
                endif
                call TriggerEvaluate(cheats)
                set cheated = null
                
                return false
            endmethod
        endif
        static if ANTI_GOD then
            private static method antigodc takes nothing returns boolean
                local unit antiunit
                
                call Cheat("whosyourdaddy")
                
                set antiunit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
                call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
                call SetUnitX(antiunit, WorldBounds.minX)
                call SetUnitY(antiunit, WorldBounds.minY)
                
                if (cheated == null) then
                    set cheated = GetOwningPlayer(GetKillingUnit())
                endif
                //set endgame = true
                call TriggerEvaluate(cheats)
                set cheated = null
                
                return false
            endmethod
        endif
        
        static if ANTI_MANA then
        
        private static method antimanac takes nothing returns boolean
            if (cheated == null) then
                set cheated = GetOwningPlayer(GetTriggerUnit())
            endif
            set endgame = true
            call TriggerEvaluate(cheats)
            set cheated = null
            
            return false
        endmethod
        endif
        
        private static method timestamps takes nothing returns nothing
            set minutes = minutes + 1
        endmethod
        
        private static method onInit takes nothing returns nothing
            local trigger t = CreateTrigger()
            local trigger t2 = CreateTrigger()
            local Human p = Human.first
            local Players p2 = 0
            local trigger t3 = CreateTrigger()
            static if ANTI_MANA then
                local trigger t4 = CreateTrigger()
            endif
            static if ANTI_FOG then
                local trigger t5 = CreateTrigger()
            endif
            static if ANTI_GOD then
                local trigger t6 = CreateTrigger()
            endif
            local unit antiunit
            
            set gid = GetHandleId(PLAYER_STATE_RESOURCE_GOLD)
            set lid = GetHandleId(PLAYER_STATE_RESOURCE_LUMBER)
            
            loop
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_ALLIED_VICTORY, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_FOOD_CAP_CEILING, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GAME_RESULT, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GIVES_BOUNTY, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_ALLIED_VICTORY, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GOLD_GATHERED, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_GOLD_UPKEEP_RATE, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_LUMBER_GATHERED, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_LUMBER_UPKEEP_RATE, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_NO_CREEP_SLEEP, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_OBSERVER, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_OBSERVER_ON_DEATH, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_PLACED, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_FOOD_CAP, GREATER_THAN_OR_EQUAL, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_FOOD_USED, GREATER_THAN_OR_EQUAL, 0.)
                call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_HERO_TOKENS, GREATER_THAN_OR_EQUAL, 0.)
                call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_RESOURCE_LUMBER, GREATER_THAN, 0.)
                //call TriggerRegisterPlayerStateEvent(t, p2.get, PLAYER_STATE_UNFOLLOWABLE, GREATER_THAN_OR_EQUAL, 0.)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_DEATH, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_SELL, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_PAWN_ITEM, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_TRAIN_START, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_TRAIN_CANCEL, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_RESEARCH_START, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_RESEARCH_CANCEL, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_UPGRADE_START, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_UNIT_UPGRADE_CANCEL, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_HERO_REVIVE_START, null)
                call TriggerRegisterPlayerUnitEvent(t2, p2.get, EVENT_PLAYER_HERO_REVIVE_CANCEL, null)
                
                if (Human[p2].get != null) then
                    call TriggerRegisterPlayerChatEvent(t3, p2.get, "", false)
                endif
                
                set p2 = p2.next
                exitwhen p2.end
            endloop
            
            call TriggerAddCondition(t, Condition(function thistype.anti))
            call TriggerAddCondition(t2, Condition(function thistype.update))
            call TriggerAddCondition(t3, Condition(function thistype.cheater))
            
            static if ANTI_MANA then
                set antiunit = CreateUnit(Human.first.get, ANTI_MH, WorldBounds.maxX, WorldBounds.maxY, 0)
                call IssueImmediateOrder(antiunit, "immolation")
                call TriggerRegisterUnitStateEvent(t4, antiunit, UNIT_STATE_MANA, GREATER_THAN, 12.)
                call TriggerAddCondition(t4, Condition(function thistype.antimanac))
                call UnitAddAbility(antiunit, 'Aloc')
                call UnitAddAbility(antiunit, 'Aivs')
                call UnitAddAbility(antiunit, 'Avul')
            endif
            static if ANTI_FOG then
                set p = Human.first
                loop
                    set antiunit = CreateUnit(p.get, ANTI_MH, WorldBounds.minX, WorldBounds.maxY, 0)
                    call TriggerRegisterUnitEvent(t5, antiunit, EVENT_UNIT_ATTACKED)
                    call SetUnitX(antiunit, WorldBounds.minX)
                    call SetUnitY(antiunit, WorldBounds.maxY)
                    set p = p.next
                    exitwhen p.end
                endloop
                
                set antiunit = CreateUnit(Players(12).get, ANTI_MH, WorldBounds.minX, WorldBounds.maxY, 0)
                call TriggerRegisterUnitEvent(t5, antiunit, EVENT_UNIT_ATTACKED)
                call SetUnitX(antiunit, WorldBounds.minX)
                call SetUnitY(antiunit, WorldBounds.maxY)
                call TriggerAddCondition(t5, Condition(function thistype.antifogc))
                call PauseUnit(antiunit, true)
            endif
            static if ANTI_GOD then
                set p = Human.first
                loop
                    set antiunit = CreateUnit(p.get, ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
                    call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
                    call SetUnitX(antiunit, WorldBounds.minX)
                    call SetUnitY(antiunit, WorldBounds.minY)
                    set p = p.next
                    exitwhen p.end
                endloop
                
                set antiunit = CreateUnit(Players(12).get, ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
                call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
                call SetUnitX(antiunit, WorldBounds.minX)
                call SetUnitY(antiunit, WorldBounds.minY)
                call TriggerAddCondition(t6, Condition(function thistype.antigodc))
            endif
            
            call TimerStart(timestamp, 60, true, function thistype.timestamps)
        endmethod
    endstruct
    
    struct Cheater extends array
        public static method operator get takes nothing returns player
            return AntiCheater.cheated
        endmethod
        public static method onCheat takes boolexpr bc returns nothing
            call TriggerAddCondition(AntiCheater.cheats, bc)
        endmethod
        public static method operator endgame takes nothing returns boolean
            return AntiCheater.endgame
        endmethod
    endstruct
endlibrary

JASS:
struct Tester extends array
    private static method catch takes nothing returns boolean
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 100000, GetPlayerName(Cheater.get) + " has attempted to cheat!")
        if (Cheater.endgame) then
            //call EndGame(false) //game is ruined
        elseif (GetLocalPlayer() == Cheater.get) then
            //call EndGame(false)
        endif
        return false
    endmethod
    
    private static method onInit takes nothing returns nothing
        call Cheater.onCheat(Condition(function thistype.catch))
    endmethod
endstruct
 
Last edited:
Level 20
Joined
Jul 6, 2009
Messages
1,885
This seems very useful.
Maybe you can add blocker for vision cheats such as iseedeadpeople.

Umm...when i activated a cheat,it didn't say my name as a cheater,it said:
" has attempted to cheat" o_O
Also,it didn't end game as it should for cheater,or i didn't set some global boolean to true? D:
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
The update has the fix for that.

With single player wc3 cheats, the name never gets registered, so I had to make a tweak.

Name now shows up.

lol
JASS:
if (cheated == null) then
    set cheated = Player(pid)
endif

I made the update 5 mins before your post : P

I am planning to block every possible cheat from changing ownership of units to creating units to creating items to everything : ). I'm just starting with player states.

The challenge with lumber/gold cheat detection was capturing trade events ; P.


I need testers to try it with trading, selling, and etc to make sure this is stable ^^.
 
Level 3
Joined
Jan 3, 2010
Messages
53
If you complete this, it will be Legen— wait for it... Legen— wait for it... LEGENDARY!!!
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Actually, the overhead on a generic anti cheat pack would be rather insane. I'd prefer to think of using this for implementing anti cheat packs engineered for a specific map. When they are made for a specific map, the overhead drastically drops : ).

For example, in an RPG, if you only ever control one unit, you can check for changes in unit ownership as well as created units. If a unit enters a map and is not the player's unit but belongs to the player, then the player cheated. Much simpler unit handle validation than would be required of a generic anti cheat pack : ).
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
The whosyourdaddy shouldn't be hard enough to prevent. Use the old trick placing 2 dummy units, one owner is the single player and the other is neutral hostile with high hp reg. These are not visible but still the player's unit attacks the other one with a low damage. When cheat is turned on, the neutral hostile dies. Cheat detected. Simple Enough.

You have darn many projects, where do you find time? :p
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
That code is already in the system if you didn't notice : p

JASS:
        static if ANTI_GOD then
            private static method antigodc takes nothing returns boolean
                local unit antiunit
                
                call Cheat("whosyourdaddy") //disable
                
                set antiunit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
                call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
                call SetUnitX(antiunit, WorldBounds.minX)
                call SetUnitY(antiunit, WorldBounds.minY)
                
                if (cheated == null) then
                    set cheated = GetOwningPlayer(GetKillingUnit())
                endif
                //set endgame = true
                call TriggerEvaluate(cheats)
                set cheated = null
                
                return false
            endmethod
        endif

JASS:
            static if ANTI_GOD then
                set p = Human.first
                loop
                    set antiunit = CreateUnit(p.get, ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
                    call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
                    call SetUnitX(antiunit, WorldBounds.minX)
                    call SetUnitY(antiunit, WorldBounds.minY)
                    set p = p.next
                    exitwhen p.end
                endloop
                
                set antiunit = CreateUnit(Players(12).get, ANTI_GOD, WorldBounds.minX, WorldBounds.minY, 0)
                call TriggerRegisterUnitEvent(t6, antiunit, EVENT_UNIT_DEATH)
                call SetUnitX(antiunit, WorldBounds.minX)
                call SetUnitY(antiunit, WorldBounds.minY)
                call TriggerAddCondition(t6, Condition(function thistype.antigodc))
            endif

: D

The only thing is, it can't be placed out of camera bounds or it won't attack unless fog is disabled ;o, even if it has sight radius. As you see, I'm current placing at it at the map's edge, which resulted in it not working (didn't know why it didn't work until just now, I just realized this as I wrote this post).

The thing was marked as red and disabled because I was totally lost as to why it was bugged, haha.


And btw, Trade Event took me like 15 mins to code as the work was already done in this anti cheat pack.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Er, this prevents the cheats as well as any manipulations similar to them... this means that the person would have to disable the anti-cheat pack to get their stuff to work.

You can do various levels of protection to make it extremely difficult. Each level of protection may only take 10 seconds to implement, but require hours to disable.

Protections would work off of layered values. Starting new protections would be easy and adding layers would also be easy. Every single layer would have to be undone from the top to the bottom.

I only find this to be useful on maps with save/load features.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
There are a couple of methods. CountUnitsOfType saved into code using an obscure object id with escape characters and etc (possible via lua). Validation done via a validation system, which would attach itself to an anti-cheat pack. The save/load system would attach itself to both the validation system and the anti-cheat pack. Essentially, you cannot rip one out without destroying the other two. This would be insane coupling, but it would ensure that a person couldn't just rip one out. Furthermore, if they tried to rip all three out, they'd run into validation issues with the CountUnitsOfType native that uses the obscure unit ids.


Yes, I spent a great deal of time thinking about this : P.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,195
Uh hu, and that will last like? 10 minutes?

Firstly, all units of a certain type have to be made somehwere which people can read. Secondly parts of code not involved in the save system can be disabled.

The net result is that you will have added needless complexity to a map. The simplest way is to just make your map so that people do not need to cheat or that it does not mater if they cheat.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
They don't?

I'll remove them then, but they were on a list of TFT cheats ; ).

and I'll update description too, no worries.

->coding looks good but I'm not really a fan of these systems
(good for JASS**)
ofc the coding is good, I'm the one who coded it : P

edit
I'll be getting back into this soon : O, but keep in mind that this next week = end of semester, so I am going to be a busy little bee.
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
Well, I'm doing my last final atm. After this, I have to catch up on some shows, fix up a few bugs in other systems, and then I can get back to this ; ).

I finished the day before yesterday :grin:

to prevent maphack:
you could create a model with giant size and place it somewhere where it should not be seen
usually units and so on disappear if they are outside of the camera bounds but this will fix it
http://www.wc3c.net/showthread.php?t=90920

edit:
made the model and a few tests
only works with doodads so it is not possible to remove them ingame but they can be hidden with triggers (just found out)
far sight should be canceled if a cast is about to reveal the area where the doodad is at
could not test it with maphack because I don't have one but it works fine with fog of war and black mask
edit2:
works against maphacks :D
although I found out that many maphacks are able to change the camera distance so it might be necessary to place a few more antimaphack doodads and change their height with Ctrl+PageUp
edit3:
placing the doodad outside of the playable map bounds disables far sight from seeing it but sometimes it does not get triggered by the maphack
 

Attachments

  • AntiMapHack.w3x
    14.1 KB · Views: 84
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
er... my current method stops maphack.


before suggesting how to do a feature, be sure that the feature is colored red on the list : )

anti visual is actually colored green, meaning it is 100% working and bug free.

hm yeah right
just in case you need another method :grin:

are you sure it works against maphack or just against triggered changes?
I'd test it myself but I can't compile it without JNGP
edit:
I downloaded JNGP just for you and it detecting "disable black mask" and "disable fog of war" works
but the maphack still reveals the map without triggering the anti cheat stuff
I uploaded the map so you can see if I did something wrong
on the screenshot you can see the map revealed with maphack
 

Attachments

  • AntiCheatPack.w3x
    34.1 KB · Views: 79
  • maphack.jpg
    maphack.jpg
    173 KB · Views: 164
Last edited:

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Does this also stop the infamous hack which makes the map 200kb larger than usual. Also that hack makes significant impacts on the wc3 engines, possible making triggers useless and cheats.

Also it seems like the hacked maps replicates the possiblities of using wc3 cheats for multiplayer by a "-cheaton" command which is common in many hacked maps. But there is also loads of commands.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
With some of the new systems I've been creating like Resource and TradeEvent, gold/lumber cheats are easier to detect in this. I haven't worked on this lately as I'm working on 1000 other things that are more useful, lol... like SetUnitTypeId, AttackIndexer, SpellAttackIndexer, RangedAccuracy, my lua framework thingie, all of my lua scripts, and updates to previous scripts, as well as Bounty.

When I get the time to work on this again, I can do so, but I'm a very busy little bee ; P. I can only do so much ; D.

Also, I don't think that there is any way to detect a map hack ; |. If my current method doesn't detect it, then there is no method that can do it. My current method uses the wc3 engine to detect it by placing units right next to each other with 0 sight. If one of the units attacks another unit, then the owner of the attacking unit cheated. However, this can currently be fudged up by messing with fogstate within the map, so probably have to hook yet more natives...

All of the hooks required for this to truly work will make any map sad to have this in it. A hook replaces the native call with a trigger evaluation. Furthermore, do hooks even work with GUI? If not, then this pack isn't compatible at all with GUI.

My iffiness on continuing this project has been from the hooks. I wouldn't use this in any map unless it was a save/load multiplayer map ; | (and then you better get ready for some major perfromance hits and possible lag).

And Unit Handle Validation would kill all Projectile Systems*

I don't think that the overhead justifies the features = ).
 
Status
Not open for further replies.
Top