Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit c2aa517

Browse files
committed
PacketGuard: Allow various new packets in CS
1 parent 6b3f9aa commit c2aa517

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/map/map.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,14 +606,13 @@ int32 parse(int8* buff, size_t* buffsize, sockaddr_in* from, map_session_data_t*
606606

607607
if (map_config.packetguard_enabled && PacketGuard::IsRateLimitedPacket(PChar, SmallPD_Type))
608608
{
609-
ShowError(CL_RED "Rate-limiting packet: Player: %s - Packet: %03hX\n" CL_RESET, PChar->GetName(), SmallPD_Type);
609+
ShowExploit(CL_RED "[PacketGuard] Rate-limiting packet: Player: %s - Packet: %03hX\n" CL_RESET, PChar->GetName(), SmallPD_Type);
610610
continue; // skip this packet
611611
}
612612

613613
if (map_config.packetguard_enabled && !PacketGuard::PacketIsValidForPlayerState(PChar, SmallPD_Type))
614614
{
615-
// TODO: Log exploit
616-
ShowError(CL_RED "Caught mismatch between player substate and recieved packet: Player: %s - Packet: %03hX\n" CL_RESET, PChar->GetName(), SmallPD_Type);
615+
ShowExploit(CL_RED "[PacketGuard] Caught mismatch between player substate and recieved packet: Player: %s - Packet: %03hX\n" CL_RESET, PChar->GetName(), SmallPD_Type);
617616
// TODO: Plug in optional jailutils usage
618617
continue; // skip this packet
619618
}

src/map/packet_guard.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,28 @@ void Init()
2626

2727
// In Cutscene
2828
allowList[SUBSTATE_IN_CS][0x00A] = true; // Log In To Zone
29+
allowList[SUBSTATE_IN_CS][0x00C] = true; // Event Update (String Update)
30+
allowList[SUBSTATE_IN_CS][0x00D] = true; // Player Leaving Zone(Dezone)
31+
allowList[SUBSTATE_IN_CS][0x00F] = true; // Player Information Request
32+
allowList[SUBSTATE_IN_CS][0x011] = true; // Player Zone Transition Confirmation
2933
allowList[SUBSTATE_IN_CS][0x015] = true; // Player Sync
3034
allowList[SUBSTATE_IN_CS][0x016] = true; // Entity Information Request
3135
allowList[SUBSTATE_IN_CS][0x01A] = true; // Player Action
3236
allowList[SUBSTATE_IN_CS][0x03A] = true; // Sort Inventory
37+
allowList[SUBSTATE_IN_CS][0x053] = true; // LockStyleSet
38+
allowList[SUBSTATE_IN_CS][0x05A] = true; // Map Update (Conquest, Besieged, Campaign)
3339
allowList[SUBSTATE_IN_CS][0x05B] = true; // Event Update (Completion or Update)
3440
allowList[SUBSTATE_IN_CS][0x05C] = true; // Event Update (Update Player Position)
41+
allowList[SUBSTATE_IN_CS][0x061] = true; // Full Char Update
3542
allowList[SUBSTATE_IN_CS][0x0B5] = true; // Chat Message
3643
allowList[SUBSTATE_IN_CS][0x0B6] = true; // Tell Message
44+
allowList[SUBSTATE_IN_CS][0x0DB] = true; // Set Preferred Language
45+
allowList[SUBSTATE_IN_CS][0x0E0] = true; // Set Search Message
3746
allowList[SUBSTATE_IN_CS][0x0F2] = true; // Update Player Zone Boundary
47+
allowList[SUBSTATE_IN_CS][0x112] = true; // Roe Quest Log Request
3848
allowList[SUBSTATE_IN_CS][0x114] = true; // Map Marker Request
49+
allowList[SUBSTATE_IN_CS][0x118] = true; // Not Impl
50+
allowList[SUBSTATE_IN_CS][0x11B] = true; // Not Impl
3951
}
4052

4153
bool PacketIsValidForPlayerState(CCharEntity* PChar, uint16 SmallPD_Type)

0 commit comments

Comments
 (0)