Closed jimmydorry closed 8 years ago
Right now sendStage1 is doing PlayerResource:GetSteamAccountID(0)
, in theory this should always be the host but if the playerIDs are actually just the game lobby order (before joining and deciding who has the better PC/Connection), it will require a for loop such as:
local hostID
for playerID = 0, DOTA_MAX_PLAYERS do
if PlayerResource:IsValidPlayerID(playerID) then
local player = PlayerResource:GetPlayer(playerID)
if GameRules:PlayerHasCustomGameHostPrivileges(player) then
hostID = playerID
return
end
end
end
to determine who has the real host privileges and get their steamID that way
Wasn't aware of that function. :+1:
It worked in the past, and did work briefly in reborn, but when valve added the feature to select host based on connection quality and hardware, player 0 wont always be host anymore, as it might have been allocated to other people
Done
It appears to just grab the first slot in the lobby.