mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-07-14 00:03:01 -04:00
Added automatic STF parsing for a new object's STF file and detail STF file
This commit is contained in:
@@ -21,6 +21,8 @@ import network.packets.swg.zone.insertion.SelectCharacter;
|
||||
import resources.Location;
|
||||
import resources.Race;
|
||||
import resources.Terrain;
|
||||
import resources.client_info.ClientFactory;
|
||||
import resources.client_info.visitors.ObjectData;
|
||||
import resources.control.Intent;
|
||||
import resources.control.Manager;
|
||||
import resources.objects.SWGObject;
|
||||
@@ -40,6 +42,8 @@ public class ObjectManager extends Manager {
|
||||
|
||||
private static final double AWARE_RANGE = 200;
|
||||
|
||||
private ClientFactory clientFac;
|
||||
|
||||
private ObjectDatabase<SWGObject> objects;
|
||||
private Map <String, QuadTree <SWGObject>> quadTree;
|
||||
private long maxObjectId;
|
||||
@@ -74,6 +78,9 @@ public class ObjectManager extends Manager {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
clientFac = new ClientFactory();
|
||||
|
||||
return super.initialize();
|
||||
}
|
||||
|
||||
@@ -120,6 +127,7 @@ public class ObjectManager extends Manager {
|
||||
synchronized (objects) {
|
||||
long objectId = getNextObjectId();
|
||||
SWGObject obj = createObjectFromTemplate(objectId, template);
|
||||
addObjectAttributes(obj, template);
|
||||
obj.setTemplate(template);
|
||||
obj.setLocation(l);
|
||||
objects.put(objectId, obj);
|
||||
@@ -127,6 +135,14 @@ public class ObjectManager extends Manager {
|
||||
}
|
||||
}
|
||||
|
||||
private void addObjectAttributes(SWGObject obj, String template) {
|
||||
|
||||
ObjectData attributes = (ObjectData) clientFac.getInfoFromFile(ClientFactory.formatToSharedFile(template));
|
||||
|
||||
obj.setStf((String) attributes.getAttribute("objectName"));
|
||||
obj.setDetailStf((String) attributes.getAttribute("detailedDescription"));
|
||||
}
|
||||
|
||||
private void zoneInCharacter(PlayerManager playerManager, long netId, long characterId) {
|
||||
Player player = playerManager.getPlayerFromNetworkId(netId);
|
||||
if (player != null) {
|
||||
|
||||
Reference in New Issue
Block a user