HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is something like this possible?

12-17-2006, 09:05 PM#1
Evacide
What I'd like to do is create an anti-maphack similar to the one in use in many Starcraft maps. The maphack reveals a hidden unit/building or something similar that crashes the user's game client. I'm hoping to implement something like this in my Elite Snipers map that is filled with many maphackers. Thx in advance.
12-17-2006, 09:38 PM#2
Captain Griffen
Search function is great. This has been discussed several times. Broken models that normally cannot be seen but when rendered crash the game is one method, I believe.
12-17-2006, 09:55 PM#3
Evacide
Quote:
Originally Posted by Captain Griffen
Search function is great. This has been discussed several times. Broken models that normally cannot be seen but when rendered crash the game is one method, I believe.
sorry to be a pain but I couldn't find anything on broken models that crash the game when rendered. I read your post and searched with quite a few keywords but didn't really find any exact answers.
::edit::
nvm I found some stuff. thx for the help
12-18-2006, 02:23 AM#4
MrApples
Thats genius. Your saying when people use the 'see all' maphack it crashes it for them right? Mind posting what you found here.
12-18-2006, 02:31 AM#5
TaintedReality
Quote:
Thats genius. Your saying when people use the 'see all' maphack it crashes it for them right? Mind posting what you found here.

http://www.wc3campaigns.net/showthre...hlight=maphack
12-18-2006, 03:14 AM#6
Evacide
The link that I found was actually
http://www.wc3campaigns.net/showthread.php?t=83105

I'm currently trying to fix the desync bug that happens in multiplayer games. Can anyone that knows JASS offer a bit of advice?

Code:
constant function AntiHackDummy takes nothing returns integer
   return 'e000'
endfunction

function SafeVision takes nothing returns nothing
   call SetUnitAnimationByIndex(udg_u,1)
endfunction

function Anim takes nothing returns nothing
    set udg_t=udg_t+0.001
    if udg_t==0.025 or (IsUnitVisible(udg_u,GetLocalPlayer()) and udg_t<0.025) then
    call SetUnitAnimationByIndex(udg_u,1)
    endif
endfunction

function AntiMapHackTime takes timer t returns nothing
   set udg_t=0.
   call TimerStart(t,0.001,true,function Anim)
   call TriggerSleepAction(0.)
   call RemoveUnit(udg_u)
   call PauseTimer(t)
   call DestroyTimer(t)
endfunction

function Trig_AntiMapHack_Actions takes nothing returns nothing
   set udg_u=CreateUnit(Player(13),AntiHackDummy(),GetCameraTargetPositionX(),GetCameraTargetPositionY(),0)
   if not(IsUnitVisible(udg_u,GetLocalPlayer())) then
    call SetUnitAnimationByIndex(udg_u,0)
   else
    call SetUnitAnimationByIndex(udg_u,1)
   endif
   call AntiMapHackTime(CreateTimer())
endfunction

//===========================================================================
function InitTrig_Anti takes nothing returns nothing
    set gg_trg_Anti = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Anti, 2.00 )
    call TriggerAddAction( gg_trg_Anti, function Trig_AntiMapHack_Actions )
endfunction

Another trigger sets variables "t", "x", and "y" equal to 0 (variable type is Real) and "u" to Last created unit at map initialization.

You can also look at the map that masda70 posted.
12-18-2006, 06:00 AM#7
masda70
First check out if you have installed it properly: open the map in single player, use a map hack to remove fog of war, then move your camera into a spot normally hidden by fog, game should crash...

Desyncs: you have to keep in mind that unit enters/leaves rect event is triggered when you create units with locust, so there needs to be a condition that prevents the antimaphack dummy unit (assigned to variable udg_u) from triggering non localized friendly code. Why? Since the dummy unit is being created in different places for each player, code triggered that way could run only on a single machine and cause desyncs.
I am not sure if there is anything else to look at concerning desyncs, though I know the code hasn't been extensively tested to actually tell if it works flawlessly or not.

Also, the script actually exploits a model rendering functionality that was really given a posteriori from a series on tests and data gathering and its reliability is somehow doubful.

As a side-note, this method compatibility with replays is sure something to test...
12-18-2006, 06:08 AM#8
masda70
First check out if you have installed it properly: open the map in single player, use a map hack to remove fog of war, then move your camera into a spot normally hidden by fog, game should crash...

Now for desyncs you have to keep in mind mind is that unit enters/leaves rect event is also triggered when you create units with locust, so there needs to be a condition that prevents the dummy unit (assigned to variable u) from triggering those and causing desyncs. Why? Because the dummy unit is creating in different places for each player, meaning that there can code running locally for a single player and potentially cause desyncs.

I am not sure if there is anything else to look after though I know the code hasn't been extensively tested to actually tell if it works flawlessly or not.
I have tested it in multiplayer a few times, doing all kind of stuff, but not in a real game environment.

Also, the script actually exploits a model rendering functionality that was really given a posteriori from a series on tests and data gathering and its reliability is somehow doubful.

As a side-note, this method compatibility with replays is sure something to test...