Beispiel #1
0
clientSetupDialog::clientSetupDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::clientSetupDialog)
{
    ui->setupUi(this);

    ui->lineEditIpAdress->setInputMask("000.000.000.000");

    readSettings();

    qDebug() << "Server Connection: " << ipAdress << port;

    ui->lineEditIpAdress->setText(getIpAdress());
    ui->lineEditPort->setText(QString::number(getPort()));


}
Beispiel #2
0
ftp_t* ftp_init(const char* server, const char* username, const char* password, const char* path_to_file) {

    ftp_t* ftp = malloc(sizeof(ftp_t));
    memset(ftp, 0, sizeof(ftp_t));
    char server_address[IP_MAX_SIZE];

    if(getIpAdress(server, server_address) < 0) {
        printf("Error while resolving address %s\n", server);
        return NULL;
    }

    strcpy(ftp->server_address, server_address);
    strcpy(ftp->username, username);
    strcpy(ftp->password, password);
    strcpy(ftp->path_to_file, path_to_file);

    return ftp;
}
Beispiel #3
0
/** Sets the loaded values to the given server configuration
  *
  * The given ServerConfiguration pointer \b must be valid.
  *
  * \param sc The ServerConfiguration structure pointer
  *
  * \return \c true if the operation successed
  *
  */
bool RainbruRPG::Server::xmlServerConf::load(ServerConfiguration* sc){
  LOGI("Getting saved server configuration :");

  LOGCATS("  name : '");
  LOGCATS( getServerName() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  desc : '");
  LOGCATS( getServerDesc() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  technote : '");
  LOGCATS( getTechNote() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Playmode : '");
  LOGCATB( getPlayMode() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Editmode : '");
  LOGCATB( getEditMode() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Floodmode : '");
  LOGCATB( getFloodMode() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Port : '");
  LOGCATI( getPort() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  MaxClient : '");
  LOGCATI( getMaxClient() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Type : '");
  LOGCATI( getType());
  LOGCATS("'");
  LOGCAT();

  // Database debug
  LOGCATS("  dbHostName : '");
  LOGCATS( getDbHostName().c_str() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  DbName : '");
  LOGCATS( getDbName().c_str() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS(" DbUserName  : '******'");
  LOGCAT();

  LOGCATS(" DbUserPwd  : '");
  LOGCATS( getDbUserPwd().c_str() );
  LOGCATS("'");
  LOGCAT();

  sc->setName(getServerName());
  sc->setDesc(getServerDesc());
  sc->setType(getType());
  sc->setTechNote(getTechNote());
  sc->setPlayMode(getPlayMode());
  sc->setEditMode(getEditMode());
  sc->setFloodMode(getFloodMode());
  sc->setPort(getPort());
  sc->setFtpPort(getFtpPort());
  sc->setMaxClient(getMaxClient());
  sc->setIpAdress(getIpAdress());
  //database values
  sc->setHostName(getDbHostName().c_str());
  sc->setDatabaseName(getDbName().c_str());
  sc->setUserName(getDbUserName().c_str());
  sc->setPassword(getDbUserPwd().c_str());
}