Пример #1
0
void COSCStatsSender::SetEnabled(bool enabled) {

	bool statusChanged = (enabled != sendingEnabled);
	this->sendingEnabled = enabled;

	if (statusChanged) {
		if (enabled) {
			oscOutputBuffer = new char[OSC_OUTPUT_BUFFER_SIZE];
			oscPacker = new osc::OutboundPacketStream(oscOutputBuffer,
					OSC_OUTPUT_BUFFER_SIZE);
			network = new NetStruct;
			network->outSocket = new boost::asio::ip::udp::socket(netcode::netservice, boost::asio::ip::udp::endpoint(boost::asio::ip::address_v6::any(), 0));
			boost::asio::socket_base::broadcast option(true);
			network->outSocket->set_option(option);
			UpdateDestination();
			LOG("Sending spring Statistics over OSC to: %s:%u",
					dstAddress.c_str(), dstPort);

			SendInit();
		} else {
			delete oscPacker;
			oscPacker = NULL;
			delete network->outSocket;
			network->outSocket = NULL;
			delete network->destination;
			network->destination = NULL;
			delete network;
			delete [] oscOutputBuffer;
			oscOutputBuffer = NULL;
		}
	}
}
Пример #2
0
void Camera::Update(float dt)
{
	UpdateDestination(dt);
	UpdateHeroFollow(dt);
}
Пример #3
0
void COSCStatsSender::SetDestinationPort(unsigned int port) {
	this->dstPort = port;
	UpdateDestination();
}
Пример #4
0
void COSCStatsSender::SetDestinationAddress(const std::string& address) {
	this->dstAddress = address;
	UpdateDestination();
}