mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-27 17:57:22 -04:00
more residency fixes
This commit is contained in:
@@ -27,6 +27,7 @@ import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import resources.objects.building.BuildingObject;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.objects.player.PlayerObject;
|
||||
import engine.resources.common.CRC;
|
||||
@@ -90,16 +91,24 @@ public class CharacterSheetResponseMessage extends SWGMessage {
|
||||
buffer.putFloat(0); // bank y
|
||||
buffer.put(getAsciiString("tatooine"));
|
||||
|
||||
buffer.putFloat(0); // home x
|
||||
buffer.putFloat(0); // home z
|
||||
buffer.putFloat(0); // home y
|
||||
buffer.put(getAsciiString("")); // home planet
|
||||
if(creature.getAttachment("residentBuilding") == null) {
|
||||
buffer.putFloat(0); // home x
|
||||
buffer.putFloat(0); // home z
|
||||
buffer.putFloat(0); // home y
|
||||
buffer.put(getAsciiString("")); // home planet
|
||||
} else {
|
||||
BuildingObject building = (BuildingObject) NGECore.getInstance().objectService.getObject((long) creature.getAttachment("residentBuilding"));
|
||||
buffer.putFloat(building.getPosition().x); // home x
|
||||
buffer.putFloat(building.getPosition().y); // home z
|
||||
buffer.putFloat(building.getPosition().z); // home y
|
||||
buffer.put(getAsciiString(building.getPlanet().getName())); // home planet
|
||||
}
|
||||
|
||||
buffer.put(getAsciiString("")); // Name of city player resides in
|
||||
buffer.put(getAsciiString(player.getHome())); // Name of city player resides in
|
||||
|
||||
buffer.put(getUnicodeString(spouse));
|
||||
|
||||
buffer.putInt(creature.getPlayerObject().getLotsRemaining()); // lots remaining
|
||||
buffer.putInt(player.getLotsRemaining()); // lots remaining
|
||||
|
||||
return buffer.flip();
|
||||
}
|
||||
|
||||
@@ -525,10 +525,11 @@ public class HousingService implements INetworkDispatch {
|
||||
}
|
||||
building.setResidency();
|
||||
PlayerCity cityActorIsIn = core.playerCityService.getCityObjectIsIn(building);
|
||||
owner.setAttachment("residentCity", cityActorIsIn.getCityID());
|
||||
owner.setAttachment("residencyCooldown", System.currentTimeMillis() + 86400000); // 24 hours
|
||||
owner.setAttachment("residentBuilding", building.getObjectID());
|
||||
((CreatureObject) owner).sendSystemMessage("@player_structure:change_residence", (byte) 0);
|
||||
if(cityActorIsIn != null) {
|
||||
owner.setAttachment("residentCity", cityActorIsIn.getCityID());
|
||||
((CreatureObject) owner).getPlayerObject().setHome(cityActorIsIn.getCityName());
|
||||
((CreatureObject) owner).getPlayerObject().setCitizenship(Citizenship.Citizen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user