You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would suppose that if creation fails then result or res.data() will be set to false.
I've checked the implementation and we can see that CreateService, res is always set to true.
boolUserCommandsPrivate::CreateService(const msgs::EntityFactory &_req,
msgs::Boolean &_res)
{
// Create command and push it to queueauto msg = _req.New();
msg->CopyFrom(_req);
auto cmd = std::make_unique<CreateCommand>(msg, this->iface);
// Push to pending
{
std::lock_guard<std::mutex> lock(this->pendingMutex);
this->pendingCmds.push_back(std::move(cmd));
}
_res.set_data(true);
returntrue;
}
I've also checked the place where the command is executed and we can see that we never use the result of metod call.
voidUserCommands::PreUpdate(const UpdateInfo &/*_info*/,
EntityComponentManager &)
{
GZ_PROFILE("UserCommands::PreUpdate");
// make a copy the cmds so execution does not block receiving other// incoming cmds
std::vector<std::unique_ptr<UserCommandBase>> cmds;
{
std::lock_guard<std::mutex> lock(this->dataPtr->pendingMutex);
if (this->dataPtr->pendingCmds.empty())
return;
cmds = std::move(this->dataPtr->pendingCmds);
this->dataPtr->pendingCmds.clear();
}
// TODO(louise) Record current world state for undo// Execute pending commandsfor (auto &cmd : cmds)
{
// Executeif (!cmd->Execute())
continue;
// TODO(louise) Update command with current world state// TODO(louise) Move to undo list
}
// TODO(louise) Clear redo list
}
|'ve seen that:
/// \brief Callback for create service/// \param[in] _req Request containing entity description./// \param[out] _res True if message successfully received and queued./// It does not mean that the entity will be successfully spawned./// \return True if successful.
I understand that res will be always true when message is successfully received and queued but what about the result parm in the request method call?
It would be great to have real result of request call (I see it could be hard to implement), at least we could work on docs to be more verbose on what is really happening.
The text was updated successfully, but these errors were encountered:
Desired behavior
Considering following example
I would suppose that if creation fails then result or res.data() will be set to false.
I've checked the implementation and we can see that CreateService, res is always set to true.
I've also checked the place where the command is executed and we can see that we never use the result of metod call.
|'ve seen that:
I understand that res will be always true when message is successfully received and queued but what about the result parm in the request method call?
It would be great to have real result of request call (I see it could be hard to implement), at least we could work on docs to be more verbose on what is really happening.
The text was updated successfully, but these errors were encountered: