Ejemplo n.º 1
0
/**
 * \brief Callback function for receiving accept connect request.
 *
 * \param[in]	session_id	ID of session with the Verse server, because Verse
 * client could be connected to more Verse server.
 * \param[in]	user_id		unique ID of user.
 * \param[in]	avatar_id	unique ID of avatar.
 */
static void cb_receive_connect_accept(const uint8_t session_id,
      const uint16_t user_id,
      const uint32_t avatar_id)
{
	printf("%s() session_id: %d, user_id: %d, avatar_id: %d\n",
			__FUNCTION__, session_id, user_id, avatar_id);

	my_avatar_id = avatar_id;
	my_user_id = user_id;

	/* When client receive connect accept, then it is ready to subscribe
	 * to the root node of the node tree. Id of root node is still 0. This
	 * function is called with level 1. It means, that this client will be
	 * subscribed to the root node and its child nodes (1, 2, 3) */
	vrs_send_node_subscribe(session_id, VRS_DEFAULT_PRIORITY, 0, 0, 0);

	/* Check if server allow double subscribe? */
	vrs_send_node_subscribe(session_id, VRS_DEFAULT_PRIORITY, 1, 0, 0);

	/* Try to create new node */
	vrs_send_node_create(session_id, VRS_DEFAULT_PRIORITY, MY_TEST_NODE_CT);

	/* Change FPS value */
	vrs_send_fps(session_id, VRS_DEFAULT_PRIORITY+1, FPS);
}
static void cb_receive_connect_accept(const uint8 session_id,
      const uint16 user_id,
      const uint32 avatar_id)
{
#if NO_DEBUG_PRINT != 1
	printf("%s() session_id: %d, user_id: %d, avatar_id: %d\n",
			__FUNCTION__, session_id, user_id, avatar_id);
#endif

	ctx->verse.avatar_id = avatar_id;
	ctx->verse.user_id = user_id;

	/* Subscribe to avatar node */
	vrs_send_node_subscribe(session_id, VRS_DEFAULT_PRIORITY, avatar_id, 0, 0);

	/* TODO: Create new particle scene node only when there is no other particle scene node */
	vrs_send_node_create(session_id, VRS_DEFAULT_PRIORITY, PARTICLE_SCENE_NODE);

	/* Create new node (particle sender node) */
	vrs_send_node_create(session_id, VRS_DEFAULT_PRIORITY, PARTICLE_SENDER_NODE);
}
Ejemplo n.º 3
0
void NodeDialog::on_buttonBox_accepted()
{
    uint16_t type = ui->spinBox->value();

    vrs_send_node_create(this->session_id, VRS_DEFAULT_PRIORITY, type);
}