Remove extra logging and discord bot test

This commit is contained in:
Chord 2016-04-24 20:36:36 -04:00
parent 53488613d6
commit 30a94a0725
4 changed files with 9 additions and 36 deletions

View file

@ -141,7 +141,7 @@ final case class LoginMessage(majorVersion : Long,
object LoginMessage extends Marshallable[LoginMessage] {
private def username = PacketHelpers.encodedStringAligned(7)
private def password = PacketHelpers.encodedString
private def tokenPath = fixedSizeBytes(32, ascii) :: username
private def tokenPath = fixedSizeBytes(32, bytes) :: username
private def passwordPath = username :: password
type Struct = String :: Option[String] :: Option[String] :: HNil

View file

@ -53,7 +53,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
PacketCoding.UnmarshalPacket(msg) match {
case Failure(e) => log.error("Could not decode packet: " + e)
case Successful(p) =>
println("RECV: " + p)
//println("RECV: " + p)
p match {
case ControlPacket(_, ClientStart(nonce)) =>
@ -72,7 +72,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
PacketCoding.UnmarshalPacket(msg, CryptoPacketOpcode.ClientChallengeXchg) match {
case Failure(e) => log.error("Could not decode packet: " + e)
case Successful(p) =>
println("RECV: " + p)
//println("RECV: " + p)
p match {
case CryptoPacket(seq, ClientChallengeXchg(time, challenge, p, g)) =>
@ -111,7 +111,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
PacketCoding.UnmarshalPacket(msg, CryptoPacketOpcode.ClientFinished) match {
case Failure(e) => log.error("Could not decode packet: " + e)
case Successful(p) =>
println("RECV: " + p)
//println("RECV: " + p)
p match {
case CryptoPacket(seq, ClientFinished(clientPubKey, clientChalResult)) =>
@ -196,10 +196,10 @@ class CryptoSessionActor extends Actor with ActorLogging {
case Successful(p) =>
p match {
case encPacket @ EncryptedPacket(seq, _) =>
println("Decrypting packet..." + encPacket)
//println("Decrypting packet..." + encPacket)
PacketCoding.decryptPacket(cryptoState.get, encPacket) match {
case Successful(packet) =>
println("RECV[E]: " + packet)
//println("RECV[E]: " + packet)
self ! packet
case Failure(e) =>
@ -218,38 +218,11 @@ class CryptoSessionActor extends Actor with ActorLogging {
val from = sender()
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}")
}
def failWithError(error : String) = {
log.error(error)
sendResponse(PacketCoding.CreateControlPacket(ConnectionClose()))
}
def resetState() : Unit = {
@ -285,7 +258,7 @@ class CryptoSessionActor extends Actor with ActorLogging {
}
def sendResponse(cont : PlanetSidePacketContainer) : ByteVector = {
println("CRYPTO SEND: " + cont)
//println("CRYPTO SEND: " + cont)
val pkt = PacketCoding.MarshalPacket(cont).require
val bytes = pkt.toByteVector

View file

@ -68,7 +68,7 @@ class LoginSessionActor extends Actor with ActorLogging {
}
def sendResponse(cont : PlanetSidePacketContainer) = {
log.info("LOGIN SEND: " + cont)
println("LOGIN SEND: " + cont)
rightRef ! cont
}
}

View file

@ -13,7 +13,7 @@ final case class HelloFriend(next: ActorRef)
class UdpListener(nextActor: ActorRef) extends Actor with ActorLogging {
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 bytesSent = 0L