QTfrontend/net/hwmapoptimizer.cpp
author Wuzzy <Wuzzy2@mail.ru>
Tue, 30 Oct 2018 23:51:01 +0100
changeset 14059 1ac129df8e5b
parent 10256 b07288b729c4
child 14620 b86e6e4f3c58
permissions -rw-r--r--
Attacking same clan (not same team) is no longer enough to trigger sndSameTeam Also fixes bug that if you attack a clan member not in your team, the attacker complains, not the victim!

#include "hwmapoptimizer.h"
#include "hwconsts.h"

HWMapOptimizer::HWMapOptimizer(QObject *parent) :
    TCPBase(parent)
{
}

bool HWMapOptimizer::couldBeRemoved()
{
    return !m_hasStarted;
}

void HWMapOptimizer::optimizeMap(const Paths &paths)
{
    m_paths = paths;

    Start(true);
}

QStringList HWMapOptimizer::getArguments()
{
    QStringList arguments;
    arguments << "--internal";
    arguments << "--port";
    arguments << QString("%1").arg(ipc_port);
    arguments << "--user-prefix";
    arguments << cfgdir->absolutePath();
    arguments << "--prefix";
    arguments << datadir->absolutePath();
    arguments << "--landpreview";
    return arguments;
}

void HWMapOptimizer::onClientDisconnect()
{

}

void HWMapOptimizer::SendToClientFirst()
{
    SendIPC("e$mapgen 4");

    /*QByteArray data = m_drawMapData;
    while(data.size() > 0)
    {
        QByteArray tmp = data;
        tmp.truncate(200);
        SendIPC("edraw " + tmp);
        data.remove(0, 200);
    }

    SendIPC("!");*/
}