mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-16 00:44:43 +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 =>
|
case packet: PlanetSideCryptoPacket =>
|
||||||
log.error(s"Unexpected crypto packet '$packet'")
|
log.error(s"Unexpected crypto packet '$packet'")
|
||||||
Behaviors.same
|
Behaviors.same
|
||||||
|
|
||||||
|
case packet =>
|
||||||
|
log.error(s"Unexpected type of packet '$packet'")
|
||||||
|
Behaviors.same
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,8 @@ object PacketCoding {
|
||||||
packet.encode match {
|
packet.encode match {
|
||||||
case Successful(payload) =>
|
case Successful(payload) =>
|
||||||
packet match {
|
packet match {
|
||||||
case _: PlanetSideCryptoPacket => Successful(payload)
|
case _: PlanetSideCryptoPacket =>
|
||||||
|
Successful(payload)
|
||||||
case packet: PlanetSideControlPacket =>
|
case packet: PlanetSideControlPacket =>
|
||||||
ControlPacketOpcode.codec.encode(packet.opcode) match {
|
ControlPacketOpcode.codec.encode(packet.opcode) match {
|
||||||
case Successful(opcode) => Successful(hex"00".bits ++ opcode ++ payload)
|
case Successful(opcode) => Successful(hex"00".bits ++ opcode ++ payload)
|
||||||
|
|
@ -117,6 +118,8 @@ object PacketCoding {
|
||||||
case Successful(opcode) => Successful(opcode ++ payload)
|
case Successful(opcode) => Successful(opcode ++ payload)
|
||||||
case f @ Failure(_) => f
|
case f @ Failure(_) => f
|
||||||
}
|
}
|
||||||
|
case _ =>
|
||||||
|
Failure(Err("packet not supported"))
|
||||||
}
|
}
|
||||||
case f @ Failure(_) => f
|
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