コード例 #1
0
/** No descriptions */
void EavesDropRegistry::checkMessage(Message &msg) {
  mutex.lock();
  //check local eaves droppers for the from address
  sendLocalMessage(msg.getfrom(), msg);
  //check local eaves droppers for the to address
  sendLocalMessage(msg.getto(), msg);
  //check global eaves droppers
  sendGlobalMessage(msg);

  mutex.unlock();
}
コード例 #2
0
void PlayerControlled::update(const Cistron::Message& msg)
{
	if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
		sendLocalMessage("Actor.Jump");
	if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
		sendLocalMessage("Actor.Right");
	if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
		sendLocalMessage("Actor.Left");
	if((!sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) && (!sf::Keyboard::isKeyPressed(sf::Keyboard::Left)))
	{
		sendLocalMessage("Get.LinearVelocity");
		sendLocalMessage("Set.LinearVelocity", Vec2(vel.x * 0.90f, vel.y));
	}
}