mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-09 07:00:27 +00:00
Minor Squad Refactor (#740)
* disassembled SquadService's receive cases into separate methods * making certain the correct sender reaches the correct functions * regex * getting rid of warnings
This commit is contained in:
parent
0124167b7a
commit
430c5d8890
3 changed files with 1581 additions and 1358 deletions
|
|
@ -521,6 +521,10 @@ class MiddlewareActor(
|
|||
case packet: PlanetSideCryptoPacket =>
|
||||
log.error(s"Unexpected crypto packet '$packet'")
|
||||
Behaviors.same
|
||||
|
||||
case packet =>
|
||||
log.error(s"Unexpected type of packet '$packet'")
|
||||
Behaviors.same
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,8 @@ object PacketCoding {
|
|||
packet.encode match {
|
||||
case Successful(payload) =>
|
||||
packet match {
|
||||
case _: PlanetSideCryptoPacket => Successful(payload)
|
||||
case _: PlanetSideCryptoPacket =>
|
||||
Successful(payload)
|
||||
case packet: PlanetSideControlPacket =>
|
||||
ControlPacketOpcode.codec.encode(packet.opcode) match {
|
||||
case Successful(opcode) => Successful(hex"00".bits ++ opcode ++ payload)
|
||||
|
|
@ -117,6 +118,8 @@ object PacketCoding {
|
|||
case Successful(opcode) => Successful(opcode ++ payload)
|
||||
case f @ Failure(_) => f
|
||||
}
|
||||
case _ =>
|
||||
Failure(Err("packet not supported"))
|
||||
}
|
||||
case f @ Failure(_) => f
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue