void OnMyFrameAcknowledged(int frameIndex, int peerId) { // my peer has acknowledged the frame, so my // input is ready to be processed // make sure to set all frames prior to this one acknowledged too SimulationClock.SetReadyForFrame(frameIndex, MyPeerId, allPrior: true); }
// protected int m_greatestFrameFromNetwork = -1; void OnReceivedFrameFromNetwork(int frameIndex, int peerId) { var simulationFrame = Network.GetSimulationFrame(frameIndex); Simulation.SetOrExtendFrame(frameIndex, simulationFrame); // I have received data from the peer SimulationClock.SetReadyForFrame(frameIndex, peerId); }