mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-15 08:24:39 +00:00
Stub out ControlSync to prevent client from leaving
Still have no idea what these packets are actually doing...
This commit is contained in:
parent
6ea1d157af
commit
11298c1a46
2 changed files with 7 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import net.psforever.packet.{ControlPacketOpcode, Marshallable, PlanetSideContro
|
||||||
import scodec.Codec
|
import scodec.Codec
|
||||||
import scodec.codecs._
|
import scodec.codecs._
|
||||||
|
|
||||||
final case class ControlSyncResp(timeDiff : Int, unk : Long,
|
final case class ControlSyncResp(timeDiff : Int, serverTick : Long,
|
||||||
field1 : Long, field2 : Long, field3 : Long, field4 : Long)
|
field1 : Long, field2 : Long, field3 : Long, field4 : Long)
|
||||||
extends PlanetSideControlPacket {
|
extends PlanetSideControlPacket {
|
||||||
type Packet = ControlSyncResp
|
type Packet = ControlSyncResp
|
||||||
|
|
@ -16,7 +16,7 @@ final case class ControlSyncResp(timeDiff : Int, unk : Long,
|
||||||
object ControlSyncResp extends Marshallable[ControlSyncResp] {
|
object ControlSyncResp extends Marshallable[ControlSyncResp] {
|
||||||
implicit val codec : Codec[ControlSyncResp] = (
|
implicit val codec : Codec[ControlSyncResp] = (
|
||||||
("time_diff" | uint16) ::
|
("time_diff" | uint16) ::
|
||||||
("unk" | uint32) ::
|
("server_tick" | uint32) ::
|
||||||
("field1" | int64) ::
|
("field1" | int64) ::
|
||||||
("field2" | int64) ::
|
("field2" | int64) ::
|
||||||
("field3" | int64) ::
|
("field3" | int64) ::
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,11 @@ class LoginSessionActor extends Actor with MDCContextAware {
|
||||||
case Successful(v) =>
|
case Successful(v) =>
|
||||||
handlePkt(v)
|
handlePkt(v)
|
||||||
}
|
}
|
||||||
|
case sync @ ControlSync(diff, unk, f1, f2, f3, f4, fa, fb) =>
|
||||||
|
log.debug(s"SYNC: ${sync}")
|
||||||
|
val serverTick = Math.abs(System.nanoTime().toInt) // limit the size to prevent encoding error
|
||||||
|
sendResponse(PacketCoding.CreateControlPacket(ControlSyncResp(diff, serverTick,
|
||||||
|
fa, fb, fb, fa)))
|
||||||
case MultiPacket(packets) =>
|
case MultiPacket(packets) =>
|
||||||
packets.foreach { pkt =>
|
packets.foreach { pkt =>
|
||||||
PacketCoding.DecodePacket(pkt) match {
|
PacketCoding.DecodePacket(pkt) match {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue