Stub out ControlSync to prevent client from leaving

Still have no idea what these packets are actually doing...
This commit is contained in:
Chord 2016-05-14 03:17:51 -04:00
parent 6ea1d157af
commit 11298c1a46
2 changed files with 7 additions and 2 deletions

View file

@ -5,7 +5,7 @@ import net.psforever.packet.{ControlPacketOpcode, Marshallable, PlanetSideContro
import scodec.Codec
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)
extends PlanetSideControlPacket {
type Packet = ControlSyncResp
@ -16,7 +16,7 @@ final case class ControlSyncResp(timeDiff : Int, unk : Long,
object ControlSyncResp extends Marshallable[ControlSyncResp] {
implicit val codec : Codec[ControlSyncResp] = (
("time_diff" | uint16) ::
("unk" | uint32) ::
("server_tick" | uint32) ::
("field1" | int64) ::
("field2" | int64) ::
("field3" | int64) ::

View file

@ -68,6 +68,11 @@ class LoginSessionActor extends Actor with MDCContextAware {
case Successful(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) =>
packets.foreach { pkt =>
PacketCoding.DecodePacket(pkt) match {