Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Feb 25, 2024
1 parent c0c7f05 commit 7dfd6c2
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 112 deletions.
29 changes: 26 additions & 3 deletions CGAssistant/accountform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ AccountForm::AccountForm(QWidget *parent) :
m_game_pid = 0;
m_game_tid = 0;
m_serverid = 0;

ui->label_loginDuration->setText(tr("Login Duration:\n%1 s").arg( ui->horizontalSlider_loginDuration->value() ));
}

AccountForm::~AccountForm()
Expand Down Expand Up @@ -228,7 +230,10 @@ void AccountForm::OnAutoLogin()
}
else
{
on_pushButton_logingame_clicked();
if(m_logingame.elapsed() > ui->horizontalSlider_loginDuration->value() * 1000)
{
on_pushButton_logingame_clicked();
}
return;
}
}
Expand Down Expand Up @@ -332,7 +337,10 @@ void AccountForm::OnPOLCNFinish(int exitCode, QProcess::ExitStatus exitStatus)

if(ui->checkBox_autoLogin->isChecked())
{
on_pushButton_logingame_clicked();
if(m_logingame.elapsed() > ui->horizontalSlider_loginDuration->value() * 1000)
{
on_pushButton_logingame_clicked();
}
}
}
else
Expand Down Expand Up @@ -508,6 +516,9 @@ void AccountForm::on_pushButton_logingame_clicked()
ui->comboBox_bigserver->currentData().toInt(),
ui->comboBox_server->currentData().toInt(),
ui->comboBox_character->currentData().toInt());


m_logingame = QTime::currentTime();
}
}

Expand Down Expand Up @@ -539,7 +550,7 @@ void AccountForm::OnNotifyConnectionState(int state, QString msg)

void AccountForm::OnNotifyFillAutoLogin(int game, QString user, QString pwd, QString gid,
int bigserver, int server, int character,
bool autologin, bool skipupdate, bool autochangeserver,bool autokillgame,
bool autologin, bool skipupdate, bool autochangeserver,bool autokillgame,int loginduration,
bool create_chara, int create_chara_chara, int create_chara_eye, int create_chara_mou, int create_chara_color,
QString create_chara_points, QString create_chara_elements, QString create_chara_name)
{
Expand Down Expand Up @@ -580,6 +591,12 @@ void AccountForm::OnNotifyFillAutoLogin(int game, QString user, QString pwd, QSt
if(autokillgame)
ui->checkBox_autoKillGame->setChecked(true);

if(loginduration >= 0 && loginduration <= 120)
{
ui->horizontalSlider_loginDuration->setValue(loginduration);
on_horizontalSlider_loginDuration_valueChanged(loginduration)
}

if(create_chara)
{
ui->checkBox_createChara->setChecked(true);
Expand Down Expand Up @@ -794,3 +811,9 @@ void AccountForm::on_checkBox_createChara_stateChanged(int arg1)
ui->lineEdit_CharaElements->setEnabled(false);
}
}

void AccountForm::on_horizontalSlider_loginDuration_valueChanged(int value)
{
ui->label_loginDuration->setText(tr("Login Duration:\n%1 s").arg( value ));
}

5 changes: 4 additions & 1 deletion CGAssistant/accountform.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ private slots:
void on_pushButton_logingame_clicked();
void on_checkBox_createChara_stateChanged(int arg1);

void on_horizontalSlider_loginDuration_valueChanged(int value);

public slots:
void OnNotifyFillAutoLogin(int game, QString user, QString pwd, QString gid,
int bigserver, int server, int character,
bool autologin, bool skipupdate, bool autochangeserver,bool autokillgame,
bool autologin, bool skipupdate, bool autochangeserver,bool autokillgame,int loginduration,
bool create_chara, int create_chara_chara, int create_chara_eye, int create_chara_mou, int create_chara_color,
QString create_chara_points, QString create_chara_elements, QString create_chara_name);
void OnHttpLoadAccount(QString query, QByteArray postdata, QJsonDocument* doc);
Expand All @@ -53,6 +55,7 @@ public slots:
QString m_glt;
QTime m_loginquery;
QTime m_loginresult;
QTime m_logingame;
HANDLE m_polcn_lock;
HANDLE m_polcn_map;
HANDLE m_glt_lock;
Expand Down
Loading

0 comments on commit 7dfd6c2

Please sign in to comment.