mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
Remove extra logging and discord bot test
This commit is contained in:
parent
53488613d6
commit
30a94a0725
|
|
@ -141,7 +141,7 @@ final case class LoginMessage(majorVersion : Long,
|
||||||
object LoginMessage extends Marshallable[LoginMessage] {
|
object LoginMessage extends Marshallable[LoginMessage] {
|
||||||
private def username = PacketHelpers.encodedStringAligned(7)
|
private def username = PacketHelpers.encodedStringAligned(7)
|
||||||
private def password = PacketHelpers.encodedString
|
private def password = PacketHelpers.encodedString
|
||||||
private def tokenPath = fixedSizeBytes(32, ascii) :: username
|
private def tokenPath = fixedSizeBytes(32, bytes) :: username
|
||||||
private def passwordPath = username :: password
|
private def passwordPath = username :: password
|
||||||
|
|
||||||
type Struct = String :: Option[String] :: Option[String] :: HNil
|
type Struct = String :: Option[String] :: Option[String] :: HNil
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
|
||||||
PacketCoding.UnmarshalPacket(msg) match {
|
PacketCoding.UnmarshalPacket(msg) match {
|
||||||
case Failure(e) => log.error("Could not decode packet: " + e)
|
case Failure(e) => log.error("Could not decode packet: " + e)
|
||||||
case Successful(p) =>
|
case Successful(p) =>
|
||||||
println("RECV: " + p)
|
//println("RECV: " + p)
|
||||||
|
|
||||||
p match {
|
p match {
|
||||||
case ControlPacket(_, ClientStart(nonce)) =>
|
case ControlPacket(_, ClientStart(nonce)) =>
|
||||||
|
|
@ -72,7 +72,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
|
||||||
PacketCoding.UnmarshalPacket(msg, CryptoPacketOpcode.ClientChallengeXchg) match {
|
PacketCoding.UnmarshalPacket(msg, CryptoPacketOpcode.ClientChallengeXchg) match {
|
||||||
case Failure(e) => log.error("Could not decode packet: " + e)
|
case Failure(e) => log.error("Could not decode packet: " + e)
|
||||||
case Successful(p) =>
|
case Successful(p) =>
|
||||||
println("RECV: " + p)
|
//println("RECV: " + p)
|
||||||
|
|
||||||
p match {
|
p match {
|
||||||
case CryptoPacket(seq, ClientChallengeXchg(time, challenge, p, g)) =>
|
case CryptoPacket(seq, ClientChallengeXchg(time, challenge, p, g)) =>
|
||||||
|
|
@ -111,7 +111,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
|
||||||
PacketCoding.UnmarshalPacket(msg, CryptoPacketOpcode.ClientFinished) match {
|
PacketCoding.UnmarshalPacket(msg, CryptoPacketOpcode.ClientFinished) match {
|
||||||
case Failure(e) => log.error("Could not decode packet: " + e)
|
case Failure(e) => log.error("Could not decode packet: " + e)
|
||||||
case Successful(p) =>
|
case Successful(p) =>
|
||||||
println("RECV: " + p)
|
//println("RECV: " + p)
|
||||||
|
|
||||||
p match {
|
p match {
|
||||||
case CryptoPacket(seq, ClientFinished(clientPubKey, clientChalResult)) =>
|
case CryptoPacket(seq, ClientFinished(clientPubKey, clientChalResult)) =>
|
||||||
|
|
@ -196,10 +196,10 @@ class CryptoSessionActor extends Actor with ActorLogging {
|
||||||
case Successful(p) =>
|
case Successful(p) =>
|
||||||
p match {
|
p match {
|
||||||
case encPacket @ EncryptedPacket(seq, _) =>
|
case encPacket @ EncryptedPacket(seq, _) =>
|
||||||
println("Decrypting packet..." + encPacket)
|
//println("Decrypting packet..." + encPacket)
|
||||||
PacketCoding.decryptPacket(cryptoState.get, encPacket) match {
|
PacketCoding.decryptPacket(cryptoState.get, encPacket) match {
|
||||||
case Successful(packet) =>
|
case Successful(packet) =>
|
||||||
println("RECV[E]: " + packet)
|
//println("RECV[E]: " + packet)
|
||||||
|
|
||||||
self ! packet
|
self ! packet
|
||||||
case Failure(e) =>
|
case Failure(e) =>
|
||||||
|
|
@ -218,38 +218,11 @@ class CryptoSessionActor extends Actor with ActorLogging {
|
||||||
val from = sender()
|
val from = sender()
|
||||||
|
|
||||||
handleEstablishedPacket(from, game)
|
handleEstablishedPacket(from, game)
|
||||||
/* case SlottedMetaPacket(innerPacket) =>
|
|
||||||
PacketCoding.DecodePacket(innerPacket) match {
|
|
||||||
case Successful(p) =>
|
|
||||||
println("RECV[INNER]: " + p)
|
|
||||||
|
|
||||||
val packet = PacketCoding.encryptPacket(cryptoState.get, PacketCoding.CreateGamePacket(3,
|
|
||||||
LoginRespMessage("AAAABBBBCCCCDDDD",
|
|
||||||
hex"00000000 18FABE0C 00000000 00000000",
|
|
||||||
0, 1, 2, 685276011,
|
|
||||||
"AAAAAAAA", 0, false
|
|
||||||
))).require
|
|
||||||
|
|
||||||
sendResponse(packet)
|
|
||||||
|
|
||||||
val msg = VNLWorldStatusMessage("Welcome to PlanetSide! ",
|
|
||||||
Vector(
|
|
||||||
WorldInformation("PSForever", WorldStatus.Up, ServerType.Development,
|
|
||||||
Vector(WorldConnectionInfo(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 51001))), EmpireNeed.TR)
|
|
||||||
))
|
|
||||||
|
|
||||||
sendResponse(PacketCoding.encryptPacket(cryptoState.get, PacketCoding.CreateGamePacket(4,
|
|
||||||
msg
|
|
||||||
)).require)
|
|
||||||
case Failure(e) => println("Failed to decode inner packet " + e)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
case default => failWithError(s"Invalid message received ${default}")
|
case default => failWithError(s"Invalid message received ${default}")
|
||||||
}
|
}
|
||||||
|
|
||||||
def failWithError(error : String) = {
|
def failWithError(error : String) = {
|
||||||
log.error(error)
|
log.error(error)
|
||||||
sendResponse(PacketCoding.CreateControlPacket(ConnectionClose()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def resetState() : Unit = {
|
def resetState() : Unit = {
|
||||||
|
|
@ -285,7 +258,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
|
||||||
}
|
}
|
||||||
|
|
||||||
def sendResponse(cont : PlanetSidePacketContainer) : ByteVector = {
|
def sendResponse(cont : PlanetSidePacketContainer) : ByteVector = {
|
||||||
println("CRYPTO SEND: " + cont)
|
//println("CRYPTO SEND: " + cont)
|
||||||
val pkt = PacketCoding.MarshalPacket(cont).require
|
val pkt = PacketCoding.MarshalPacket(cont).require
|
||||||
val bytes = pkt.toByteVector
|
val bytes = pkt.toByteVector
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class LoginSessionActor extends Actor with ActorLogging {
|
||||||
}
|
}
|
||||||
|
|
||||||
def sendResponse(cont : PlanetSidePacketContainer) = {
|
def sendResponse(cont : PlanetSidePacketContainer) = {
|
||||||
log.info("LOGIN SEND: " + cont)
|
println("LOGIN SEND: " + cont)
|
||||||
rightRef ! cont
|
rightRef ! cont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ final case class HelloFriend(next: ActorRef)
|
||||||
|
|
||||||
class UdpListener(nextActor: ActorRef) extends Actor with ActorLogging {
|
class UdpListener(nextActor: ActorRef) extends Actor with ActorLogging {
|
||||||
import context.system
|
import context.system
|
||||||
IO(Udp) ! Udp.Bind(self, new InetSocketAddress("0.0.0.0", 51000))
|
IO(Udp) ! Udp.Bind(self, new InetSocketAddress("127.0.0.1", 51000))
|
||||||
|
|
||||||
var bytesRecevied = 0L
|
var bytesRecevied = 0L
|
||||||
var bytesSent = 0L
|
var bytesSent = 0L
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue