找回密码
 点一下
查看: 5123|回复: 11

[转帖]国外的反MH系统(可禁小地图)

[复制链接]
发表于 2007-12-7 18:07:05 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2007-12-7 19:44:24 | 显示全部楼层
有什么用?啊
回复

使用道具 举报

发表于 2007-12-7 19:48:04 | 显示全部楼层
我怎么没试出来?= =
回复

使用道具 举报

发表于 2007-12-7 21:08:17 | 显示全部楼层
小地图屏蔽。是骗人滴。
正常情况。他也把小地图给咔嚓了。。。
回复

使用道具 举报

 楼主| 发表于 2007-12-7 21:17:28 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2007-12-7 21:50:54 | 显示全部楼层
哈,其实这个演示很好用,虽然因为一个else写错了地方 导致被屏蔽掉的小图标不会被重新显示。。于是就相当于没用了。
原理说起来就是利用UnitSetUsesAltIcon 和SetAltMinimapIcon 来抹掉当前本地玩家所有看不见单位的小地图图标~当然这个过程是可还原的。
将那个函数调整一下即可
[codes=jass]function AMHS_MiniMapProtectCheck takes nothing returns nothing
local integer counter = 1
local unit u = GetEnumUnit()
loop
    exitwhen counter > 12
        if (GetPlayerSlotState(Player(counter -1)) == PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(Player(counter - 1)) == MAP_CONTROL_USER) then
            if IsUnitVisible(u,Player(counter-1)) == false then
            if udg_AMHS_InGame then
                if GetLocalPlayer() == Player(counter -1) then
                    call UnitSetUsesAltIcon(u,true)
                endif
            endif
            else
                if GetLocalPlayer() == Player(counter - 1) then
                    call UnitSetUsesAltIcon(u,false)
                endif
            endif
        
        endif
    set counter = counter + 1
endloop
set u = null
endfunction
[/codes]
回复

使用道具 举报

发表于 2007-12-7 22:16:29 | 显示全部楼层
虽然光是“屏蔽”还达不到“检出”的要求,而且需要时刻对选取单位操作,不过目前的确算是最好的了。至少我以前没想过这两个函数的用法。。
回复

使用道具 举报

发表于 2007-12-8 19:07:29 | 显示全部楼层
至于那个 “replay engine” 谁来分析下~ 似乎是用来分辨是否在录像状态?? 反正我看得一脸茫然。。
[codes=jass]//-> IsInGame created by PandaMine with help from Captain Griffein
//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

function AMHS_GetSyncedCameraX takes player p returns real
local real output = 99999999
if GetLocalPlayer() == p then
set output = GetCameraTargetPositionX()
endif
return output
endfunction

function AMHS_GetSyncedCameraY takes player p returns real
local real output = 99999999
if GetLocalPlayer() == p then
set output = GetCameraTargetPositionY()
endif
return output
endfunction

function AMHS_IsInGame takes nothing returns boolean
local integer counter = 1
local real currentx
local real currenty
local real x
local real y
local integer validplayer
set udg_AMHS_InGameOutPut = false

//Need to find the a valid player

    loop
        exitwhen counter > 12
        if GetPlayerSlotState(Player(counter - 1)) == PLAYER_SLOT_STATE_PLAYING and (GetPlayerController(Player(counter - 1)) == MAP_CONTROL_USER) then
            set validplayer = counter - 1
            set counter = 13
        endif
        set counter = counter + 1
    endloop
   
set currentx = AMHS_GetSyncedCameraX(Player(validplayer))
set currenty = AMHS_GetSyncedCameraY(Player(validplayer))

call PauseGame(true)
call TriggerSleepAction(0)

if currentx != 99999999 and currenty != 99999999 then
call SetCameraPositionForPlayer(Player(validplayer),currentx+1,currenty + 1)
endif

call TriggerSleepAction(0)
call PauseGame(false)

set x = AMHS_GetSyncedCameraX(Player(validplayer))
if GetLocalPlayer() == Player(validplayer) then
if x == currentx + 1 then
set udg_AMHS_InGameOutPut = true
else
set udg_AMHS_InGameOutPut = false
endif
endif
if x != 99999999 then
call SetCameraPositionForPlayer(Player(validplayer),currentx,currenty)
endif
set counter = 0
set x = 0
set y = 0
set currentx = 0
set currenty = 0
set validplayer = 0
return udg_AMHS_InGameOutPut
endfunction

function AMHS_ReplayEngine takes nothing returns nothing
local gamecache cache
call FlushGameCache(InitGameCache("cache"))
set cache = InitGameCache("cache")
call EnableUserControl(false)
call TriggerSleepAction(.0)
// sync the value for all players
call StoreBoolean(cache,"sync","1",AMHS_IsInGame())
call TriggerSyncStart()
call SyncStoredBoolean(cache,"sync","1")
call TriggerSyncReady()
set udg_AMHS_InGame = GetStoredBoolean(cache,"sync","1")
call EnableUserControl(true)
call FlushGameCache(cache)
set cache = null
endfunction
[/codes]

流程大约如下:
1.找到一个存在的玩家。
2.在暂停游戏的情况下轻微调整一下这个玩家的镜头(当然,过程中玩家的操作ui是要锁住的)
3.如果镜头变化和预设的一致,则认为在游戏中,否则在录像中。原理应该是暂停游戏对录像是空白的瞬间,比如暂停游戏后聊天,在录像里表现出来的是那些聊天记录是瞬间一起出来的。
4.以上的数据用的是本地玩家,故需要同步,使用syn函数。不是说syn是将主机数据同步么。。何解?如果选择的是所有存在的玩家,不用同步也是可以的吧。
回复

使用道具 举报

 楼主| 发表于 2007-12-9 22:59:28 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2007-12-9 23:20:37 | 显示全部楼层
WC3C。。。英文啊英文。。。
回复

使用道具 举报

发表于 2008-2-24 16:45:37 | 显示全部楼层
这么好用的系统,谁能整理下方便移植啊
回复

使用道具 举报

发表于 2008-2-27 12:48:15 | 显示全部楼层
这个东西有个镜头不同步的问题.直接废掉..小地图也不照,如果单位很多的话会爆卡...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-10-3 09:16 , Processed in 0.285305 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表