void AddAFriendDialog::on_buttonBox_accepted() { // call ClientCommand's method to add a friend QByteArray receiverByteArray = ui->receivername_lineedit->text().toUtf8(); const char* receiver = receiverByteArray.constData(); char message[] = "friend_request\0"; // call client command to send a message int retVal = ClientCommandManager::clientCommand->SendCommand(receiver, (std::string)message); if (retVal == -1) { // char message[] = "SendCommand error\0"; changeMessage( "SendCommand error\0"); } if (retVal == 0) { // char message[] = "message sent!\0"; changeMessage("message sent!\0"); } }
void StatusRootAction::setStatusMessage( const Kopete::StatusMessage &statusMessage ) { if ( d->account ) { // Set status for this account only d->account->setOnlineStatus( d->account->myself()->onlineStatus(), statusMessage, Kopete::Account::KeepSpecialFlags ); } else { // Set global status emit changeMessage( statusMessage ); } }
int movePlayer( int *current, int check, struct monster* collideWith, int direction ) { int k = direction * 1; collideWith = checkCollision( playerX, *current + k); if ( collideWith == NULL ) { collideWith = checkCollision(*current + k, playerY ); } if( ( check == TRUE ) && collideWith == NULL ) { *current = *current + k; } else if ( collideWith != NULL ) { hurtMonster( collideWith, commanderAttack ); } else { changeMessage( "Bumped into a wall. Ouch!" ); } return 0; }