Jump to content

[2.11] setSlaveplayer() crash


photo

Recommended Posts

Hello,

The following code crashes on setSlavePlayer().

This callback is called on the SLAVE_CONNECTED event on the syncker master:

void AppSystemLogic::on_slave_connected(int num)
{
	Log::warning("\nSlave connected #%d\n\n", num); // for 1st slave, num is 0
	PlayerPtr player = checked_ptr_cast<Player>(World::getNodeByName("PlayerDummy"));
	if (!player)
		return;
	Log::warning("Setting player to '%s'\n", player->getName()); // ok
	_master->setSlavePlayer(1<<num, player); // crash
}

image.png.11e0ab59c39d19ac7e4bd7863c51840c.png

(the player is placed in the world)

I also tried to use the sync_view of the slave, but even though the slave is started with "-sync_view test", the call _master->getSlaveView(num, 0)); always returns an empty string.

And using _master->setSlavePlayer("test", player); does nothing on the slave. What am I missing here? (we _don't use a projection config file! and this used to work in 2.10 with sync_slave_name)

Link to comment

Hello Stephane,

20 hours ago, Amerio.Stephane said:

The following code crashes on setSlavePlayer().

There's an error in the documentation. Since 2.11 setSlavePlayer uses slave ID only:

_master->setSlavePlayer(num, player)

This will work.

21 hours ago, Amerio.Stephane said:

I also tried to use the sync_view of the slave, but even though the slave is started with "-sync_view test", the call _master->getSlaveView(num, 0)); always returns an empty string.

This is happening because at this moment we know nothing about the slave channel. In the next update this info will be available. Alternatively, you can connect to SLAVE_SETUP_CHANGED. setSlavePlayer wouldn't work as well until the name is known.

This design can be improved, though. We'll change this in the next update.

Thanks.

 

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
On 6/5/2020 at 2:05 PM, morbid said:

There's an error in the documentation. Since 2.11 setSlavePlayer uses slave ID only:


_master->setSlavePlayer(num, player)

Can you me more precise here: does it use the NUMber of the slave (0,1,2,...) or the ID of the slave (ip+port  combination, I guess?). Again, the doc should be very clear about this, as we all tend to use 'id' for many different things.

About SLAVE_SETUP_CHANGED, I couldn't get it called.


int AppSystemLogic::init()
{	
	/*...*/
	if (_manager = Syncker::Manager::get()) {
		_master = _manager->getMaster();
		_slave = _manager->getSlave();
	}

	if (_master) {
		Log::warning("\nMASTER!\n\n");
		_master->addCallback(Syncker::Master::SLAVE_CONNECTED, MakeCallback(this, &AppSystemLogic::on_slave_connected));
		_master->addCallback(Syncker::Master::SLAVE_SETUP_CHANGED, MakeCallback(this, &AppSystemLogic::on_slave_setup_changed));
	}

	return 1;
}

void AppSystemLogic::on_slave_connected(int num)
{
	Log::warning("Slave connected num = %d\n", num); // called OK
}

void AppSystemLogic::on_slave_setup_changed(int num)
{
	Log::warning("Slave view = %s\n", _master->getSlaveView(num, 0)); // NOT called :(
}

Did I miss something else?

Link to comment
2 hours ago, Amerio.Stephane said:

Can you me more precise here: does it use the NUMber of the slave (0,1,2,...) or the ID of the slave (ip+port  combination, I guess?). Again, the doc should be very clear about this, as we all tend to use 'id' for many different things.

It uses NUM (index) of the slave. 

2 hours ago, Amerio.Stephane said:

Did I miss something else?

We used your code in a clean app and everything worked okay. I've sent you a link in the personal message to the test scene. Could you please take a look?

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

So here we found some design issues in IG and Syncker. At the moment it is possible to change player for a channel but it'll be a workaround based on other workarounds. This, more likely, will cause extra bugs in the application.

We fixed this in 2.12 (ETA around 1 month).

Thanks for reporting.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...