Ejemplo n.º 1
0
MapInfoObject::MapInfoObject(ZCom_Control *_control, unsigned int zoidlevel, const MapInfo & minfo)
{
	#ifndef _ZOID_USED_NEW_VERSION_
		m_node->registerNodeDynamic(m_classid, _control);
	#else
		_control->ZCom_registerDynamicNode( m_node, m_classid );
	#endif

	#ifdef _DEBUG
		LogHandler::getInstance()->LogToFile("New Node " + GetObjectName() + " of name " + minfo.Name);
	#endif


	// only do that on authority
	if(m_node->getRole() == eZCom_RoleAuthority)
	{
		// add announcement data
		ZCom_BitStream *adata = new ZCom_BitStream();
		adata->addString(minfo.Name.c_str());
		adata->addString(minfo.Type.c_str());
		adata->addString(minfo.Music.c_str());
		adata->addSignedInt(minfo.MusicLoop, 16);
		m_node->setAnnounceData(adata);


		// change zoidlevel
		m_node->applyForZoidLevel( zoidlevel );
		//m_node->removeFromZoidLevel( 1 );
	}


}
Ejemplo n.º 2
0
void Client::requestPlayer(PlayerOptions const& playerOptions)
{
	ZCom_BitStream *req = new ZCom_BitStream;
	req->addInt(Network::PLAYER_REQUEST,8);
	req->addString( playerOptions.name.c_str() );
	req->addInt(playerOptions.colour, 24);
	req->addSignedInt(playerOptions.team, 8);
	req->addInt(playerOptions.uniqueID, 32);
	ZCom_sendData( network.getServerID(), req, eZCom_ReliableOrdered );
}