Host can spawn in team 2 + relay component state syncing

This commit is contained in:
juanjp600
2016-10-05 22:03:06 -03:00
parent 6648e6fd97
commit 91539c5b84
4 changed files with 53 additions and 8 deletions
@@ -28,7 +28,7 @@ namespace Barotrauma
}
public override bool AssignTeamIDs(List<Client> clients)
public override bool AssignTeamIDs(List<Client> clients,out int hostTeam)
{
List<Client> randList = new List<Client>(clients);
for (int i = 0; i < randList.Count; i++)
@@ -51,6 +51,18 @@ namespace Barotrauma
randList[i].TeamID = 2;
}
}
if (halfPlayers*2==randList.Count)
{
hostTeam = Rand.Range(1, 2);
}
else if (halfPlayers*2<randList.Count)
{
hostTeam = 1;
}
else
{
hostTeam = 2;
}
return true;
}
+1 -1
View File
@@ -221,7 +221,7 @@ namespace Barotrauma
public virtual void Update(float deltaTime) { }
public virtual bool AssignTeamIDs(List<Networking.Client> clients) { clients.ForEach(client => { client.TeamID = 1; }); return false; }
public virtual bool AssignTeamIDs(List<Networking.Client> clients,out int hostTeam) { clients.ForEach(client => { client.TeamID = 1; }); hostTeam = 1; return false; }
public void ShowMessage(int index)
{