Merge branch 'master' into bad-packet-handler-improvement
This commit is contained in:
commit
1ff7540890
.github/workflows
bin/config_sample/text
core/src/packet
tests/unittest_aopacket
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-default libqt5websockets5-dev g++ make
|
||||
sudo apt-get install qt5-qmake libqt5websockets5-dev g++ make
|
||||
# Runs a set of commands using the runners shell
|
||||
- name: qmake and build
|
||||
run: |
|
||||
@ -73,7 +73,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install qt5-default libqt5websockets5-dev g++ make
|
||||
sudo apt-get install qt5-qmake libqt5websockets5-dev g++ make
|
||||
# Runs a set of commands using the runners shell
|
||||
- name: qmake and build
|
||||
run: |
|
||||
@ -145,8 +145,8 @@ jobs:
|
||||
|
||||
- name: Deploy OpenSSL
|
||||
run: |
|
||||
curl https://mirror.firedaemon.com/OpenSSL/openssl-1.1.1p.zip --output openssl-1.1.1p.zip
|
||||
tar -xf openssl-1.1.1p.zip
|
||||
curl https://mirror.firedaemon.com/OpenSSL/openssl-1.1.1r.zip --output openssl-1.1.1.zip
|
||||
tar -xf openssl-1.1.1.zip
|
||||
copy .\openssl-1.1\x64\bin\libcrypto-1_1-x64.dll .\bin\libcrypto-1_1-x64.dll
|
||||
copy .\openssl-1.1\x64\bin\libssl-1_1-x64.dll .\bin\libssl-1_1-x64.dll
|
||||
|
||||
|
@ -102,16 +102,16 @@
|
||||
},
|
||||
{
|
||||
"names": [
|
||||
"setperm"
|
||||
"setperms"
|
||||
],
|
||||
"usage":"/addperm <Usernames> <Role>",
|
||||
"text":"Sets the role of the user.."
|
||||
"usage":"/setperms <Usernames> <Role>",
|
||||
"text":"Sets the role of the user."
|
||||
},
|
||||
{
|
||||
"names": [
|
||||
"removeperm"
|
||||
"removeperms"
|
||||
],
|
||||
"usage":"/removeperm <Usernames> <Permission>",
|
||||
"usage":"/removeperms <Usernames> <Permission>",
|
||||
"text":"Removes the role from a given user."
|
||||
},
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ PacketInfo PacketCasea::getPacketInfo() const
|
||||
PacketInfo info{
|
||||
.acl_permission = ACLRole::Permission::NONE,
|
||||
.min_args = 6,
|
||||
.header = "Casea"};
|
||||
.header = "CASEA"};
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
||||
l_args.append(l_incoming_args[5].toString());
|
||||
if (client.m_pos != l_incoming_args[5].toString()) {
|
||||
client.m_pos = l_incoming_args[5].toString();
|
||||
client.m_pos.replace("../", "").replace("..\\", "");
|
||||
client.updateEvidenceList(client.getServer()->getAreaById(client.m_current_area));
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ PacketInfo PacketSetcase::getPacketInfo() const
|
||||
PacketInfo info{
|
||||
.acl_permission = ACLRole::Permission::NONE,
|
||||
.min_args = 7,
|
||||
.header = "Setcase"};
|
||||
.header = "SETCASE"};
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,12 @@ class Packet : public QObject
|
||||
* @brief Tests the creation of AOPackets from incoming string formatted packets.
|
||||
*/
|
||||
void createPacketFromString();
|
||||
|
||||
/**
|
||||
* @brief Test packet-specific classes
|
||||
*/
|
||||
void createPacketSubclass_data();
|
||||
void createPacketSubclass();
|
||||
};
|
||||
|
||||
void Packet::init()
|
||||
@ -42,6 +48,88 @@ void Packet::init()
|
||||
AOPacket::registerPackets();
|
||||
}
|
||||
|
||||
void Packet::createPacketSubclass_data()
|
||||
{
|
||||
QTest::addColumn<QString>("incoming_packet");
|
||||
QTest::addColumn<QString>("expected_header");
|
||||
QTest::addColumn<int>("expected_minargs");
|
||||
|
||||
QTest::newRow("askchaa") << "askchaa#"
|
||||
<< "askchaa"
|
||||
<< 0;
|
||||
QTest::newRow("CASEA") << "CASEA#"
|
||||
<< "CASEA"
|
||||
<< 6;
|
||||
QTest::newRow("CC") << "CC#"
|
||||
<< "CC"
|
||||
<< 3;
|
||||
QTest::newRow("CH") << "CH#"
|
||||
<< "CH"
|
||||
<< 1;
|
||||
QTest::newRow("CT") << "CT#"
|
||||
<< "CT"
|
||||
<< 2;
|
||||
QTest::newRow("DE") << "DE#"
|
||||
<< "DE"
|
||||
<< 1;
|
||||
QTest::newRow("EE") << "EE#"
|
||||
<< "EE"
|
||||
<< 4;
|
||||
QTest::newRow("GENERIC") << "GENERIC#"
|
||||
<< "GENERIC"
|
||||
<< 0;
|
||||
QTest::newRow("HI") << "HI#"
|
||||
<< "HI"
|
||||
<< 1;
|
||||
QTest::newRow("HP") << "HP#"
|
||||
<< "HP"
|
||||
<< 2;
|
||||
QTest::newRow("ID") << "ID#"
|
||||
<< "ID"
|
||||
<< 2;
|
||||
QTest::newRow("MC") << "MC#"
|
||||
<< "MC"
|
||||
<< 2;
|
||||
QTest::newRow("MS") << "MS#"
|
||||
<< "MS"
|
||||
<< 15;
|
||||
QTest::newRow("PE") << "PE#"
|
||||
<< "PE"
|
||||
<< 3;
|
||||
QTest::newRow("PW") << "PW#"
|
||||
<< "PW"
|
||||
<< 1;
|
||||
QTest::newRow("RC") << "RC#"
|
||||
<< "RC"
|
||||
<< 0;
|
||||
QTest::newRow("RD") << "RD#"
|
||||
<< "RD"
|
||||
<< 0;
|
||||
QTest::newRow("RM") << "RM#"
|
||||
<< "RM"
|
||||
<< 0;
|
||||
QTest::newRow("RT") << "RT#"
|
||||
<< "RT"
|
||||
<< 1;
|
||||
QTest::newRow("SETCASE") << "SETCASE#"
|
||||
<< "SETCASE"
|
||||
<< 7;
|
||||
QTest::newRow("ZZ") << "ZZ#"
|
||||
<< "ZZ"
|
||||
<< 0;
|
||||
}
|
||||
|
||||
void Packet::createPacketSubclass()
|
||||
{
|
||||
QFETCH(QString, incoming_packet);
|
||||
QFETCH(QString, expected_header);
|
||||
QFETCH(int, expected_minargs);
|
||||
|
||||
AOPacket *packet = PacketFactory::createPacket(incoming_packet);
|
||||
QCOMPARE(packet->getPacketInfo().header, expected_header);
|
||||
QCOMPARE(packet->getPacketInfo().min_args, expected_minargs);
|
||||
}
|
||||
|
||||
void Packet::createPacket()
|
||||
{
|
||||
AOPacket *packet = PacketFactory::createPacket("HI", {"HDID"});
|
||||
|
Loading…
Reference in New Issue
Block a user