示例#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);
}
示例#2
0
void FPSDialog::on_buttonBox_accepted()
{
    float fps = ui->fpsDoubleSpinBox->value();

    vrs_send_fps(this->session_id, VRS_DEFAULT_PRIORITY, fps);

    this->client->setFPS(fps);
}