private void RetrieveCommandsFromServer()
{
if (CommandsToSynchronize.Count > 0)
{
Command command = CommandsToSynchronize.Dequeue();
ushort commandId = _incomingMessage.ReadUInt16();
if (Commands.ContainsKey(commandId))
{
Commands[commandId] = command;
}
else
{
command.Id = commandId;
Commands.Add(command.Id, command);
}
}
}