10256
|
1 |
#include "hwmapoptimizer.h"
|
|
2 |
#include "hwconsts.h"
|
|
3 |
|
|
4 |
HWMapOptimizer::HWMapOptimizer(QObject *parent) :
|
|
5 |
TCPBase(parent)
|
|
6 |
{
|
|
7 |
}
|
|
8 |
|
|
9 |
bool HWMapOptimizer::couldBeRemoved()
|
|
10 |
{
|
|
11 |
return !m_hasStarted;
|
|
12 |
}
|
|
13 |
|
|
14 |
void HWMapOptimizer::optimizeMap(const Paths &paths)
|
|
15 |
{
|
|
16 |
m_paths = paths;
|
|
17 |
|
|
18 |
Start(true);
|
|
19 |
}
|
|
20 |
|
|
21 |
QStringList HWMapOptimizer::getArguments()
|
|
22 |
{
|
|
23 |
QStringList arguments;
|
|
24 |
arguments << "--internal";
|
|
25 |
arguments << "--port";
|
|
26 |
arguments << QString("%1").arg(ipc_port);
|
|
27 |
arguments << "--user-prefix";
|
|
28 |
arguments << cfgdir->absolutePath();
|
|
29 |
arguments << "--prefix";
|
|
30 |
arguments << datadir->absolutePath();
|
|
31 |
arguments << "--landpreview";
|
|
32 |
return arguments;
|
|
33 |
}
|
|
34 |
|
|
35 |
void HWMapOptimizer::onClientDisconnect()
|
|
36 |
{
|
|
37 |
|
|
38 |
}
|
|
39 |
|
|
40 |
void HWMapOptimizer::SendToClientFirst()
|
|
41 |
{
|
|
42 |
SendIPC("e$mapgen 4");
|
|
43 |
|
|
44 |
/*QByteArray data = m_drawMapData;
|
|
45 |
while(data.size() > 0)
|
|
46 |
{
|
|
47 |
QByteArray tmp = data;
|
|
48 |
tmp.truncate(200);
|
|
49 |
SendIPC("edraw " + tmp);
|
|
50 |
data.remove(0, 200);
|
|
51 |
}
|
|
52 |
|
|
53 |
SendIPC("!");*/
|
|
54 |
}
|