Log packet contents when no decoder is found

This commit is contained in:
Jakob Gillich 2021-04-17 02:12:26 +02:00
parent 92a0b1dfaa
commit f2953890be
2 changed files with 242 additions and 242 deletions

View file

@ -28,7 +28,7 @@ object ControlPacketOpcode extends Enumeration {
Unknown26, Unknown27, Unknown28, ConnectionClose, Unknown30 = Value Unknown26, Unknown27, Unknown28, ConnectionClose, Unknown30 = Value
private def noDecoder(opcode: ControlPacketOpcode.Type) = private def noDecoder(opcode: ControlPacketOpcode.Type) =
(_: BitVector) => Attempt.failure(Err(s"Could not find a marshaller for control packet $opcode")) (bits: BitVector) => Attempt.failure(Err(s"Could not find a marshaller for control packet $opcode (${bits.toHex})"))
def getPacketDecoder( def getPacketDecoder(
opcode: ControlPacketOpcode.Type opcode: ControlPacketOpcode.Type

View file

@ -18,284 +18,284 @@ object GamePacketOpcode extends Enumeration {
type Type = Value type Type = Value
val val
// OPCODES 0x00-0f // OPCODES 0x00-0f
Unknown0, // PPT_NULL in beta client Unknown0, // PPT_NULL in beta client
LoginMessage, LoginMessage, //
LoginRespMessage, LoginRespMessage, //
ConnectToWorldRequestMessage, // found by searching for 83 F8 03 89 in IDA ConnectToWorldRequestMessage, // found by searching for 83 F8 03 89 in IDA
ConnectToWorldMessage, ConnectToWorldMessage, //
VNLWorldStatusMessage, VNLWorldStatusMessage, //
UnknownMessage6, // PPT_TRANSFERTOWORLDREQUEST UnknownMessage6, // PPT_TRANSFERTOWORLDREQUEST
UnknownMessage7, // PPT_TRANSFERTOWORLDRESPONSE UnknownMessage7, // PPT_TRANSFERTOWORLDRESPONSE
// 0x08 // 0x08
PlayerStateMessage, PlayerStateMessage, //
HitMessage, HitMessage, //
HitHint, HitHint, //
DamageMessage, DamageMessage, //
DestroyMessage, DestroyMessage, //
ReloadMessage, ReloadMessage, //
MountVehicleMsg, MountVehicleMsg, //
DismountVehicleMsg, DismountVehicleMsg, //
// OPCODES 0x10-1f // OPCODES 0x10-1f
UseItemMessage, UseItemMessage, //
MoveItemMessage, MoveItemMessage, //
ChatMsg, ChatMsg, //
CharacterNoRecordMessage, CharacterNoRecordMessage, //
CharacterInfoMessage, CharacterInfoMessage, //
UnknownMessage21, // PPT_DISCONNECT UnknownMessage21, // PPT_DISCONNECT
BindPlayerMessage, BindPlayerMessage, //
ObjectCreateMessage_Duplicate, // PPT_OBJECTCREATE ObjectCreateMessage_Duplicate, // PPT_OBJECTCREATE
// 0x18 // 0x18
ObjectCreateMessage, // PPT_OBJECTCREATEDETAILED ObjectCreateMessage, // PPT_OBJECTCREATEDETAILED
ObjectDeleteMessage, ObjectDeleteMessage, //
PingMsg, PingMsg, //
VehicleStateMessage, VehicleStateMessage, //
FrameVehicleStateMessage, FrameVehicleStateMessage, //
GenericObjectStateMsg, GenericObjectStateMsg, //
ChildObjectStateMessage, ChildObjectStateMessage, //
ActionResultMessage, ActionResultMessage, //
// OPCODES 0x20-2f // OPCODES 0x20-2f
UnknownMessage32, // PPT_ACTIONBEGIN UnknownMessage32, // PPT_ACTIONBEGIN
ActionProgressMessage, ActionProgressMessage, //
ActionCancelMessage, ActionCancelMessage, //
ActionCancelAcknowledgeMessage, ActionCancelAcknowledgeMessage, //
SetEmpireMessage, SetEmpireMessage, //
EmoteMsg, EmoteMsg, //
UnuseItemMessage, UnuseItemMessage, //
ObjectDetachMessage, ObjectDetachMessage, //
// 0x28 // 0x28
CreateShortcutMessage, CreateShortcutMessage, //
ChangeShortcutBankMessage, ChangeShortcutBankMessage, //
ObjectAttachMessage, ObjectAttachMessage, //
UnknownMessage43, // PPT_OBJECTEMPTY UnknownMessage43, // PPT_OBJECTEMPTY
PlanetsideAttributeMessage, PlanetsideAttributeMessage, //
RequestDestroyMessage, RequestDestroyMessage, //
UnknownMessage46, // PPT_EQUIPITEM UnknownMessage46, // PPT_EQUIPITEM
CharacterCreateRequestMessage, CharacterCreateRequestMessage, //
// OPCODES 0x30-3f // OPCODES 0x30-3f
CharacterRequestMessage, CharacterRequestMessage, //
LoadMapMessage, LoadMapMessage, //
SetCurrentAvatarMessage, SetCurrentAvatarMessage, //
ObjectHeldMessage, ObjectHeldMessage, //
WeaponFireMessage, WeaponFireMessage, //
AvatarJumpMessage, AvatarJumpMessage, //
PickupItemMessage, PickupItemMessage, //
DropItemMessage, DropItemMessage, //
// 0x38 // 0x38
InventoryStateMessage, InventoryStateMessage, //
ChangeFireStateMessage_Start, ChangeFireStateMessage_Start, //
ChangeFireStateMessage_Stop, ChangeFireStateMessage_Stop, //
UnknownMessage59, UnknownMessage59, //
GenericCollisionMsg, GenericCollisionMsg, //
QuantityUpdateMessage, QuantityUpdateMessage, //
ArmorChangedMessage, ArmorChangedMessage, //
ProjectileStateMessage, ProjectileStateMessage, //
// OPCODES 0x40-4f // OPCODES 0x40-4f
MountVehicleCargoMsg, MountVehicleCargoMsg, //
DismountVehicleCargoMsg, DismountVehicleCargoMsg, //
CargoMountPointStatusMessage, CargoMountPointStatusMessage, //
BeginZoningMessage, BeginZoningMessage, //
ItemTransactionMessage, ItemTransactionMessage, //
ItemTransactionResultMessage, ItemTransactionResultMessage, //
ChangeFireModeMessage, ChangeFireModeMessage, //
ChangeAmmoMessage, ChangeAmmoMessage, //
// 0x48 // 0x48
TimeOfDayMessage, TimeOfDayMessage, //
UnknownMessage73, // PPT_PROJECTILE_EVENT_BLOCK UnknownMessage73, // PPT_PROJECTILE_EVENT_BLOCK
SpawnRequestMessage, SpawnRequestMessage, //
DeployRequestMessage, DeployRequestMessage, //
UnknownMessage76, // PPT_BUILDINGSTATECHANGED UnknownMessage76, // PPT_BUILDINGSTATECHANGED
RepairMessage, RepairMessage, //
ServerVehicleOverrideMsg, ServerVehicleOverrideMsg, //
LashMessage, LashMessage,
// OPCODES 0x50-5f // OPCODES 0x50-5f
TargetingInfoMessage, TargetingInfoMessage, //
TriggerEffectMessage, TriggerEffectMessage, //
WeaponDryFireMessage, WeaponDryFireMessage, //
DroppodLaunchRequestMessage, DroppodLaunchRequestMessage, //
HackMessage, HackMessage, //
DroppodLaunchResponseMessage, DroppodLaunchResponseMessage, //
GenericObjectActionMessage, GenericObjectActionMessage, //
AvatarVehicleTimerMessage, AvatarVehicleTimerMessage, //
// 0x58 // 0x58
AvatarImplantMessage, AvatarImplantMessage, //
UnknownMessage89, // PPT_SEARCHMESSAGE UnknownMessage89, // PPT_SEARCHMESSAGE
DelayedPathMountMsg, DelayedPathMountMsg, //
OrbitalShuttleTimeMsg, OrbitalShuttleTimeMsg, //
AIDamage, AIDamage, //
DeployObjectMessage, DeployObjectMessage, //
FavoritesRequest, FavoritesRequest, //
FavoritesResponse, FavoritesResponse, //
// OPCODES 0x60-6f // OPCODES 0x60-6f
FavoritesMessage, FavoritesMessage, //
ObjectDetectedMessage, ObjectDetectedMessage, //
SplashHitMessage, SplashHitMessage, //
SetChatFilterMessage, SetChatFilterMessage, //
AvatarSearchCriteriaMessage, AvatarSearchCriteriaMessage, //
AvatarSearchResponse, AvatarSearchResponse, //
WeaponJammedMessage, WeaponJammedMessage, //
LinkDeadAwarenessMsg, LinkDeadAwarenessMsg, //
// 0x68 // 0x68
DroppodFreefallingMessage, DroppodFreefallingMessage, //
AvatarFirstTimeEventMessage, AvatarFirstTimeEventMessage, //
AggravatedDamageMessage, AggravatedDamageMessage, //
TriggerSoundMessage, TriggerSoundMessage, //
LootItemMessage, LootItemMessage, //
VehicleSubStateMessage, VehicleSubStateMessage, //
SquadMembershipRequest, SquadMembershipRequest, //
SquadMembershipResponse, SquadMembershipResponse, //
// OPCODES 0x70-7f // OPCODES 0x70-7f
SquadMemberEvent, SquadMemberEvent, //
PlatoonEvent, PlatoonEvent, //
FriendsRequest, FriendsRequest, //
FriendsResponse, FriendsResponse, //
TriggerEnvironmentalDamageMessage, TriggerEnvironmentalDamageMessage, //
TrainingZoneMessage, TrainingZoneMessage, //
DeployableObjectsInfoMessage, DeployableObjectsInfoMessage, //
SquadState, SquadState,
// 0x78 // 0x78
OxygenStateMessage, OxygenStateMessage, //
TradeMessage, TradeMessage, //
UnknownMessage122, UnknownMessage122, //
DamageFeedbackMessage, DamageFeedbackMessage, //
DismountBuildingMsg, DismountBuildingMsg, //
UnknownMessage125, // PPT_MOUNTBUILDING UnknownMessage125, // PPT_MOUNTBUILDING
UnknownMessage126, // PPT_INTENDEDDROPZONE UnknownMessage126, // PPT_INTENDEDDROPZONE
AvatarStatisticsMessage, AvatarStatisticsMessage, //
// OPCODES 0x80-8f // OPCODES 0x80-8f
GenericObjectAction2Message, GenericObjectAction2Message, //
DestroyDisplayMessage, DestroyDisplayMessage, //
TriggerBotAction, TriggerBotAction, //
SquadWaypointRequest, SquadWaypointRequest, //
SquadWaypointEvent, SquadWaypointEvent, //
OffshoreVehicleMessage, OffshoreVehicleMessage, //
ObjectDeployedMessage, ObjectDeployedMessage, //
ObjectDeployedCountMessage, ObjectDeployedCountMessage, //
// 0x88 // 0x88
WeaponDelayFireMessage, WeaponDelayFireMessage, //
BugReportMessage, BugReportMessage, //
PlayerStasisMessage, PlayerStasisMessage, //
UnknownMessage139, UnknownMessage139, //
OutfitMembershipRequest, OutfitMembershipRequest, //
OutfitMembershipResponse, OutfitMembershipResponse, //
OutfitRequest, OutfitRequest, //
OutfitEvent, OutfitEvent, //
// OPCODES 0x90-9f // OPCODES 0x90-9f
OutfitMemberEvent, OutfitMemberEvent, //
OutfitMemberUpdate, OutfitMemberUpdate, //
PlanetsideStringAttributeMessage, PlanetsideStringAttributeMessage, //
DataChallengeMessage, DataChallengeMessage, //
DataChallengeMessageResp, DataChallengeMessageResp, //
WeatherMessage, WeatherMessage, //
SimDataChallenge, SimDataChallenge, //
SimDataChallengeResp, SimDataChallengeResp, //
// 0x98 // 0x98
OutfitListEvent, OutfitListEvent, //
EmpireIncentivesMessage, EmpireIncentivesMessage, //
InvalidTerrainMessage, InvalidTerrainMessage, //
SyncMessage, SyncMessage, //
DebugDrawMessage, DebugDrawMessage, //
SoulMarkMessage, SoulMarkMessage, //
UplinkPositionEvent, UplinkPositionEvent, //
HotSpotUpdateMessage, HotSpotUpdateMessage, //
// OPCODES 0xa0-af // OPCODES 0xa0-af
BuildingInfoUpdateMessage, BuildingInfoUpdateMessage, //
FireHintMessage, FireHintMessage, //
UplinkRequest, UplinkRequest, //
UplinkResponse, UplinkResponse, //
WarpgateRequest, WarpgateRequest, //
WarpgateResponse, WarpgateResponse, //
DamageWithPositionMessage, DamageWithPositionMessage, //
GenericActionMessage, GenericActionMessage, //
// 0xa8 // 0xa8
ContinentalLockUpdateMessage, ContinentalLockUpdateMessage, //
AvatarGrenadeStateMessage, AvatarGrenadeStateMessage, //
UnknownMessage170, UnknownMessage170, //
UnknownMessage171, UnknownMessage171, //
ReleaseAvatarRequestMessage, ReleaseAvatarRequestMessage, //
AvatarDeadStateMessage, AvatarDeadStateMessage, //
CSAssistMessage, CSAssistMessage, //
CSAssistCommentMessage, CSAssistCommentMessage, //
// OPCODES 0xb0-bf // OPCODES 0xb0-bf
VoiceHostRequest, VoiceHostRequest, //
VoiceHostKill, VoiceHostKill, //
VoiceHostInfo, VoiceHostInfo, //
BattleplanMessage, BattleplanMessage, //
BattleExperienceMessage, BattleExperienceMessage, //
TargetingImplantRequest, TargetingImplantRequest, //
ZonePopulationUpdateMessage, ZonePopulationUpdateMessage, //
DisconnectMessage, DisconnectMessage, //
// 0xb8 // 0xb8
ExperienceAddedMessage, ExperienceAddedMessage, //
OrbitalStrikeWaypointMessage, OrbitalStrikeWaypointMessage, //
KeepAliveMessage, KeepAliveMessage, //
MapObjectStateBlockMessage, MapObjectStateBlockMessage, //
SnoopMsg, SnoopMsg, //
PlayerStateMessageUpstream, PlayerStateMessageUpstream, //
PlayerStateShiftMessage, PlayerStateShiftMessage, //
ZipLineMessage, ZipLineMessage, //
// OPCODES 0xc0-cf // OPCODES 0xc0-cf
CaptureFlagUpdateMessage, CaptureFlagUpdateMessage, //
VanuModuleUpdateMessage, VanuModuleUpdateMessage, //
FacilityBenefitShieldChargeRequestMessage, FacilityBenefitShieldChargeRequestMessage, //
ProximityTerminalUseMessage, ProximityTerminalUseMessage, //
QuantityDeltaUpdateMessage, QuantityDeltaUpdateMessage, //
ChainLashMessage, ChainLashMessage, //
ZoneInfoMessage, ZoneInfoMessage, //
LongRangeProjectileInfoMessage, LongRangeProjectileInfoMessage, //
// 0xc8 // 0xc8
WeaponLazeTargetPositionMessage, WeaponLazeTargetPositionMessage, //
ModuleLimitsMessage, ModuleLimitsMessage, //
OutfitBenefitMessage, OutfitBenefitMessage, //
EmpireChangeTimeMessage, EmpireChangeTimeMessage, //
ClockCalibrationMessage, ClockCalibrationMessage, //
DensityLevelUpdateMessage, DensityLevelUpdateMessage, //
ActOfGodMessage, ActOfGodMessage, //
AvatarAwardMessage, AvatarAwardMessage, //
// OPCODES 0xd0-df // OPCODES 0xd0-df
UnknownMessage208, UnknownMessage208, //
DisplayedAwardMessage, DisplayedAwardMessage, //
RespawnAMSInfoMessage, RespawnAMSInfoMessage, //
ComponentDamageMessage, ComponentDamageMessage, //
GenericObjectActionAtPositionMessage, GenericObjectActionAtPositionMessage, //
PropertyOverrideMessage, PropertyOverrideMessage, //
WarpgateLinkOverrideMessage, WarpgateLinkOverrideMessage, //
EmpireBenefitsMessage, EmpireBenefitsMessage, //
// 0xd8 // 0xd8
ForceEmpireMessage, ForceEmpireMessage, //
BroadcastWarpgateUpdateMessage, BroadcastWarpgateUpdateMessage, //
UnknownMessage218, UnknownMessage218, //
SquadMainTerminalMessage, SquadMainTerminalMessage, //
SquadMainTerminalResponseMessage, SquadMainTerminalResponseMessage, //
SquadOrderMessage, SquadOrderMessage, //
SquadOrderResponse, SquadOrderResponse, //
ZoneLockInfoMessage, ZoneLockInfoMessage, //
// OPCODES 0xe0-ef // OPCODES 0xe0-ef
SquadBindInfoMessage, SquadBindInfoMessage, //
AudioSequenceMessage, AudioSequenceMessage, //
SquadFacilityBindInfoMessage, SquadFacilityBindInfoMessage, //
ZoneForcedCavernConnectionsMessage, ZoneForcedCavernConnectionsMessage, //
MissionActionMessage, MissionActionMessage, //
MissionKillTriggerMessage, MissionKillTriggerMessage, //
ReplicationStreamMessage, ReplicationStreamMessage, //
SquadDefinitionActionMessage, SquadDefinitionActionMessage, //
// 0xe8 // 0xe8
SquadDetailDefinitionUpdateMessage, SquadDetailDefinitionUpdateMessage, //
TacticsMessage, TacticsMessage, //
RabbitUpdateMessage, RabbitUpdateMessage, //
SquadInvitationRequestMessage, SquadInvitationRequestMessage, //
CharacterKnowledgeMessage, CharacterKnowledgeMessage, //
GameScoreUpdateMessage, GameScoreUpdateMessage, //
UnknownMessage238, UnknownMessage238, //
OrderTerminalBugMessage, OrderTerminalBugMessage, //
// OPCODES 0xf0-f3 // OPCODES 0xf0-f3
QueueTimedHelpMessage, QueueTimedHelpMessage, //
MailMessage, MailMessage, //
GameVarUpdate, GameVarUpdate, //
ClientCheatedMessage // last known message type (243, 0xf3) ClientCheatedMessage // last known message type (243, 0xf3)
= Value = Value
private def noDecoder(opcode: GamePacketOpcode.Type) = private def noDecoder(opcode: GamePacketOpcode.Type) =
(_: BitVector) => Attempt.failure(Err(s"Could not find a marshaller for game packet $opcode")) (bits: BitVector) => Attempt.failure(Err(s"Could not find a marshaller for game packet $opcode (${bits.toHex}"))
/// Mapping of packet IDs to decoders. Notice that we are using the @switch annotation which ensures that the Scala /// Mapping of packet IDs to decoders. Notice that we are using the @switch annotation which ensures that the Scala
/// compiler will be able to optimize this as a lookup table (switch statement). Microbenchmarks show a nearly 400x /// compiler will be able to optimize this as a lookup table (switch statement). Microbenchmarks show a nearly 400x