mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-05 20:13:20 -04:00
Created PlayerManager and LoginService. Not functional yet
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package services.player;
|
||||
|
||||
import network.packets.Packet;
|
||||
import intents.InboundPacketIntent;
|
||||
import resources.control.Intent;
|
||||
import resources.control.Manager;
|
||||
import resources.network.ServerType;
|
||||
|
||||
public class PlayerManager extends Manager {
|
||||
|
||||
private LoginService loginService;
|
||||
|
||||
public PlayerManager() {
|
||||
loginService = new LoginService();
|
||||
|
||||
addChildService(loginService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean initialize() {
|
||||
registerForIntent(InboundPacketIntent.TYPE);
|
||||
return super.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(Intent i) {
|
||||
if (i instanceof InboundPacketIntent) {
|
||||
Packet p = ((InboundPacketIntent) i).getPacket();
|
||||
if (((InboundPacketIntent) i).getServerType() == ServerType.LOGIN) {
|
||||
loginService.handlePacket(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user