Changes to MissionObjective, started working on player bounties

This commit is contained in:
Waverunner
2014-04-28 17:37:23 -04:00
parent 251ce17612
commit b0e2a490f6
19 changed files with 461 additions and 80 deletions
@@ -26,6 +26,7 @@ import com.sleepycat.je.Transaction;
import com.sleepycat.persist.model.NotPersistent;
import com.sleepycat.persist.model.Persistent;
import resources.common.BountyListItem;
import resources.objects.intangible.IntangibleObject;
import resources.objects.waypoint.WaypointObject;
import services.mission.MissionObjective;
@@ -53,8 +54,11 @@ public class MissionObject extends IntangibleObject implements IPersistent {
private String type = "";
private int missionTemplateObject = 0;
private WaypointObject attachedWaypoint;
// Server variables
private MissionObjective objective;
private long bountyObjId;
@NotPersistent
MissionMessageBuilder messageBuilder = new MissionMessageBuilder(this);
@@ -148,11 +152,15 @@ public class MissionObject extends IntangibleObject implements IPersistent {
}
public void setMissionDescription(String missionDescription) {
setMissionDescription(missionDescription, "");
}
public void setMissionDescription(String missionDescription, String additionalParam) {
synchronized(objectMutex) {
this.description = missionDescription;
}
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionDescriptionDelta(missionDescription, missionId));
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionDescriptionDelta(missionDescription, missionId, additionalParam));
}
}
@@ -163,11 +171,15 @@ public class MissionObject extends IntangibleObject implements IPersistent {
}
public void setMissionTitle(String missionTitle) {
setMissionTitle(missionTitle, "");
}
public void setMissionTitle(String missionTitle, String additionalParam) {
synchronized(objectMutex) {
this.title = missionTitle;
}
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionTitleDelta(missionTitle, missionId));
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionTitleDelta(missionTitle, missionId, additionalParam));
}
}
@@ -286,6 +298,14 @@ public class MissionObject extends IntangibleObject implements IPersistent {
this.missionId = missionId;
}
public long getBountyObjId() {
return bountyObjId;
}
public void setBountyObjId(long bountyObjId) {
this.bountyObjId = bountyObjId;
}
public Transaction getTransaction() {
return txn;
}