本文整理汇总了C++中atlas::objects::operation::RootOperation::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ RootOperation::isValid方法的具体用法?C++ RootOperation::isValid怎么用?C++ RootOperation::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atlas::objects::operation::RootOperation
的用法示例。
在下文中一共展示了RootOperation::isValid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
Atlas::Objects::Operation::Info op;
OpVector res;
p->operation(op, res);
}
{
Peer *p = new Peer(*(CommSocket*)0, *(ServerRouting*)0, "addr", 6767, "1", 1);
Atlas::Objects::Operation::Error op;
OpVector res;
p->operation(op, res);
}
// Not authenticated
{
Peer *p = new Peer(*(CommSocket*)0, *(ServerRouting*)0, "addr", 6767, "1", 1);
Entity e("3", 3);
int ret = p->teleportEntity(&e);
assert(ret == -1);
}
// Authenticated
{
TestCommClient client(server, "");
Peer *p = new Peer(client, *(ServerRouting*)0, "addr", 6767, "1", 1);
p->setAuthState(PEER_AUTHENTICATED);
Entity e("3", 3);
int ret = p->teleportEntity(&e);
assert(ret == 0);
assert(stub_CommClient_sent_op.isValid());
assert(stub_CommClient_sent_op->getArgs().size() == 1);
}
// Re-teleport same entity
{
TestCommClient client(server, "");
Peer *p = new Peer(client, *(ServerRouting*)0, "addr", 6767, "1", 1);
p->setAuthState(PEER_AUTHENTICATED);
Entity e("3", 3);
int ret = p->teleportEntity(&e);
assert(ret == 0);
assert(stub_CommClient_sent_op.isValid());
assert(stub_CommClient_sent_op->getArgs().size() == 1);
ret = p->teleportEntity(&e);
assert(ret != 0);
}
// Character (no mind)
{
TestCommClient client(server, "");
Peer *p = new Peer(client, *(ServerRouting*)0, "addr", 6767, "1", 1);
p->setAuthState(PEER_AUTHENTICATED);
Character e("3", 3);
int ret = p->teleportEntity(&e);
assert(ret == 0);
assert(stub_CommClient_sent_op.isValid());
assert(stub_CommClient_sent_op->getArgs().size() == 1);