mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-08 23:12:57 -04:00
Merge pull request #531 from ProjectSWGCore/Wave_Missions
Delivery Missions
This commit is contained in:
@@ -251,12 +251,30 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
getClient().getSession().write(messageBuilder.buildBankCreditsDelta(bankCredits));
|
||||
}
|
||||
}
|
||||
|
||||
public void addBankCredits(int amountToAdd) {
|
||||
synchronized(objectMutex) {
|
||||
this.bankCredits += amountToAdd;
|
||||
}
|
||||
if(getClient() != null && getClient().getSession() != null) {
|
||||
getClient().getSession().write(messageBuilder.buildBankCreditsDelta(bankCredits));
|
||||
}
|
||||
}
|
||||
|
||||
public int getCashCredits() {
|
||||
synchronized(objectMutex) {
|
||||
return cashCredits;
|
||||
}
|
||||
}
|
||||
|
||||
public void addCashCredits(int amountToAdd) {
|
||||
synchronized(objectMutex) {
|
||||
this.cashCredits += amountToAdd;
|
||||
}
|
||||
if(getClient() != null && getClient().getSession() != null) {
|
||||
getClient().getSession().write(messageBuilder.buildCashCreditsDelta(cashCredits));
|
||||
}
|
||||
}
|
||||
|
||||
public void setCashCredits(int cashCredits) {
|
||||
synchronized(objectMutex) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.nio.ByteOrder;
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import engine.resources.common.CRC;
|
||||
import engine.resources.scene.Point3D;
|
||||
import resources.common.Console;
|
||||
import resources.common.StringUtilities;
|
||||
import resources.objects.ObjectMessageBuilder;
|
||||
@@ -42,109 +43,123 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
IoBuffer buffer = IoBuffer.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
buffer.setAutoExpand(true);
|
||||
|
||||
buffer.putShort((short) 17);
|
||||
buffer.putShort((short) 16);
|
||||
|
||||
buffer.putFloat(1); // mission complexity ??
|
||||
buffer.put(getAsciiString(mission.getStfFilename()));
|
||||
buffer.putFloat(object.getComplexity()); // mission complexity ??
|
||||
|
||||
buffer.put(getAsciiString(object.getStfFilename()));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString(mission.getStfName()));
|
||||
|
||||
if (mission.getCustomName() == null) { buffer.put(getUnicodeString("")); }
|
||||
buffer.put(getAsciiString(object.getStfName()));
|
||||
|
||||
if (mission.getCustomName() == null) { buffer.putInt(0); }
|
||||
else { buffer.put(getUnicodeString(mission.getCustomName())); }
|
||||
|
||||
buffer.putInt(0); // volume
|
||||
buffer.putInt(object.getVolume()); // volume
|
||||
|
||||
buffer.putInt(0); // unused
|
||||
|
||||
buffer.putInt(mission.getMissionLevel());
|
||||
|
||||
buffer.putFloat(mission.getMissionStartX());
|
||||
buffer.putFloat(0); // missionStartZ
|
||||
buffer.putFloat(mission.getMissionStartY());
|
||||
|
||||
buffer.putLong(0); // ??
|
||||
|
||||
if (mission.getMissionStartPlanet() == null) {
|
||||
buffer.putInt(0);
|
||||
if (mission.getStartLocation() != null) {
|
||||
buffer.putFloat(mission.getStartLocation().x);
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(mission.getStartLocation().z);
|
||||
} else {
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(0);
|
||||
}
|
||||
buffer.putLong(0); // Start Object ID
|
||||
if (mission.getMissionStartPlanet() == null)
|
||||
buffer.putInt(0);
|
||||
else
|
||||
buffer.putInt(CRC.StringtoCRC(mission.getMissionStartPlanet()));
|
||||
}
|
||||
|
||||
buffer.put(getUnicodeString(mission.getMissionCreator()));
|
||||
buffer.putInt(mission.getMissionCredits());
|
||||
|
||||
buffer.putFloat(mission.getMissionDestinationX());
|
||||
buffer.putFloat(0); // missionDestinationZ
|
||||
buffer.putFloat(mission.getMissionDestinationY());
|
||||
|
||||
buffer.putLong(0); // ??
|
||||
|
||||
if (mission.getMissionDestinationPlanet() == null) {
|
||||
if (mission.getCreator() != null)
|
||||
buffer.put(getUnicodeString(mission.getCreator()));
|
||||
else
|
||||
buffer.putInt(0);
|
||||
|
||||
buffer.putInt(mission.getCreditReward());
|
||||
|
||||
if (mission.getDestination() != null) {
|
||||
buffer.putFloat(mission.getDestination().x);
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(mission.getDestination().z);
|
||||
} else {
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(0);
|
||||
}
|
||||
buffer.putLong(0); // Destination Object ID
|
||||
if (mission.getMissionDestinationPlanet() == null)
|
||||
buffer.putInt(0);
|
||||
else
|
||||
buffer.putInt(CRC.StringtoCRC(mission.getMissionDestinationPlanet()));
|
||||
}
|
||||
|
||||
if (mission.getTargetTemplateObject() == null) {
|
||||
buffer.putInt(0);
|
||||
} else {
|
||||
buffer.putInt(CRC.StringtoCRC(mission.getTargetTemplateObject()));
|
||||
}
|
||||
buffer.putInt(mission.getMissionTemplateObject());
|
||||
|
||||
buffer.put(getAsciiString(mission.getMissionDescription()));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString(mission.getMissionDescId()));
|
||||
buffer.put(getAsciiString("m" + mission.getMissionId() + "d"));
|
||||
|
||||
buffer.put(getAsciiString(mission.getMissionTitle()));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString(mission.getMissionTitleId()));
|
||||
buffer.put(getAsciiString("m" + mission.getMissionId() + "t"));
|
||||
|
||||
buffer.putInt(0); // refresh counter
|
||||
|
||||
if(mission.getMissionType() == null) {
|
||||
if(mission.getMissionType() == null)
|
||||
buffer.putInt(0);
|
||||
} else {
|
||||
else
|
||||
buffer.putInt(CRC.StringtoCRC(mission.getMissionType()));
|
||||
}
|
||||
|
||||
buffer.put(getAsciiString(mission.getMissionTargetName()));
|
||||
|
||||
WaypointObject wp = mission.getMissionAttachedWaypoint();
|
||||
WaypointObject wp = mission.getAttachedWaypoint();
|
||||
|
||||
if (wp == null) {
|
||||
buffer.putInt(0);
|
||||
buffer.putInt(0); // cell
|
||||
buffer.putFloat(0); // x
|
||||
buffer.putFloat(0); // z
|
||||
buffer.putFloat(0); // y
|
||||
buffer.putLong(0); // target id
|
||||
buffer.putInt(0); // planet crc
|
||||
buffer.put(getUnicodeString(""));
|
||||
buffer.putInt(0); // name
|
||||
buffer.putLong(0); // waypoint id
|
||||
buffer.put((byte) 0); // color
|
||||
buffer.put((byte) 0x01); //active
|
||||
} else {
|
||||
buffer.putInt(wp.getCellId());
|
||||
buffer.putFloat(wp.getPosition().x);
|
||||
buffer.putFloat(wp.getPosition().z);
|
||||
buffer.putFloat(wp.getPosition().y);
|
||||
buffer.putFloat(wp.getPosition().z);
|
||||
buffer.putLong(0);
|
||||
buffer.putInt(CRC.StringtoCRC(wp.getPlanet().name));
|
||||
buffer.put((byte) 0);
|
||||
buffer.put((byte) 0x01);
|
||||
buffer.put(getUnicodeString(wp.getName()));
|
||||
buffer.putLong(wp.getObjectId());
|
||||
buffer.put(wp.getColor());
|
||||
buffer.put((byte) (wp.isActive() ? 1 : 0));
|
||||
}
|
||||
|
||||
int size = buffer.position();
|
||||
buffer = bufferPool.allocate(size, false).put(buffer.array(), 0, size);
|
||||
|
||||
buffer.flip();
|
||||
buffer = createBaseline("MISO", (byte) 3, buffer, size);
|
||||
|
||||
Console.println("Bytes: " + StringUtilities.bytesToHex(buffer.array()));
|
||||
//Console.println("MISO3 Bytes: " + StringUtilities.bytesToHex(buffer.array()));
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildBaseline6() {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(4, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = IoBuffer.allocate(18, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putInt(121); // unk
|
||||
buffer.putShort((short) 3);
|
||||
buffer.putInt(76); // server id
|
||||
buffer.putLong(0); // detail stf
|
||||
buffer.putInt(0xFFFFFFFF); // unknown
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -153,6 +168,30 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildBaseline8() {
|
||||
IoBuffer buffer = IoBuffer.allocate(2, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putShort((short) 0); // unknown
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
buffer = createBaseline("MISO", (byte) 8, buffer, size);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildBaseline9() {
|
||||
IoBuffer buffer = IoBuffer.allocate(2, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putShort((short) 0); // unknown
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
buffer = createBaseline("MISO", (byte) 9, buffer, size);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildStfDelta(String stfFile, String stfName) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(4 + stfFile.length() + stfName.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
@@ -181,18 +220,21 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildStartLocationDelta(float x, float z, float y, String planet) {
|
||||
public IoBuffer buildStartLocationDelta(Point3D startLocation, String planet) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(24, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putFloat(x);
|
||||
buffer.putFloat(z);
|
||||
buffer.putFloat(y);
|
||||
buffer.putFloat(startLocation.x);
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(startLocation.z);
|
||||
|
||||
buffer.putLong(0);
|
||||
|
||||
buffer.putInt(CRC.StringtoCRC(planet));
|
||||
|
||||
if (planet == null) {
|
||||
buffer.putInt(CRC.StringtoCRC(object.getPlanet().name));
|
||||
} else {
|
||||
buffer.putInt(CRC.StringtoCRC(planet));
|
||||
}
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
buffer = createDelta("MISO", (byte) 3, (short) 1, (short) 0x06, buffer, size + 4);
|
||||
@@ -202,9 +244,9 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
|
||||
public IoBuffer buildCreatorNameDelta(String creator) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(4 + creator.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = IoBuffer.allocate(4 + (creator.length() * 2), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.put(getAsciiString(creator));
|
||||
buffer.put(getUnicodeString(creator));
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -226,17 +268,21 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildDestinationDelta(float x, float z, float y, String planet) {
|
||||
public IoBuffer buildDestinationDelta(Point3D destination, String planet) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(24, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putFloat(x);
|
||||
buffer.putFloat(z);
|
||||
buffer.putFloat(y);
|
||||
buffer.putFloat(destination.x);
|
||||
buffer.putFloat(0);
|
||||
buffer.putFloat(destination.z);
|
||||
|
||||
buffer.putLong(0); // Destination Object ID
|
||||
|
||||
buffer.putInt(CRC.StringtoCRC(planet));
|
||||
if (planet == null) {
|
||||
buffer.putInt(CRC.StringtoCRC(object.getPlanet().name));
|
||||
} else {
|
||||
buffer.putInt(CRC.StringtoCRC(planet));
|
||||
}
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -245,11 +291,11 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildTargetObjectIffDelta(String template) {
|
||||
public IoBuffer buildTargetObjectIffDelta(int template) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(4, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putInt(CRC.StringtoCRC(template));
|
||||
buffer.putInt(template);
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -258,13 +304,13 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildMissionDescriptionDelta(String desc, String id) {
|
||||
public IoBuffer buildMissionDescriptionDelta(String desc, int id) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(8 + desc.length() + id.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = IoBuffer.allocate(12 + desc.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.put(getAsciiString(desc));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString(id));
|
||||
buffer.put(getAsciiString("m" + id + "d"));
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -273,13 +319,13 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildMissionTitleDelta(String title, String id) {
|
||||
public IoBuffer buildMissionTitleDelta(String title, int id) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(8 + title.length() + id.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = IoBuffer.allocate(12 + title.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.put(getAsciiString(title));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString(id));
|
||||
buffer.put(getAsciiString("m" + id + "t"));
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -326,6 +372,28 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildWaypointDelta(WaypointObject wp) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(44 + (2 * wp.getName().length()), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putInt(wp.getCellId());
|
||||
buffer.putFloat(wp.getPosition().x);
|
||||
buffer.putFloat(wp.getPosition().y);
|
||||
buffer.putFloat(wp.getPosition().z);
|
||||
buffer.putLong(0);
|
||||
buffer.putInt(CRC.StringtoCRC(wp.getPlanet().name));
|
||||
buffer.put(getUnicodeString(wp.getName()));
|
||||
buffer.putLong(wp.getObjectId());
|
||||
buffer.put(wp.getColor());
|
||||
buffer.put((byte) (wp.isActive() ? 1 : 0));
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
buffer = createDelta("MISO", (byte) 3, (short) 1, (short) 0x10, buffer, size + 4);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendListDelta(byte viewType, short updateType, IoBuffer buffer) {
|
||||
|
||||
@@ -28,36 +28,32 @@ import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import resources.objects.intangible.IntangibleObject;
|
||||
import resources.objects.waypoint.WaypointObject;
|
||||
import services.mission.MissionObjective;
|
||||
import engine.clients.Client;
|
||||
import engine.resources.objects.IPersistent;
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
import engine.resources.scene.Quaternion;
|
||||
|
||||
@Persistent(version=0)
|
||||
@Persistent(version=1)
|
||||
public class MissionObject extends IntangibleObject implements IPersistent {
|
||||
|
||||
private float missionDestinationX;
|
||||
private float missionDestinationY;
|
||||
private float missionDestinationZ;
|
||||
private float missionStartX;
|
||||
private float missionStartY;
|
||||
private float missionStartZ;
|
||||
private String missionStartPlanet;
|
||||
private int missionLevel; // Difficulty level displayed in details
|
||||
private String missionDestinationPlanet;
|
||||
private int missionRepeatCounter; // increases for each player using the mission; used for redisplaying on mission term too
|
||||
private int missionCredits;
|
||||
private String missionCreator = "";
|
||||
private String missionDescription = "";
|
||||
private String missionTitle = "";
|
||||
private Point3D destination;
|
||||
private Point3D startLocation;
|
||||
private String startPlanet = "";
|
||||
private int difficultyLevel = 0; // Difficulty level displayed in details
|
||||
private String destinationPlanet = "";
|
||||
private int repeatCount = 0; // increases for each player using the mission; used for redisplaying on mission term too
|
||||
private int reward = 0;
|
||||
private String creator = "";
|
||||
private String description = "";
|
||||
private String title = "";
|
||||
private String missionTargetName = ""; // Target object I guess?
|
||||
private String missionDescId = "";
|
||||
private String missionTitleId = "";
|
||||
private String missionType;
|
||||
private WaypointObject missionAttachedWaypoint;
|
||||
|
||||
private String missionTemplateObject;
|
||||
private int missionId = 0;
|
||||
private String type = "";
|
||||
private int missionTemplateObject = 0;
|
||||
private WaypointObject attachedWaypoint;
|
||||
private MissionObjective objective;
|
||||
|
||||
@NotPersistent
|
||||
MissionMessageBuilder messageBuilder = new MissionMessageBuilder(this);
|
||||
@@ -73,150 +69,106 @@ public class MissionObject extends IntangibleObject implements IPersistent {
|
||||
super(objectID, planet, new Point3D(0, 0, 0), new Quaternion(1, 0, 0, 0), template);
|
||||
}
|
||||
|
||||
public float getMissionStartX() {
|
||||
synchronized(objectMutex) {
|
||||
return missionStartX;
|
||||
}
|
||||
}
|
||||
|
||||
public float getMissionStartY() {
|
||||
synchronized(objectMutex) {
|
||||
return missionStartY;
|
||||
}
|
||||
}
|
||||
|
||||
public float getMissionStartZ() {
|
||||
synchronized(objectMutex) {
|
||||
return missionStartZ;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionStart(float x, float y, float z, String planet) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionStartZ = z;
|
||||
this.missionStartX = x;
|
||||
this.missionStartY = y;
|
||||
this.missionStartPlanet = planet;
|
||||
}
|
||||
|
||||
notifyObservers(messageBuilder.buildStartLocationDelta(x, z, y, planet), false);
|
||||
}
|
||||
|
||||
public float getMissionDestinationX() {
|
||||
synchronized(objectMutex) {
|
||||
return missionDestinationX;
|
||||
}
|
||||
}
|
||||
|
||||
public float getMissionDestinationY() {
|
||||
synchronized(objectMutex) {
|
||||
return missionDestinationY;
|
||||
}
|
||||
}
|
||||
|
||||
public float getMissionDestinationZ() {
|
||||
synchronized(objectMutex) {
|
||||
return missionDestinationZ;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionDestination(float x, float y, float z, String planet) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionDestinationZ = z;
|
||||
this.missionDestinationY = y;
|
||||
this.missionDestinationZ = z;
|
||||
this.missionDestinationPlanet = planet;
|
||||
}
|
||||
}
|
||||
|
||||
public String getMissionDestinationPlanet() {
|
||||
synchronized(objectMutex) {
|
||||
return missionDestinationPlanet;
|
||||
return destinationPlanet;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMissionLevel() {
|
||||
synchronized(objectMutex) {
|
||||
return missionLevel;
|
||||
return difficultyLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionLevel(int missionLevel) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionLevel = missionLevel;
|
||||
this.difficultyLevel = missionLevel;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildDifficultyLevelDelta(missionLevel));
|
||||
}
|
||||
}
|
||||
|
||||
public String getMissionStartPlanet() {
|
||||
synchronized(objectMutex) {
|
||||
return missionStartPlanet;
|
||||
return startPlanet;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMissionRepeatCounter() {
|
||||
synchronized(objectMutex) {
|
||||
return missionRepeatCounter;
|
||||
return repeatCount;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionRepeatCounter(int missionRepeatCounter) {
|
||||
public void setRepeatCount(int missionRepeatCounter) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionRepeatCounter = missionRepeatCounter;
|
||||
this.repeatCount = missionRepeatCounter;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildRepeatCounterDelta(missionRepeatCounter));
|
||||
}
|
||||
}
|
||||
|
||||
public int getMissionCredits() {
|
||||
public int getCreditReward() {
|
||||
synchronized(objectMutex) {
|
||||
return missionCredits;
|
||||
return reward;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionCredits(int missionCredits) {
|
||||
public void setCreditReward(int missionCredits) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionCredits = missionCredits;
|
||||
this.reward = missionCredits;
|
||||
}
|
||||
notifyObservers(messageBuilder.buildCreditsRewardDelta(missionCredits), false);
|
||||
}
|
||||
|
||||
public String getMissionCreator() {
|
||||
synchronized(objectMutex) {
|
||||
return missionCreator;
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildCreditsRewardDelta(missionCredits));
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionCreator(String missionCreator) {
|
||||
public String getCreator() {
|
||||
synchronized(objectMutex) {
|
||||
this.missionCreator = missionCreator;
|
||||
return creator;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCreator(String missionCreator) {
|
||||
synchronized(objectMutex) {
|
||||
this.creator = missionCreator;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildCreatorNameDelta(missionCreator));
|
||||
}
|
||||
notifyObservers(messageBuilder.buildCreatorNameDelta(missionCreator), false);
|
||||
}
|
||||
|
||||
public String getMissionDescription() {
|
||||
synchronized(objectMutex) {
|
||||
return missionDescription;
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionDescription(String missionDescription, String id) {
|
||||
public void setMissionDescription(String missionDescription) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionDescription = missionDescription;
|
||||
this.missionDescId = id;
|
||||
this.description = missionDescription;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionDescriptionDelta(missionDescription, missionId));
|
||||
}
|
||||
notifyObservers(messageBuilder.buildMissionDescriptionDelta(missionDescription, id), false);
|
||||
}
|
||||
|
||||
public String getMissionTitle() {
|
||||
synchronized(objectMutex) {
|
||||
return missionTitle;
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionTitle(String missionTitle, String id) {
|
||||
public void setMissionTitle(String missionTitle) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionTitle = missionTitle;
|
||||
this.missionTitleId = id;
|
||||
this.title = missionTitle;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionTitleDelta(missionTitle, missionId));
|
||||
}
|
||||
notifyObservers(messageBuilder.buildMissionTitleDelta(missionTitle, id), false);
|
||||
}
|
||||
|
||||
public String getMissionTargetName() {
|
||||
@@ -229,57 +181,109 @@ public class MissionObject extends IntangibleObject implements IPersistent {
|
||||
synchronized(objectMutex) {
|
||||
this.missionTargetName = missionTargetName;
|
||||
}
|
||||
notifyObservers(messageBuilder.buildTargetNameDelta(missionTargetName), false);
|
||||
}
|
||||
|
||||
public WaypointObject getMissionAttachedWaypoint() {
|
||||
synchronized(objectMutex) {
|
||||
return missionAttachedWaypoint;
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildTargetNameDelta(missionTargetName));
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionAttachedWaypoint(WaypointObject missionAttachedWaypoint) {
|
||||
public WaypointObject getAttachedWaypoint() {
|
||||
synchronized(objectMutex) {
|
||||
this.missionAttachedWaypoint = missionAttachedWaypoint;
|
||||
return attachedWaypoint;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTargetTemplateObject() {
|
||||
public void setAttachedWaypoint(WaypointObject waypoint) {
|
||||
synchronized(objectMutex) {
|
||||
this.attachedWaypoint = waypoint;
|
||||
}
|
||||
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildWaypointDelta(waypoint));
|
||||
}
|
||||
}
|
||||
|
||||
public int getMissionTemplateObject() {
|
||||
synchronized(objectMutex) {
|
||||
return missionTemplateObject;
|
||||
}
|
||||
}
|
||||
|
||||
public void setTargetTemplateObject(String missionTemplateObject) {
|
||||
public void setMissionTemplateObject(int missionTemplateObject) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionTemplateObject = missionTemplateObject;
|
||||
}
|
||||
notifyObservers(messageBuilder.buildTargetObjectIffDelta(missionTemplateObject), false);
|
||||
}
|
||||
|
||||
public String getMissionDescId() {
|
||||
synchronized(objectMutex) {
|
||||
return missionDescId;
|
||||
}
|
||||
}
|
||||
|
||||
public String getMissionTitleId() {
|
||||
synchronized(objectMutex) {
|
||||
return missionTitleId;
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildTargetObjectIffDelta(missionTemplateObject));
|
||||
}
|
||||
}
|
||||
|
||||
public String getMissionType() {
|
||||
synchronized(objectMutex) {
|
||||
return missionType;
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMissionType(String missionType) {
|
||||
synchronized(objectMutex) {
|
||||
this.missionType = missionType;
|
||||
this.type = missionType;
|
||||
}
|
||||
notifyObservers(messageBuilder.buildMissionTypeDelta(missionType), false);
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionTypeDelta(missionType));
|
||||
}
|
||||
}
|
||||
|
||||
public MissionObjective getObjective() {
|
||||
synchronized(objectMutex) {
|
||||
return objective;
|
||||
}
|
||||
}
|
||||
|
||||
public void setObjective(MissionObjective objective) {
|
||||
synchronized(objectMutex) {
|
||||
this.objective = objective;
|
||||
}
|
||||
}
|
||||
|
||||
public Point3D getStartLocation() {
|
||||
synchronized(objectMutex) {
|
||||
return startLocation;
|
||||
}
|
||||
}
|
||||
|
||||
public Point3D getDestination() {
|
||||
synchronized(objectMutex) {
|
||||
return destination;
|
||||
}
|
||||
}
|
||||
|
||||
public void setStartLocation(Point3D startLocation, String planet) {
|
||||
synchronized(objectMutex) {
|
||||
this.startLocation = startLocation;
|
||||
this.startPlanet = planet;
|
||||
}
|
||||
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildStartLocationDelta(startLocation, planet));
|
||||
}
|
||||
}
|
||||
|
||||
public void setDestination(Point3D destination, String planet) {
|
||||
synchronized(objectMutex) {
|
||||
this.destination = destination;
|
||||
this.destinationPlanet = planet;
|
||||
}
|
||||
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildDestinationDelta(destination, planet));
|
||||
}
|
||||
}
|
||||
|
||||
public int getMissionId() {
|
||||
return missionId;
|
||||
}
|
||||
|
||||
public void setMissionId(int missionId) {
|
||||
this.missionId = missionId;
|
||||
}
|
||||
|
||||
public Transaction getTransaction() {
|
||||
@@ -300,6 +304,8 @@ public class MissionObject extends IntangibleObject implements IPersistent {
|
||||
|
||||
destination.getSession().write(messageBuilder.buildBaseline3());
|
||||
destination.getSession().write(messageBuilder.buildBaseline6());
|
||||
destination.getSession().write(messageBuilder.buildBaseline8());
|
||||
destination.getSession().write(messageBuilder.buildBaseline9());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user