mirror of
https://bitbucket.org/projectswg/cucore.git
synced 2026-10-18 10:02:57 -04:00
Got Login process nearly complete
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user