mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_UNHANDLED_OPCODE (#2918)
# Notes - Optionally parse this event instead of always doing so.
This commit is contained in:
parent
1bf24273d2
commit
2dffc66c6f
@ -468,10 +468,10 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
|||||||
switch (client_state) {
|
switch (client_state) {
|
||||||
case CLIENT_CONNECTING: {
|
case CLIENT_CONNECTING: {
|
||||||
if (ConnectingOpcodes.count(opcode) != 1) {
|
if (ConnectingOpcodes.count(opcode) != 1) {
|
||||||
//Hate const cast but everything in lua needs to be non-const even if i make it non-mutable
|
if (parse->PlayerHasQuestSub(EVENT_UNHANDLED_OPCODE)) {
|
||||||
std::vector<std::any> args;
|
std::vector<std::any> args = {const_cast<EQApplicationPacket *>(app)};
|
||||||
args.push_back(const_cast<EQApplicationPacket*>(app));
|
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args);
|
||||||
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args);
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -493,9 +493,10 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
|||||||
ClientPacketProc p;
|
ClientPacketProc p;
|
||||||
p = ConnectedOpcodes[opcode];
|
p = ConnectedOpcodes[opcode];
|
||||||
if (p == nullptr) {
|
if (p == nullptr) {
|
||||||
std::vector<std::any> args;
|
if (parse->PlayerHasQuestSub(EVENT_UNHANDLED_OPCODE)) {
|
||||||
args.push_back(const_cast<EQApplicationPacket*>(app));
|
std::vector<std::any> args = {const_cast<EQApplicationPacket *>(app)};
|
||||||
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args);
|
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user