- Joined
- Jun 20, 2017
- Messages
- 380
How to make only host able to type some command?!
function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart ()
call SyncStoredInteger ( g, "Map", "Host" )
call TriggerSyncReady ()
set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1)
call FlushGameCache( g )
set g = null
endfunction
Ironically it did not even work well back when it did "work". Players connected to the host via LAN could potentially be detected as the host due to sub millisecond latency.This trick relied on the fact that the host would have the lowest latency out of all players (by virtue of being the host, duh), but this is no longer the case as the game is hosted by Blizzard servers, and another player may have a lower ping than the host.
I mostly agree, but in some sorts of maps it can be useful. For example in roleplay maps where the host usually acts as the dungeon master.Hosting is such an elitist system, everything should be decided by popular vote.