Exemplo n.º 1
0
    private void OnReceiveInput(PlayerMessage.InputUpdate message)
    {
        var input = message.Input;

        input.Timestamp = _fixedClock.CurrentTime;

        _simulation.SetInput(input);
        _inputHistory.Enqueue(input);
    }
Exemplo n.º 2
0
    private void OnInputReceived(PlayerMessage.InputUpdate message)
    {
        _simulation.SetInput(message.Input);

        // Route the input to other players
        var peerMessage = _inputMessages.Create();

        peerMessage.Content.Input = message.Input;
        _messageSender.Send(peerMessage, ObjectRole.Others);
    }