diff --git a/common/src/main/scala/net/psforever/packet/game/ChatMsg.scala b/common/src/main/scala/net/psforever/packet/game/ChatMsg.scala index 5bb4c9771..62f9e9ba7 100644 --- a/common/src/main/scala/net/psforever/packet/game/ChatMsg.scala +++ b/common/src/main/scala/net/psforever/packet/game/ChatMsg.scala @@ -2,86 +2,10 @@ package net.psforever.packet.game import net.psforever.packet.{GamePacketOpcode, Marshallable, PacketHelpers, PlanetSideGamePacket} +import net.psforever.types.ChatMessageType import scodec.Codec import scodec.codecs._ -// ChatMessageTypes were reversed by: - // Checking the type in the packet upon receipt by server while using slash commands - // Replaying the ChatMsg packet back to the sender after modifying the messagetype value - -// Some other unchecked commands, if they actually exist as message types: -// Reply (/r), BattleGroup (/bg), ReplyCSR (/gmreply) - -object ChatMessageType extends Enumeration { - type Type = Value - val Unk0, // ??? Appears in top chat pane - Unk1, // ??? Appears in top chat pane - Unk2, // ??? Appears in top chat pane - Broadcast, // /b - Command, // /c - Global, // /comall - SituationReport, // /sitrep - SanctuaryAll, // /comsan - OrbitalStationAll, // No slash command??? - SupaiAll, // /comsu - HunhauAll, // /comhu - AdlivunAll, // /comad - ByblosAll, // /comby - AnnwnAll, // /coman - DrugaskanAll, // /comdr - SolsarAll, // /comso - HossinAll, // /comho - CyssorAll, // /comcy - IshundarAll, // /comis - ForseralAll, // /comfo - CeryshenAll, // /comce - EsamirAll, // /comes - OshurAll, // /comos - OshurPrimeAll, // /compr - SearhusAll, // /comse - AmerishAll, // /comam - Local, // /l - Outfit, // /o - Platoon, // /p - SquadLeaders, // /pl - Squad, // /s - SquadCommand, // /sl - Tell, // /t - BlackOps, // No slash command??? - CSRBroadcast, // /gmbroadcast - CSRBroadcastNC, // /ncbroadcast - CSRBroadcastTR, // /trbroadcast - CSRBroadcastVS, // /vsbroadcast - CSRWorldBroadcast, // /worldbroadcast || /wb - CSR, // /gmlocal - CSRTell, // /gmtell (actually causes normal /tell 0x20 when not a gm???) - Note, // /note - CSRWorldBroadcastPopup, // /gmpopup - CSRTellTo, // Recipient of /gmtell - TellTo, // Recipient of /t - Unk45, // ??? Looks like local? - Unk46, // ??? This actually causes the client to ping back to the server with some stringified numbers "80 120" (with the same 46 chatmsg causing infinite loop?) - may be incorrect decoding - PopupInstantAction, // Sent when Instant Action invoked - PopupRecallSanctuary, // Sent when Recall To Sanctuary invoked - Unk49, // ??? - Unk50, // ??? - Unk51, // ??? - Unk52, // ??? - Unk53, // ??? - Unk54, // ??? - Unk55, // ??? - Unk56, // ??? - Unk57, // ??? - Unk58, // ??? - Unk59, // ??? - Unk60, // ??? - PopupQuit // Sent when Quit invoked - // Could be more types - = Value - - implicit val codec = PacketHelpers.createEnumerationCodec(this, uint8L) -} - final case class ChatMsg(channel : ChatMessageType.Value, unk1 : Boolean, recipient : String, diff --git a/common/src/main/scala/net/psforever/types/ChatMessageType.scala b/common/src/main/scala/net/psforever/types/ChatMessageType.scala new file mode 100644 index 000000000..24f5c174b --- /dev/null +++ b/common/src/main/scala/net/psforever/types/ChatMessageType.scala @@ -0,0 +1,83 @@ +// Copyright (c) 2016 PSForever.net to present +package net.psforever.types + +import net.psforever.packet.PacketHelpers +import scodec.codecs._ + +/** + * ChatMessageTypes were reversed by: + * Checking the type in the packet upon receipt by server while using slash commands + * Replaying the ChatMsg packet back to the sender after modifying the messagetype value + * + * Some other unchecked commands, if they actually exist as message types: + * Reply (/r), BattleGroup (/bg), CSRReply (/gmreply) + */ +object ChatMessageType extends Enumeration { + type Type = Value + val Unk0, // ??? Appears in top chat pane + Unk1, // ??? Appears in top chat pane + Unk2, // ??? Appears in top chat pane + Broadcast, // /b + Command, // /c + Global, // /comall + SituationReport, // /sitrep + SanctuaryAll, // /comsan + OrbitalStationAll, // No slash command??? + SupaiAll, // /comsu + HunhauAll, // /comhu + AdlivunAll, // /comad + ByblosAll, // /comby + AnnwnAll, // /coman + DrugaskanAll, // /comdr + SolsarAll, // /comso + HossinAll, // /comho + CyssorAll, // /comcy + IshundarAll, // /comis + ForseralAll, // /comfo + CeryshenAll, // /comce + EsamirAll, // /comes + OshurAll, // /comos + OshurPrimeAll, // /compr + SearhusAll, // /comse + AmerishAll, // /comam + Local, // /l + Outfit, // /o + Platoon, // /p + SquadLeaders, // /pl + Squad, // /s + SquadCommand, // /sl + Tell, // /t + BlackOps, // No slash command??? + CSRBroadcast, // /gmbroadcast + CSRBroadcastNC, // /ncbroadcast + CSRBroadcastTR, // /trbroadcast + CSRBroadcastVS, // /vsbroadcast + CSRWorldBroadcast, // /worldbroadcast || /wb + CSR, // /gmlocal + CSRTell, // /gmtell (actually causes normal /tell 0x20 when not a gm???) + Note, // /note + CSRWorldBroadcastPopup, // /gmpopup + CSRTellTo, // Recipient of /gmtell + TellTo, // Recipient of /t + Unk45, // ??? Looks like local? + Unk46, // ??? This actually causes the client to ping back to the server with some stringified numbers "80 120" (with the same 46 chatmsg causing infinite loop?) - may be incorrect decoding + PopupInstantAction, // Sent when Instant Action invoked + PopupRecallSanctuary, // Sent when Recall To Sanctuary invoked + Unk49, // ??? + Unk50, // ??? + Unk51, // ??? + Unk52, // ??? + Unk53, // ??? + Unk54, // ??? + Unk55, // ??? + Unk56, // ??? + Unk57, // ??? + Unk58, // ??? + Unk59, // ??? + Unk60, // ??? + PopupQuit // Sent when Quit invoked + // Could be more types + = Value + + implicit val codec = PacketHelpers.createEnumerationCodec(this, uint8L) +} diff --git a/pslogin/src/main/scala/WorldSessionActor.scala b/pslogin/src/main/scala/WorldSessionActor.scala index 1e113fe0d..3f45b294a 100644 --- a/pslogin/src/main/scala/WorldSessionActor.scala +++ b/pslogin/src/main/scala/WorldSessionActor.scala @@ -148,7 +148,7 @@ class WorldSessionActor extends Actor with MDCContextAware { case PlayerStateMessageUpstream(_) => case msg @ ChatMsg(messagetype, unk1, recipient, contents) => - log.info("Handling " + msg) + log.info("Chat: " + msg) // TODO: Depending on messagetype, may need to prepend sender's name to contents with proper spacing // TODO: Just replays the packet straight back to sender; actually needs to be routed to recipients!