-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverstart.cpp
More file actions
57 lines (45 loc) · 1.35 KB
/
serverstart.cpp
File metadata and controls
57 lines (45 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "serverstart.h"
#include "ui_serverstart.h"
#include "qthread.h"
#include "qdebug.h"
#include "qprocess.h"
ServerStart::ServerStart(QWidget *parent) :
QDialog(parent),
ui(new Ui::ServerStart)
{
ui->setupUi(this);
}
ServerStart::~ServerStart()
{
delete ui;
}
QProcess *proc;
QProcess *proc2;
QProcess *proc3;
void ServerStart::on_pushButton_clicked()
{
QString login = QString("%1/%2").arg(root_path).arg("login-server.exe");
QString chars = QString("%1/%2").arg(root_path).arg("char-server.exe");
QString map = QString("%1/%2").arg(root_path).arg("map-server.exe");
proc = new QProcess(this);
proc2 = new QProcess(this);
proc3 = new QProcess(this);
connect(proc,SIGNAL(readyReadStandardOutput()),this,SLOT(processOutputLogin()));
connect(proc2,SIGNAL(readyReadStandardOutput()),this,SLOT(processOutputChars()));
connect(proc3,SIGNAL(readyReadStandardOutput()),this,SLOT(processOutputMap()));
proc->start(login);
proc2->start(chars);
proc3->start(map);
}
void ServerStart::processOutputLogin()
{
ui->plainTextEdit->appendPlainText(proc->readAllStandardOutput());
}
void ServerStart::processOutputChars()
{
ui->plainTextEdit_2->appendPlainText(proc2->readAllStandardOutput());
}
void ServerStart::processOutputMap()
{
ui->plainTextEdit_3->appendPlainText(proc3->readAllStandardOutput());
}