Wiki

Clone wiki

Holocore / Services

Overview

Rather than how things worked in Core 2 with NGECore2 holding all of the services for any part of the program to access, Holocore works by having a tree of services that can only communicate using Intents. Aside from Intents, the only times a service is allowed to call a function in another service is when (1) the second service is a direct child or (2) the second service is passed through an Intent.

An example of (1) is in PlayerManager. The LoginService and ZoneServices are children, and when a packet is received it will decide which service it should go to based on the current state of the player.

A small facet of services is managers. A Manager extends a Service, and the only difference is that Managers are the only ones that can have children. Services cannot have children.

Debug

Useful tip: add this to a packet handling function to see what packets you're receiving:

Log.d("RX SWGPacket: %s", (packet instanceof SWGPacket) ? ((SWGPacket) packet).getPacketType() : "[not swgpacket]");

Updated