Got Login process nearly complete

This commit is contained in:
Obique
2014-11-25 09:13:51 -06:00
committed by Obique
parent e520d17979
commit e0afcb89e1
6 changed files with 361 additions and 12 deletions
+28
View File
@@ -1,5 +1,10 @@
package services;
import network.packets.soe.DataChannelA;
import network.packets.swg.SWGPacket;
import intents.InboundPacketIntent;
import intents.OutboundPacketIntent;
import resources.control.Intent;
import resources.control.Manager;
import services.player.PlayerManager;
@@ -28,9 +33,32 @@ public class CoreManager extends Manager {
@Override
public boolean initialize() {
startTime = System.nanoTime();
registerForIntent(InboundPacketIntent.TYPE);
registerForIntent(OutboundPacketIntent.TYPE);
return super.initialize();
}
@Override
public void onIntentReceived(Intent i) {
if (i instanceof InboundPacketIntent) {
InboundPacketIntent in = (InboundPacketIntent) i;
System.out.println("IN " + in.getNetworkId() + ":" + in.getServerType() + "\t" + in.getPacket().getClass().getSimpleName());
if (in.getPacket() instanceof DataChannelA) {
for (SWGPacket p : ((DataChannelA) in.getPacket()).getPackets()) {
System.out.println(" " + p.getClass().getSimpleName());
}
}
} else if (i instanceof OutboundPacketIntent) {
OutboundPacketIntent out = (OutboundPacketIntent) i;
System.out.println("OUT " + out.getNetworkId() + " \t" + out.getPacket().getClass().getSimpleName());
if (out.getPacket() instanceof DataChannelA) {
for (SWGPacket p : ((DataChannelA) out.getPacket()).getPackets()) {
System.out.println(" " + p.getClass().getSimpleName());
}
}
}
}
/**
* Returns the time in milliseconds since the server started initialization
* @return the core time represented as a double