// Update is called once per frame // create a copy of the menu that the host has on their instance of the game absed on the host schema // USED public void launchGame() { if (PhotonNetwork.IsMasterClient) { // check each team to make sure that they have selected if (readyPlayers >= selectedPlayers && readyPlayers >= playersInLobby && selectedMap != "null") { GlobalsEntry globals = gamestateTracker.globals; if (timeLimitInputField.text != "") { globals.timeLimit = short.Parse(timeLimitInputField.text); } else { globals.timeLimit = 0; } globals.Commit(); Invoke(nameof(delayedLoad), 0.1f); } else { Debug.Log("Players no ready or no map selected"); } } }
public static void AssertPacketApplied(GlobalsEntry entry, GamestatePacket packet) { if (packet.hasName) { Assert.That(entry.name, Is.EqualTo(packet.name)); } int i = 0; if (packet.hasShortValues[(int)GlobalsEntry.ShortFields.TimeLimit]) { Assert.That(entry.timeLimit, Is.EqualTo(packet.shortValues[i])); i++; } }
void ActivateVehicles() { NetworkPlayerVehicle[] npvs = FindObjectsOfType <NetworkPlayerVehicle>(); foreach (NetworkPlayerVehicle npv in npvs) { npv.GetComponent <PhotonView>().RPC(nameof(NetworkPlayerVehicle.ActivateVehicleInputs), RpcTarget.AllBufferedViaServer); } photonView.RPC(nameof(ActivateArrow_RPC), RpcTarget.All); physXSceneManager.doPhysics = true; GamestateTracker gamestateTracker = FindObjectOfType <GamestateTracker>(); GlobalsEntry globals = gamestateTracker.globals; float time = globals.timeLimit; globals.Release(); timer = FindObjectOfType <TimerBehaviour>(); if (timer != null) { timer.HostStartTimer(time); } }