Ejemplo n.º 1
0
void QuteMessenger::CreateActions()
{
    discoverDev = new QAction(QString(tr("Discover devices")), this);
    discoverDev->setSoftKeyRole(QAction::SelectSoftKey);
    connect(discoverDev, SIGNAL(triggered()), this, SLOT(startDeviceDiscovery()));

    sendFile = new QAction(QString(tr("Send file")),this);
    sendFile->setSoftKeyRole(QAction::SelectSoftKey);
    connect(sendFile, SIGNAL(triggered()), this, SLOT(sendFileToClient()));

    startChat = new QAction(QString(tr("Start chat")),this);
    startChat->setSoftKeyRole(QAction::SelectSoftKey);
    connect(startChat, SIGNAL(triggered()), this, SLOT(startChatReport()));
}
Ejemplo n.º 2
0
void	Room::addPlayer(Client *client)
{
  if (this->getAllPlayers().size() < 4)
    {
      _clientManager->addClients(client);
      sendPlayerJoin(client);
      sendRoomPlayerJoin(client);
      sendFileToClient(client, this->_botList);
    }
  else
    sendError(client);
  for (std::list<Client *>::const_iterator it = getAllPlayers().begin(); it != getAllPlayers().end(); ++it)
    {
      std::cout << (*it)->getSocket()->getFd() << std::endl;
    }
}
Ejemplo n.º 3
0
Room::Room(const std::string &id, Client *client, std::list<Bot*> botList):_id(id)
{
  _clientManager = new ClientManager();
  _clientManager->addClients(client);
  this->_botList = botList;
  _parameter = new Parameters();
  std::string	sendData = "player1;" + id + ";1";
  ANetwork::t_frame frame = CreateRequest::create(S_JOIN_SUCCESS,
						  CRC::calcCRC(sendData),
						  0, sendData);
  client->getSocket()->write(reinterpret_cast<void *>(&frame),
			     sizeof(ANetwork::t_frame));
   sendFileToClient(client, botList);
   for (std::list<std::string>::iterator it = this->_transfertFinished.begin(); it != this->_transfertFinished.end(); ++it) {
     client->getSocket()->write(CreateRequest::create(S_DOWNLOAD_COMPLETE, 42, 42, *it, true), sizeof(ANetwork::t_frame));
   }
  //_owner = client;
}