mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
fixup: Addressed comments
This commit is contained in:
parent
aa45ea8e84
commit
8411af17d3
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
@ -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!
|
||||
|
|
|
|||
Loading…
Reference in a new issue