public IEnumerator SetupMatch() { while (NetworkMatchSetup.HasAllMatchSetupInfo() == false) { //Spin until we have all the match setup info that we need to start the match yield return(null); } while (NetworkMatchSender.Get() == null) { //Spin until the needed networking objects have been spawned and given a chance to initialize // - in particular, the NetworkMatchSender needs to be ready in case we need to immediately send inputs // as part of initializing the match (like for loading a log file) yield return(null); } Debug.Log("Starting match initializations since we have enough information"); ContRandomization.Get().InitGenerator(NetworkMatchSetup.GetRandomizationSeed()); Debug.Log("Finished initializing the randomizer"); InitPlayers(nPlayers); Debug.Log("Finished initializing players"); //Initialize characters InitAllChrs(); Debug.Log("After InitAllChrs"); //Assign local input controllers for each player AssignAllLocalInputControllers(); Debug.Log("After assigning local input controllers"); ContManaDistributer.Get().InitializeRandomReserves(); Debug.Log("After initializing mana reserves"); InitAllChrPositions(); Debug.Log("After initializing positions"); //ContPositions.Get().PrintAllPositions(); ContTurns.Get().InitializePriorities(); Debug.Log("After InitializePriorities"); //Check if the LogManager wants to load in any starting inputs LogManager.Get().LoadStartingInputs(); Debug.Log("After LoadStartingInputs"); LogManager.Get().InitMatchLog(); Debug.Log("Finished initializing the log file"); }
public void LogRandomizationSeed() { WriteToMatchLogFile(string.Format("rs:{0}", NetworkMatchSetup.GetRandomizationSeed().ToString())); }