• 🏆 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!

Host Detection

Status
Not open for further replies.
Level 4
Joined
Nov 1, 2006
Messages
54
Hi, im trying to improve my host detection method right now, this is what ive got so far:


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

Its working fine right now yes, but sometimes, more than less, it messes up and chooses another player who is not really the host to choose the game modes, anyway to fix this/refine this host detection process? (I'll add that I run this right at map initilization) Thanks, also, im wondering if there is a way to prevent the game from choosing two hosts when the real "host" of the game is in an observer/referee spot and it chooses the "real" host of the game and another player actually playing as the host as well, then both players (the real host observing, and the player who is not the actual host) get to pick the game modes and it causes chaos. Is there a way to make it so the real "host" in the observer/referee spot would be the only one picking the modes? Thanks again.
 
Status
Not open for further replies.
Top