• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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.
Back
Top