Command not being received by the server

Options
Hello,

I am just getting started with Bolt and really love how easy it looks to sync the variables. I've mostly worked with unet and it is going to be a breath of fresh air not having to deal with SyncVars and custom serialization just to move a character.

With that said, I am having an issue related to commands not being received by the server. To get started, I've created a new state to sync the transform:

image

And now I'd like to send input from the client to the server so I created a new command:

image

I didn't create a result yet because my goal is to first get this working. Within code on the character object I am sending the input through the InputCommand:

public override void SimulateController()
{
var input = InputCommand.Create();
input.HorizontalMovement = m_HorizontalMovement;
input.ForwardMovement = m_ForwardMovement;
input.LookRotation = m_LookRotation;
entity.QueueInput(input);
}
And I receive it with ExecuteCommand (including some output):

public override void ExecuteCommand(Bolt.Command command, bool resetState)
{
var inputCmd = (InputCommand)command;
m_Handler.HorizontalMovement = inputCmd.Input.HorizontalMovement;
m_Handler.ForwardMovement = inputCmd.Input.ForwardMovement;
m_Handler.LookRotation = inputCmd.Input.LookRotation;
Debug.Log("Received " + inputCmd.Input.ForwardMovement);
}
When I play the game on the server instance only the server input is outputted which makes me believe the server never received the client's command. Did I setup something incorrectly? Or is there a switch that I need to flip?

Thank you!

Comments

  • stanchion
    Options
    I'm not following what you mean by this
    "When I play the game on the server instance only the server input is outputted which makes me believe the server never received the client's command."

    Are you assigning control of the entity to the client?
  • mattm
    mattm
    edited April 2017
    Options
    If you mean you are running the Server in the debugger and expect to see two outputs, the client and the servers, this is incorrect. The Server will only ever execute a single command once. This command is populated on the client and put in a queue. The client will then execute the last command on the queue. In addition, the command will be sent to the server. The server will then execute the same command. This is how you maintain synchronicity between the client and the server. The server will only execute a single command once, so you will only get one "Received" output in your debug for each command.