mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-13 15:34:42 +00:00
Rename and correct packet Unknown30 to ClientHotStart (#1217)
This packet contains the client and server nonce needed to restart a connection using old crypto data.
This commit is contained in:
parent
d1dbbcb08f
commit
8738a42ca0
4 changed files with 24 additions and 21 deletions
|
|
@ -308,9 +308,9 @@ class MiddlewareActor(
|
||||||
send(ServerStart(nonce, serverNonce), None, None)
|
send(ServerStart(nonce, serverNonce), None, None)
|
||||||
cryptoSetup()
|
cryptoSetup()
|
||||||
|
|
||||||
case (Unknown30(_), _) =>
|
case (ClientHotStart(_, _), _) =>
|
||||||
/*
|
/*
|
||||||
Unknown30 is used to reuse an existing crypto session when switching from login to world
|
ClientHotStart is used to reuse an existing crypto session when switching from login to world
|
||||||
When not handling it, it appears that the client will fall back to using ClientStart
|
When not handling it, it appears that the client will fall back to using ClientStart
|
||||||
Do we need to implement this?
|
Do we need to implement this?
|
||||||
*/
|
*/
|
||||||
|
|
@ -586,9 +586,9 @@ class MiddlewareActor(
|
||||||
case ClientStart(_) =>
|
case ClientStart(_) =>
|
||||||
start()
|
start()
|
||||||
|
|
||||||
case Unknown30(_) =>
|
case ClientHotStart(_, _) =>
|
||||||
/*
|
/*
|
||||||
Unknown30 is used to reuse an existing crypto session when switching from login to world
|
ClientHotStart is used to reuse an existing crypto session when switching from login to world
|
||||||
When not handling it, it appears that the client will fall back to using ClientStart
|
When not handling it, it appears that the client will fall back to using ClientStart
|
||||||
Do we need to implement this?
|
Do we need to implement this?
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ object ControlPacketOpcode extends Enumeration {
|
||||||
Unknown27, //
|
Unknown27, //
|
||||||
Unknown28, //
|
Unknown28, //
|
||||||
ConnectionClose, //
|
ConnectionClose, //
|
||||||
Unknown30 // Probably a more lightweight variant of ClientStart, containing only the client nonce
|
ClientHotStart // Probably a more lightweight variant of ClientStart, containing only the client nonce
|
||||||
= Value
|
= Value
|
||||||
|
|
||||||
private def noDecoder(opcode: ControlPacketOpcode.Type) =
|
private def noDecoder(opcode: ControlPacketOpcode.Type) =
|
||||||
|
|
@ -90,7 +90,7 @@ object ControlPacketOpcode extends Enumeration {
|
||||||
case 0x1b => noDecoder(Unknown27)
|
case 0x1b => noDecoder(Unknown27)
|
||||||
case 0x1c => noDecoder(Unknown28)
|
case 0x1c => noDecoder(Unknown28)
|
||||||
case 0x1d => control.ConnectionClose.decode
|
case 0x1d => control.ConnectionClose.decode
|
||||||
case 0x1e => control.Unknown30.decode
|
case 0x1e => control.ClientHotStart.decode
|
||||||
case _ => noDecoder(opcode)
|
case _ => noDecoder(opcode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package net.psforever.packet.control
|
||||||
|
|
||||||
|
import net.psforever.packet.{ControlPacketOpcode, Marshallable, PlanetSideControlPacket}
|
||||||
|
import scodec.Codec
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
final case class ClientHotStart(clientNonce: Long, ServerNonce: Long) extends PlanetSideControlPacket {
|
||||||
|
type Packet = ClientHotStart
|
||||||
|
def opcode = ControlPacketOpcode.ClientHotStart
|
||||||
|
def encode = ClientHotStart.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object ClientHotStart extends Marshallable[ClientHotStart] {
|
||||||
|
implicit val codec: Codec[ClientHotStart] = (
|
||||||
|
("client_nonce" | uint32L) ::
|
||||||
|
("server_nonce" | uint32L)
|
||||||
|
).as[ClientHotStart]
|
||||||
|
}
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
package net.psforever.packet.control
|
|
||||||
|
|
||||||
import net.psforever.packet.{ControlPacketOpcode, Marshallable, PlanetSideControlPacket}
|
|
||||||
import scodec.Codec
|
|
||||||
import scodec.codecs._
|
|
||||||
|
|
||||||
final case class Unknown30(clientNonce: Long) extends PlanetSideControlPacket {
|
|
||||||
type Packet = Unknown30
|
|
||||||
def opcode = ControlPacketOpcode.Unknown30
|
|
||||||
def encode = Unknown30.encode(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
object Unknown30 extends Marshallable[Unknown30] {
|
|
||||||
implicit val codec: Codec[Unknown30] = ("client_nonce" | uint32L).as[Unknown30]
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue