Added another mail

This commit is contained in:
CharonInferar
2014-04-24 01:44:51 +02:00
parent 42724a76d6
commit 2e0fcd7ee5
2 changed files with 37 additions and 2 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
LOAD.SNAPSHOT_OBJECTS=0
LOAD.BUILDOUT_OBJECTS=0
LOAD.SNAPSHOT_OBJECTS=1
LOAD.BUILDOUT_OBJECTS=1
LOAD.RESOURCE.SYSTEM=1
+35
View File
@@ -660,5 +660,40 @@ public class PlayerCity {
NGECore.getInstance().chatService.storePersistentMessage(actorMail);
NGECore.getInstance().chatService.sendPersistentMessageHeader(citizen.getClient(), actorMail);
}
public void sendCitizenLeftMailAll(CreatureObject newCitizen) {
Vector<Long> citizenList = getCitizens();
for (long citizen : citizenList){
CreatureObject citizenObject = (CreatureObject) NGECore.getInstance().objectService.getObject(citizen);
Mail actorMail = new Mail();
actorMail.setMailId(NGECore.getInstance().chatService.generateMailId());
actorMail.setRecieverId(citizen);
actorMail.setStatus(Mail.NEW);
actorMail.setTimeStamp((int) (new Date().getTime() / 1000));
actorMail.setMessage("@city/city:lost_citizen_body");
actorMail.setSubject("@city/city:lost_citizen_subject");
actorMail.setSenderName("City " + this.cityName);
List<WaypointAttachment> attachments = new ArrayList<WaypointAttachment>();
WaypointObject constructionWaypoint = (WaypointObject)NGECore.getInstance().objectService.createObject("object/waypoint/shared_world_waypoint_blue.iff", citizenObject.getPlanet(), citizenObject.getPosition().x, 0 ,citizenObject.getPosition().z);
WaypointAttachment attachment = new WaypointAttachment();
attachment.active = false;
attachment.cellID = constructionWaypoint.getCellId();
attachment.color = (byte)1;
attachment.name = "City";
attachment.planetCRC = engine.resources.common.CRC.StringtoCRC(citizenObject.getPlanet().getName());
attachment.positionX = citizenObject.getPosition().x;
attachment.positionY = 0;
attachment.positionZ = citizenObject.getPosition().z;
attachments.add(attachment);
actorMail.setAttachments(attachments);
NGECore.getInstance().chatService.storePersistentMessage(actorMail);
if (newCitizen.getClient()!=null)
NGECore.getInstance().chatService.sendPersistentMessageHeader(newCitizen.getClient(), actorMail);
}
}
}