Conflicts:
	src/services/EntertainmentService.java
This commit is contained in:
Waverunner
2014-03-26 20:08:30 -04:00
40 changed files with 408 additions and 445 deletions
+8
View File
@@ -49,6 +49,14 @@ footprint/
interiorlayout/
clientdata/quest/
# PSWG Object Databases
odb/building/je.info.0.19
odb/creature/je.info.0.19
odb/doids/je.info.0.18
odb/guild/je.info.0.19
odb/mails/je.info.0.19
odb/oids/je.info.0.19
# External tool builders
.externalToolBuilders/
+2
View File
@@ -11,3 +11,5 @@ DB.URL=localhost
DB.PASS=nge
GALAXY_ID=2
GALAXY_NAME=Local Connection
XPMULTIPLIER=1.0
MAXNUMBEROFCHARACTERS=2
Binary file not shown.
+1 -1
View File
@@ -19,7 +19,7 @@ def run(core, actor, target, commandString):
if not combatSvc.areInDuel(actor, target):
return
combatSvc.handleEndDuel(actor, target)
combatSvc.handleEndDuel(actor, target, true)
return
+1 -1
View File
@@ -22,7 +22,7 @@ def run(core, actor, target, commandString):
Console.println("Doesn't have permission!")
return
parent.remove(target)
#parent.remove(target)
core.objectService.destroyObject(target)
return
+10 -2
View File
@@ -66,11 +66,19 @@ def run(core, actor, target, commandString):
dGun.setStringAttribute('crafter', 'Wavescrub')
core.playerService.giveItems(actor, testObject, dGun)
return
elif command == 'comm':
comm = CommPlayerMessage(actor.getObjectId())
actor.getClient().getSession().write(comm.serialize())
elif command == 'spawn' and arg1 and arg2:
pos = actor.getWorldPosition()
core.spawnService.spawnCreature(arg1, actor.getPlanet().getName(), 0, pos.x, pos.y, pos.z, 1, 0, 1, 0, int(arg2))
elif command == 'instance' and arg1:
core.instanceService.queue(arg1, actor)
elif command == 'id':
actor.sendSystemMessage('Your id is: ' + str(actor.getObjectId()), 0)
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_pinpoint_shielding_1')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_pinpoint_shielding_1')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_pinpoint_shielding_2')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_pinpoint_shielding_2')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_pinpoint_shielding_3')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_pinpoint_shielding_3')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkill('expertise_co_pinpoint_shielding_3)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_pinpoint_shielding_4')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_pinpoint_shielding_4')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_powered_armor_1')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_powered_armor_1')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_powered_armor_2')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_powered_armor_2')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_powered_armor_3')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_powered_armor_3')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -3,45 +3,35 @@ import sys
def addExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.addSkill('expertise_co_powered_armor_4')
actor.addSkillMod('energy', 250)
actor.addSkillMod('kinetic', 250)
actor.addSkillMod('acid', 250)
actor.addSkillMod('heat', 250)
actor.addSkillMod('cold', 250)
actor.addSkillMod('electricity', 250)
actor.addSkillMod('expertise_innate_protection_all', 250)
addAbilities(core, actor, player)
return
def removeExpertisePoint(core, actor):
player = actor.getSlottedObject('ghost')
if not player:
return
if not player.getProfession() == 'commando_1a':
return
actor.removeSkill('expertise_co_powered_armor_4')
actor.removeSkillMod('energy', 250)
actor.removeSkillMod('kinetic', 250)
actor.removeSkillMod('acid', 250)
actor.removeSkillMod('heat', 250)
actor.removeSkillMod('cold', 250)
actor.removeSkillMod('electricity', 250)
actor.removeSkillMod('expertise_innate_protection_all', 250)
removeAbilities(core, actor, player)
return
@@ -49,9 +39,10 @@ def removeExpertisePoint(core, actor):
# this checks what abilities the player gets by level, need to also call this on level-up
def addAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
def removeAbilities(core, actor, player):
return
@@ -0,0 +1,18 @@
import sys
from services.spawn import MobileTemplate
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
templates = Vector()
templates.add('object/mobile/shared_krayt_dragon.iff')
mobileTemplate.setTemplates(templates)
mobileTemplate.setLevel(90)
mobileTemplate.setDifficulty(2)
attacks = Vector()
mobileTemplate.setDefaultAttack('creatureMeleeAttack')
mobileTemplate.setAttacks(attacks)
mobileTemplate.setCreatureName('krayt_dragon_ancient')
mobileTemplate.setScale(2)
core.spawnService.addMobileTemplate('krayt_dragon_ancient', mobileTemplate)
@@ -1,10 +1,12 @@
import sys
def add(core, actor, name, base):
actor.addSkillMod('energy', base)
actor.addSkillMod(name, base)
return
def deduct(core, actor, name, base):
actor.deductSkillMod('energy', base)
actor.deductSkillMod(name, base)
return
@@ -1,10 +1,12 @@
import sys
def add(core, actor, name, base):
actor.addSkillMod('kinetic', base)
actor.addSkillMod(name, base)
return
def deduct(core, actor, name, base):
actor.deductSkillMod('kinetic', base)
actor.deductSkillMod(name, base)
return
+2 -2
View File
@@ -408,10 +408,10 @@ public class NGECore {
weatherService = new WeatherService(this);
weatherService.loadPlanetSettings();
/*spawnService.loadMobileTemplates();
spawnService.loadMobileTemplates();
spawnService.loadLairTemplates();
spawnService.loadLairGroups();
spawnService.loadSpawnAreas();*/
spawnService.loadSpawnAreas();
retroService.run();
@@ -60,6 +60,8 @@ public abstract class AbstractCollidable {
}
public void removeCollidedObject(SWGObject obj) {
if(!collidedObjects.contains(obj))
return;
collidedObjects.remove(obj);
ExitEvent event = new ExitEvent();
event.object = obj;
@@ -836,7 +836,7 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder {
}
/*public IoBuffer buildAddSkillModDelta(String name, int base) {
public IoBuffer buildAddSkillModDelta(String name, int base) {
CreatureObject creature = (CreatureObject) object;
@@ -854,9 +854,9 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder {
return buffer;
}*/
}
/*public IoBuffer buildRemoveSkillModDelta(String name, int base) {
public IoBuffer buildRemoveSkillModDelta(String name, int base) {
CreatureObject creature = (CreatureObject) object;
@@ -874,7 +874,7 @@ public class CreatureMessageBuilder extends ObjectMessageBuilder {
return buffer;
}*/
}
public IoBuffer buildAddSkillDelta(String name) {
@@ -588,10 +588,10 @@ public class CreatureObject extends TangibleObject implements IPersistent {
SkillMod mod = getSkillMod(name);
mod.setBase(mod.getBase() + base);
/*if(getClient() != null) {
if(getClient() != null) {
setSkillModsUpdateCounter((short) (getSkillModsUpdateCounter() + 1));
getClient().getSession().write(messageBuilder.buildAddSkillModDelta(name, mod.getBase()));
}*/
}
}
}
@@ -609,10 +609,10 @@ public class CreatureObject extends TangibleObject implements IPersistent {
} else {
skillMods.set(skillMods.indexOf(mod), mod);
System.out.println("Deducted mod!");
/*if(getClient() != null) {
if(getClient() != null) {
setSkillModsUpdateCounter((short) (getSkillModsUpdateCounter() + 1));
getClient().getSession().write(messageBuilder.buildAddSkillModDelta(name, mod.getBase()));
}*/
}
}
}
@@ -620,10 +620,10 @@ public class CreatureObject extends TangibleObject implements IPersistent {
public void removeSkillMod(SkillMod mod) {
skillMods.remove(mod);
/*if(getClient() != null) {
if(getClient() != null) {
setSkillModsUpdateCounter((short) (getSkillModsUpdateCounter() + 1));
getClient().getSession().write(messageBuilder.buildRemoveSkillModDelta(mod.getName(), mod.getBase()));
}*/
}
}
public short getSkillModsUpdateCounter() {
@@ -1088,7 +1088,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
}
public void removeObjectFromEquipList(SWGObject object) {
if(object instanceof TangibleObject) {
if(object instanceof TangibleObject && equipmentList.contains(object)) {
setEquipmentListUpdateCounter(getEquipmentListUpdateCounter() + 1);
notifyObservers(messageBuilder.buildRemoveEquipmentDelta((TangibleObject) object), true);
equipmentList.get().remove(object);
@@ -1104,7 +1104,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
}
public void removeObjectFromAppearanceEquipList(SWGObject object) {
if(object instanceof TangibleObject) {
if(object instanceof TangibleObject && appearanceEquipmentList.contains(object)) {
setAppearanceEquipmentListUpdateCounter(getAppearanceEquipmentListUpdateCounter() + 1);
notifyObservers(messageBuilder.buildRemoveAppearanceEquipmentDelta((TangibleObject) object), true);
appearanceEquipmentList.get().remove(object);
+1 -1
View File
@@ -95,7 +95,7 @@ public class BuffService implements INetworkDispatch {
return null;
}
if (!core.simulationService.checkLineOfSight(buffer, target)) {
if (target != buffer && !core.simulationService.checkLineOfSight(buffer, target)) {
return null;
}
+6 -8
View File
@@ -25,6 +25,7 @@ import java.nio.ByteOrder;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -45,7 +46,6 @@ import protocol.swg.ConnectionServerLagResponse;
import protocol.swg.GalaxyLoopTimesResponse;
import protocol.swg.GameServerLagResponse;
import protocol.swg.HeartBeatMessage;
import engine.clients.Client;
import engine.resources.database.DatabaseConnection;
import engine.resources.scene.Point3D;
@@ -64,7 +64,7 @@ public class ConnectionService implements INetworkDispatch {
private NGECore core;
private DatabaseConnection databaseConnection;
private DatabaseConnection databaseConnection2;
private int maxNumberOfCharacters;
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
public ConnectionService(final NGECore core) {
@@ -72,6 +72,7 @@ public class ConnectionService implements INetworkDispatch {
this.core = core;
this.databaseConnection = core.getDatabase1();
this.databaseConnection2 = core.getDatabase2();
this.maxNumberOfCharacters = core.getConfig().getInt("MAXNUMBEROFCHARACTERS");
scheduler.scheduleAtFixedRate(new Runnable() {
@@ -125,7 +126,7 @@ public class ConnectionService implements INetworkDispatch {
client.setSessionKey(clientIdMsg.getSessionKey());
client.setGM(core.loginService.checkForGmPermission((int) resultSet.getLong("accountId")));
AccountFeatureBits accountFeatureBits = new AccountFeatureBits();
ClientPermissionsMessage clientPermissionsMessage = new ClientPermissionsMessage(2 - core.characterService.getNumberOfCharacters((int) resultSet.getLong("accountId")));
ClientPermissionsMessage clientPermissionsMessage = new ClientPermissionsMessage(maxNumberOfCharacters - core.characterService.getNumberOfCharacters((int) resultSet.getLong("accountId")));
session.write(new HeartBeatMessage().serialize());
session.write(accountFeatureBits.serialize());
session.write(clientPermissionsMessage.serialize());
@@ -213,7 +214,7 @@ public class ConnectionService implements INetworkDispatch {
for (CreatureObject opponent : object.getDuelList()) {
if (opponent != null) {
core.combatService.handleEndDuel(object, opponent);
core.combatService.handleEndDuel(object, opponent, false);
}
}
@@ -232,10 +233,7 @@ public class ConnectionService implements INetworkDispatch {
List<AbstractCollidable> collidables = core.simulationService.getCollidables(object.getPlanet(), objectPos.x, objectPos.z, 512);
for(AbstractCollidable collidable : collidables) {
collidables.remove(object);
}
collidables.forEach(c -> c.removeCollidedObject(object));
if (ghost != null) {
String objectShortName = object.getCustomName();
+76 -102
View File
@@ -273,7 +273,7 @@ public class EntertainmentService implements INetworkDispatch {
end.setBufferId(buffer.getObjectId());
end.setBuffRecipientId(buffRecipient.getObjectId());
ObjControllerMessage closeMessage = new ObjControllerMessage(0x0B, end);
buffer.getClient().getSession().write(closeMessage.serialize());
CreatureObject cre = (CreatureObject) buffer;
@@ -628,30 +628,24 @@ public class EntertainmentService implements INetworkDispatch {
}
public void startPerformanceExperience(final CreatureObject entertainer) {
final ScheduledFuture<?> experienceTask = scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
Performance p = performancesByIndex.get(entertainer.getPerformanceId());
if (p == null) {
entertainer.setFlourishCount(0);
return;
}
int floXP = p.getFlourishXpMod();
int floCount = entertainer.getFlourishCount();
//FIXME: this is not an accurate implementation yet. It needs group bonuses and other things.
int XP = (int) Math.round( ((floCount > 2) ? 2 : floCount) * floXP * 3.8 );
final ScheduledFuture<?> experienceTask = scheduler.scheduleAtFixedRate(() -> {
Performance p = performancesByIndex.get(entertainer.getPerformanceId());
if (p == null) {
entertainer.setFlourishCount(0);
core.playerService.giveExperience(entertainer, XP);
return;
}
},10000, 10000, TimeUnit.MILLISECONDS);
int floXP = p.getFlourishXpMod();
int floCount = entertainer.getFlourishCount();
//FIXME: this is not an accurate implementation yet. It needs group bonuses and other things.
int XP = (int) Math.round( ((floCount > 2) ? 2 : floCount) * floXP * 3.8 );
entertainer.setFlourishCount(0);
core.playerService.giveExperience(entertainer, XP);
}, 10000, 10000, TimeUnit.MILLISECONDS);
entertainer.setEntertainerExperience(experienceTask);
@@ -670,28 +664,25 @@ public class EntertainmentService implements INetworkDispatch {
performer.addAudience(spectator);
spectator.setMoodAnimation("entertained");
final ScheduledFuture<?> spectatorTask = scheduler.scheduleAtFixedRate(new Runnable() {
final ScheduledFuture<?> spectatorTask = scheduler.scheduleAtFixedRate(() -> {
if (spectator.getPosition().getDistance2D(performer.getWorldPosition()) > (float) 70) {
@Override
public void run() {
if (spectator.getPosition().getDistance2D(performer.getWorldPosition()) > (float) 70) {
if(((performer.getPerformanceType()) ? "dance" : "music").equals("dance")) {
spectator.setPerformanceWatchee(null);
spectator.sendSystemMessage("You stop watching " + performer.getCustomName() + " because " + performer.getCustomName()
+ " is out of range.", (byte) 0);
}
else {
spectator.setPerformanceListenee(null);
spectator.sendSystemMessage("You stop listening to " + performer.getCustomName() + " because " + performer.getCustomName()
+ " is out of range.", (byte) 0);
}
spectator.setMoodAnimation("neutral");
performer.removeAudience(spectator);
if (spectator.getInspirationTick().cancel(true))
spectator.getSpectatorTask().cancel(true);
if(((performer.getPerformanceType()) ? "dance" : "music").equals("dance")) {
spectator.setPerformanceWatchee(null);
spectator.sendSystemMessage("You stop watching " + performer.getCustomName() + " because " + performer.getCustomName()
+ " is out of range.", (byte) 0);
}
else {
spectator.setPerformanceListenee(null);
spectator.sendSystemMessage("You stop listening to " + performer.getCustomName() + " because " + performer.getCustomName()
+ " is out of range.", (byte) 0);
}
spectator.setMoodAnimation("neutral");
performer.removeAudience(spectator);
if (spectator.getInspirationTick().cancel(true))
spectator.getSpectatorTask().cancel(true);
}
}, 2, 2, TimeUnit.SECONDS);
@@ -729,15 +720,10 @@ public class EntertainmentService implements INetworkDispatch {
performer.setPerformingFlourish(true);
performer.sendSystemMessage("@performance:flourish_perform", (byte) 0);
performer.doSkillAnimation(anmFlo);
scheduler.schedule(new Runnable() {
@Override
public void run() {
performer.setFlourishCount(0);
performer.setPerformingFlourish(false);
}
scheduler.schedule(() -> {
performer.setFlourishCount(0);
performer.setPerformingFlourish(true);
}, (long) performance.getLoopDuration(), TimeUnit.SECONDS);
}
@@ -779,13 +765,8 @@ public class EntertainmentService implements INetworkDispatch {
else
performer.playEffectObject(effect, "");
scheduler.schedule(new Runnable() {
@Override
public void run() {
performer.setPerformingEffect(false);
}
scheduler.schedule(() -> {
performer.setPerformingEffect(false);
}, (long) pEffect.getEffectDuration(), TimeUnit.SECONDS);
return true;
@@ -794,42 +775,39 @@ public class EntertainmentService implements INetworkDispatch {
public void handleInspirationTicks(final CreatureObject spectator, final CreatureObject performer) {
// http://youtu.be/WqyAde-oC7o?t=11m14s << Player watching entertainer (Has ring only, no pet, + 15 min ticks)
// TODO: Camp/Cantina checks for expertise and duration bonus %. Right now only using basic values.
final ScheduledFuture<?> inspirationTick = scheduler.scheduleAtFixedRate(new Runnable() {
final ScheduledFuture<?> inspirationTick = scheduler.scheduleAtFixedRate(() -> {
@Override
public void run() {
int time = 0; // current buff duration time (minutes)
int buffCap = 215; // 5 hours 35 minutes - 2 hours (buff duration increase bonus) << Taken from video, doesn't account for performance bonuses etc.
int time = 0; // current buff duration time (minutes)
int buffCap = 215; // 5 hours 35 minutes - 2 hours (buff duration increase bonus) << Taken from video, doesn't account for performance bonuses etc.
if (spectator.getAttachment("inspireDuration") != null)
time+= (int) spectator.getAttachment("inspireDuration");
if (spectator.getAttachment("inspireDuration") != null)
time+= (int) spectator.getAttachment("inspireDuration");
if (performer.getSkillMod("expertise_en_inspire_buff_duration_increase") != null) {
SkillMod durationMod = performer.getSkillMod("expertise_en_inspire_buff_duration_increase");
buffCap += durationMod.getBase() + durationMod.getModifier();
}
if (time >= buffCap) {
spectator.setAttachment("inspireDuration", buffCap); // incase someone went over cap
spectator.getInspirationTick().cancel(true);
} else {
int entTick = 10;
if (performer.getSkillMod("expertise_en_inspire_pulse_duration_increase") != null) {
SkillMod pulseMod = performer.getSkillMod("expertise_en_inspire_pulse_duration_increase");
entTick += pulseMod.getBase() + pulseMod.getModifier();
}
int duration = (time + entTick); // minutes
int hMinutes = MathUtilities.secondsToHourMinutes(duration * 60);
int hours = MathUtilities.secondsToWholeHours(duration * 60);
spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78);
spectator.setAttachment("inspireDuration", duration);
//System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName());
}
if (performer.getSkillMod("expertise_en_inspire_buff_duration_increase") != null) {
SkillMod durationMod = performer.getSkillMod("expertise_en_inspire_buff_duration_increase");
buffCap += durationMod.getBase() + durationMod.getModifier();
}
if (time >= buffCap) {
spectator.setAttachment("inspireDuration", buffCap); // incase someone went over cap
spectator.getInspirationTick().cancel(true);
} else {
int entTick = 10;
if (performer.getSkillMod("expertise_en_inspire_pulse_duration_increase") != null) {
SkillMod pulseMod = performer.getSkillMod("expertise_en_inspire_pulse_duration_increase");
entTick += pulseMod.getBase() + pulseMod.getModifier();
}
int duration = (time + entTick); // minutes
int hMinutes = MathUtilities.secondsToHourMinutes(duration * 60);
int hours = MathUtilities.secondsToWholeHours(duration * 60);
spectator.showFlyText("spam", "buff_duration_tick_observer", String.valueOf(hours) + " hours , " + hMinutes + " minutes ", 0, (float) 0.66, new RGB(255, 182, 193), 3, 78);
spectator.setAttachment("inspireDuration", duration);
//System.out.println("Inspire Duration: " + spectator.getAttachment("inspireDuration") + " on " + spectator.getCustomName());
}
}, 10, 10, TimeUnit.SECONDS);
spectator.setInspirationTick(inspirationTick);
}
@@ -847,22 +825,18 @@ public class EntertainmentService implements INetworkDispatch {
returnParams.add("btnOk:Text");
notification.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, new SUICallback(){
notification.addHandler(0, "", Trigger.TRIGGER_OK, returnParams, (owner, eventType, returnList) -> {
if (eventType == 0) {
if (charge > actor.getCashCredits()) {
actor.sendSystemMessage("You do not have enough credits to cover the charge.", (byte) 0); // TODO: Find the message in the STF files.
return;
} else{
actor.setCashCredits(actor.getCashCredits() - charge);
actor.sendSystemMessage("You payed the cover charge of " + charge + " to " + performer.getCustomName(), (byte) 0); // TODO: Find the message in the STF files.
performer.setCashCredits(performer.getCashCredits() + charge);
@Override
public void process(SWGObject owner, int eventType, Vector<String> returnList) {
if (eventType == 0) {
if (charge > actor.getCashCredits()) {
actor.sendSystemMessage("You do not have enough credits to cover the charge.", (byte) 0); // TODO: Find the message in the STF files.
return;
} else{
actor.setCashCredits(actor.getCashCredits() - charge);
actor.sendSystemMessage("You payed the cover charge of " + charge + " to " + performer.getCustomName(), (byte) 0); // TODO: Find the message in the STF files.
performer.setCashCredits(performer.getCashCredits() + charge);
startSpectating(actor, performer, performer.getPerformanceType());
startSpectating(actor, performer, performer.getPerformanceType());
}
}
}
});
+5 -19
View File
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit;
import resources.objects.building.BuildingObject;
import resources.objects.creature.CreatureObject;
import resources.objects.group.GroupObject;
import services.object.ObjectService;
import main.NGECore;
import engine.clientdata.ClientFileManager;
@@ -192,12 +192,8 @@ public class InstanceService implements INetworkDispatch {
}
public synchronized void close() {
for (SWGObject object : objectList) {
core.objectService.destroyObject(object);
}
objectList.stream().forEach(core.objectService::destroyObject);
objectList.clear();
closed = true;
}
@@ -286,18 +282,12 @@ public class InstanceService implements INetworkDispatch {
public void run() {
if (instance.getDuration() > 300 && instance.getTimeRemaining() <= 300 && !sentCloseWarning) {
for (CreatureObject player : instance.getActiveParticipants()) {
player.sendSystemMessage("@instance:five_minute_warning", (byte) 0);
}
instance.getActiveParticipants().stream().forEach(p -> p.sendSystemMessage("@instance:five_minute_warning", (byte) 0));
sentCloseWarning = true;
}
if (!instance.isOpen()) {
for (CreatureObject player : instance.getActiveParticipants()) {
player.sendSystemMessage("@instance:instance_time_out", (byte) 0);
}
instance.getActiveParticipants().stream().forEach(p -> p.sendSystemMessage("@instance:instance_time_out", (byte) 0));
close(instance);
}
@@ -696,11 +686,7 @@ public class InstanceService implements INetworkDispatch {
List<Instance> lockoutList = new ArrayList<Instance>();
for (List<Instance> instanceList : instanceMap.values()) {
for (Instance instance : instanceList) {
if (instance.isFormerParticipant(creature)) {
lockoutList.add(instance);
}
}
instanceList.stream().filter(i -> i.isFormerParticipant(creature)).forEach(i -> lockoutList.add(i));
}
return lockoutList;
+5 -3
View File
@@ -95,12 +95,14 @@ public class PlayerService implements INetworkDispatch {
private NGECore core;
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
private float xpMultiplier;
protected final Object objectMutex = new Object();
public PlayerService(final NGECore core) {
this.core = core;
this.xpMultiplier = (float) core.getConfig().getDouble("XPMULTIPLIER");
if(xpMultiplier == 0)
xpMultiplier = 1;
}
public void postZoneIn(final CreatureObject creature) {
@@ -483,7 +485,7 @@ public class PlayerService implements INetworkDispatch {
public void giveExperience(CreatureObject creature, int experience) {
DatatableVisitor experienceTable;
PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost");
experience *= xpMultiplier;
//synchronized(objectMutex) {
try {
experienceTable = ClientFileManager.loadFile("datatables/player/player_level.iff", DatatableVisitor.class);
+1 -1
View File
@@ -981,7 +981,7 @@ public class SimulationService implements INetworkDispatch {
Point3D origin = new Point3D(position1.x, position1.y + 1, position1.z);
Point3D end = new Point3D(position2.x, position2.y + 1, position2.z);
Vector3D direction = new Vector3D(end.x - origin.x, end.y - origin.y, end.z - origin.z).normalize();
Vector3D direction = new Vector3D(end.x - origin.x, end.y - origin.y, end.z - origin.z);
if (direction.getNorm() != 0) {
direction.normalize();
+1 -1
View File
@@ -181,7 +181,7 @@ public class SkillService implements INetworkDispatch {
public void removeSkill(CreatureObject creature, String skill) {
PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost");
DatatableVisitor skillTable;
if (player == null) {
return;
}
+17 -20
View File
@@ -191,28 +191,25 @@ public class TerrainService {
for(final Planet planet : planets) {
if(planet.getSnapshotVisitor() != null) {
Thread thread = new Thread(new Runnable() {
Thread thread = new Thread(() -> {
@Override
public void run() {
Config config = new Config();
config.setFilePath("options.cfg");
boolean loaded = config.loadConfigFile();
if (loaded && config.getInt("LOAD.SNAPSHOT_OBJECTS") > 0) {
try {
core.objectService.loadSnapshotObjects(planet);
} catch (Exception e) {
e.printStackTrace();
}
Config config = new Config();
config.setFilePath("options.cfg");
boolean loaded = config.loadConfigFile();
if (loaded && config.getInt("LOAD.SNAPSHOT_OBJECTS") > 0) {
try {
core.objectService.loadSnapshotObjects(planet);
} catch (Exception e) {
e.printStackTrace();
}
if (loaded && config.getInt("LOAD.BUILDOUT_OBJECTS") > 0) {
try {
core.objectService.loadBuildoutObjects(planet);
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
if (loaded && config.getInt("LOAD.BUILDOUT_OBJECTS") > 0) {
try {
core.objectService.loadBuildoutObjects(planet);
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
+2 -8
View File
@@ -64,14 +64,8 @@ public class WeatherService {
weatherStability.put(planet, stability);
currentWeatherMap.put(planet, defaultWeather);
scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
runWeatherCycle(planet);
}
scheduler.scheduleAtFixedRate(() -> {
runWeatherCycle(planet);
}, 30, 30, TimeUnit.MINUTES);
}
+12
View File
@@ -233,4 +233,16 @@ public class AIActor {
}
}
public void scheduleDespawn() {
scheduler.schedule(() -> {
damageMap.clear();
followObject = null;
creature.setAttachment("AI", null);
NGECore.getInstance().objectService.destroyObject(creature);
}, 30000, TimeUnit.MILLISECONDS);
}
}
+3 -1
View File
@@ -77,7 +77,7 @@ public class AIService {
float damagePercent = damage / creature.getMaxHealth();
int finalXP = (int) (damagePercent * baseXP);
finalXP -= ((levelDifference > 20) ? (finalXP - 1) : (((levelDifference * 5) / 100) * finalXP));
core.playerService.giveExperience(player, finalXP);
}
}
@@ -101,6 +101,8 @@ public class AIService {
}
//TODO: this is slightly inaccurate if the xp table in the prima guide is correct
if(difficulty == 1) {
baseXP += (6 + ((creature.getLevel() - 1) / 10) * 3);
} else if(difficulty == 2) {
+2 -2
View File
@@ -57,7 +57,7 @@ public class AttackState extends AIState {
return StateResult.DEAD;
actor.getMovementPoints().clear();
if(actor.getFollowObject() != null) {
if(/*actor.getSpawnPosition().getWorldPosition().getDistance(creature.getWorldPosition()) > 128 ||*/ NGECore.getInstance().terrainService.isWater(creature.getPlanetId(), actor.getFollowObject().getWorldPosition())) {
if(actor.getSpawnPosition().getWorldPosition().getDistance(creature.getWorldPosition()) > 128 || NGECore.getInstance().terrainService.isWater(creature.getPlanetId(), actor.getFollowObject().getWorldPosition())) {
actor.removeDefender(actor.getFollowObject());
//actor.scheduleMovement();
return StateResult.UNFINISHED;
@@ -110,7 +110,7 @@ public class AttackState extends AIState {
actor.scheduleRecovery();
return StateResult.UNFINISHED;
}
if(/*target.getWorldPosition().getDistance(creature.getWorldPosition()) > 128 ||*/ target.getPosture() == 13 || target.getPosture() == 14) {
if(target.getWorldPosition().getDistance(creature.getWorldPosition()) > 128 || target.getPosture() == 13 || target.getPosture() == 14) {
actor.removeDefender(target);
actor.scheduleRecovery();
return StateResult.UNFINISHED;
+3 -1
View File
@@ -21,13 +21,15 @@
******************************************************************************/
package services.ai.states;
import main.NGECore;
import services.ai.AIActor;
public class DeathState extends AIState {
@Override
public byte onEnter(AIActor actor) {
// TODO Auto-generated method stub
NGECore.getInstance().aiService.awardExperience(actor);
actor.scheduleDespawn();
return 0;
}
+22 -22
View File
@@ -795,24 +795,19 @@ public class CombatService implements INetworkDispatch {
target.setTurnRadius(0);
target.setSpeedMultiplierBase(0);
}
ScheduledFuture<?> incapTask = scheduler.schedule(new Runnable() {
@Override
public void run() {
synchronized(target.getMutex()) {
if(target.getPosture() != 13)
return;
target.setPosture((byte) 0);
target.setTurnRadius(1);
target.setSpeedMultiplierBase(1);
}
}
ScheduledFuture<?> incapTask = scheduler.schedule(() -> {
synchronized(target.getMutex()) {
if(target.getPosture() != 13)
return;
target.setPosture((byte) 0);
target.setTurnRadius(1);
target.setSpeedMultiplierBase(1);
}
}, target.getIncapTimer(), TimeUnit.SECONDS);
target.setIncapTask(incapTask);
core.buffService.addBuffToCreature(target, "incapWeaken");
@@ -824,6 +819,8 @@ public class CombatService implements INetworkDispatch {
target.setHealth(0);
target.setPosture((byte) 14);
}
attacker.removeDefender(target);
target.removeDefender(attacker);
return;
}
synchronized(target.getMutex()) {
@@ -993,8 +990,9 @@ public class CombatService implements INetworkDispatch {
attacker.removeDefender(target);
target.removeDefender(attacker);
core.playerService.sendCloningWindow(target, attacker.getSlottedObject("ghost") != null);
if(target.getDuelList().contains(attacker)) handleEndDuel(target, attacker, false);
core.playerService.sendCloningWindow(target, attacker.getSlottedObject("ghost") != null);
}
public boolean areInDuel(CreatureObject creature1, CreatureObject creature2) {
@@ -1003,7 +1001,6 @@ public class CombatService implements INetworkDispatch {
return true;
return false;
}
public void handleDuel(CreatureObject requester, CreatureObject target) {
@@ -1028,7 +1025,7 @@ public class CombatService implements INetworkDispatch {
}
public void handleEndDuel(CreatureObject requester, CreatureObject target) {
public void handleEndDuel(CreatureObject requester, CreatureObject target, boolean announce) {
requester.getDuelList().remove(target);
target.getDuelList().remove(requester);
@@ -1039,8 +1036,11 @@ public class CombatService implements INetworkDispatch {
target.getClient().getSession().write(new UpdatePVPStatusMessage(requester.getObjectID(), 0x16, requester.getFaction()).serialize());
requester.getClient().getSession().write(new UpdatePVPStatusMessage(target.getObjectID(), 0x16, target.getFaction()).serialize());
requester.sendSystemMessage("You end your duel with " + target.getCustomName() + ".", (byte) 0);
target.sendSystemMessage(requester.getCustomName() + " ends your duel.", (byte) 0);
if(announce)
{
requester.sendSystemMessage("You end your duel with " + target.getCustomName() + ".", (byte) 0);
target.sendSystemMessage(requester.getCustomName() + " ends your duel.", (byte) 0);
}
}
+20 -5
View File
@@ -78,6 +78,8 @@ import engine.clientdata.visitors.WorldSnapshotVisitor.SnapshotChunk;
import engine.clients.Client;
import engine.resources.common.CRC;
import engine.resources.container.Traverser;
import engine.resources.container.WorldCellPermissions;
import engine.resources.container.WorldPermissions;
import engine.resources.database.DatabaseConnection;
import engine.resources.objects.SWGObject;
import engine.resources.scene.Planet;
@@ -415,9 +417,15 @@ public class ObjectService implements INetworkDispatch {
}
});
objectList.remove(object.getObjectID());
if(object.getContainer() != null) {
SWGObject parent = object.getContainer();
if(parent != null) {
if(parent instanceof CreatureObject) {
((CreatureObject) parent).removeObjectFromEquipList(object);
((CreatureObject) parent).removeObjectFromAppearanceEquipList(object);
}
long parentId = object.getParentId();
object.getContainer()._remove(object);
parent.remove(object);
object.setParentId(parentId);
} else {
core.simulationService.remove(object, object.getWorldPosition().x, object.getWorldPosition().z, true);
@@ -696,10 +704,12 @@ public class ObjectService implements INetworkDispatch {
int objectId = chunk.id;
SWGObject obj = createObject(visitor.getName(chunk.nameId), objectId, planet, new Point3D(chunk.xPosition, chunk.yPosition, chunk.zPosition), new Quaternion(chunk.orientationW, chunk.orientationX, chunk.orientationY, chunk.orientationZ));
if(obj != null) {
obj.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
obj.setisInSnapshot(true);
obj.setParentId(chunk.parentId);
if(obj instanceof CellObject) {
((CellObject) obj).setCellNumber(chunk.cellNumber);
obj.setContainerPermissions(WorldCellPermissions.WORLD_CELL_PERMISSIONS);
}
}
//System.out.print("\rLoading Object [" + counter + "/" + visitor.getChunks().size() + "] : " + visitor.getName(chunk.nameId));
@@ -744,7 +754,7 @@ public class ObjectService implements INetworkDispatch {
}
SWGObject child = createObject(template, 0, parent.getPlanet(), position, orientation);
child.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
if(parent.getAttachment("childObjects") == null)
parent.setAttachment("childObjects", new Vector<SWGObject>());
@@ -890,17 +900,21 @@ public class ObjectService implements INetworkDispatch {
}
if(object == null)
continue;
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
if(radius > 256)
object.setAttachment("bigSpawnRange", new Boolean(true));
quadtreeObjects.add(object);
} else if(containerId != 0) {
object = createObject(template, 0, planet, new Point3D(px, py, pz), new Quaternion(qw, qx, qy, qz));
object = createObject(template, 0, planet, new Point3D(px, py, pz), new Quaternion(qw, qx, qy, qz));
if(containers.contains(containerId)) {
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
object.setisInSnapshot(false);
containers.add(objectId);
}
if(object instanceof CellObject && cellIndex != 0)
if(object instanceof CellObject && cellIndex != 0) {
object.setContainerPermissions(WorldCellPermissions.WORLD_CELL_PERMISSIONS);
((CellObject) object).setCellNumber(cellIndex);
}
SWGObject parent = getObject(containerId);
if(parent != null && object != null) {
@@ -910,6 +924,7 @@ public class ObjectService implements INetworkDispatch {
}
} else {
object = createObject(template, 0, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz));
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
quadtreeObjects.add(object);
}
+18
View File
@@ -39,6 +39,8 @@ public class MobileTemplate {
private int maxDamage;
private int difficulty = 0;
private int health, action;
private String creatureName;
private float scale = 1;
public Vector<String> getTemplates() {
return templates;
@@ -128,4 +130,20 @@ public class MobileTemplate {
this.defaultAttack = defaultAttack;
}
public String getCreatureName() {
return creatureName;
}
public void setCreatureName(String creatureName) {
this.creatureName = creatureName;
}
public float getScale() {
return scale;
}
public void setScale(float scale) {
this.scale = scale;
}
}
+7
View File
@@ -103,6 +103,9 @@ public class SpawnService {
creature.setOptionsBitmask(mobileTemplate.getOptionBitmask());
creature.setPvPBitmask(mobileTemplate.getPvpBitmask());
creature.setStfFilename("mob/creature_names"); // TODO: set other STFs for NPCs other than creatures
creature.setStfName(mobileTemplate.getCreatureName());
creature.setHeight(mobileTemplate.getScale());
int difficulty = mobileTemplate.getDifficulty();
creature.setDifficulty((byte) difficulty);
if(level != -1)
@@ -171,6 +174,10 @@ public class SpawnService {
return creature;
}
public CreatureObject spawnCreature(String mobileTemplate, String planetName, long cellId, float x, float y, float z, float qW, float qX, float qY, float qZ, int level) {
return spawnCreature(mobileTemplate, planetName, cellId, x, y, z, 1, 0, 0, 0, (short) level);
}
public CreatureObject spawnCreature(String mobileTemplate, String planetName, long cellId, float x, float y, float z) {
return spawnCreature(mobileTemplate, planetName, cellId, x, y, z, 1, 0, 0, 0, (short) -1);
}
+1 -13
View File
@@ -257,19 +257,7 @@ public class SUIService implements INetworkDispatch {
window.clearDataSource("List.dataList");
//int index = 0;
for(Entry<Long, String> e : cloneData.entrySet()) {
/*window.addDataItem("List.dataList:Name", String.valueOf(index));
window.setProperty("List.dataList." + index + ":Text", string);
++index;*/
window.addListBoxMenuItem(e.getValue(), e.getKey());
}
cloneData.entrySet().forEach(e -> window.addListBoxMenuItem(e.getValue(), e.getKey()));
return window;
+1 -3
View File
@@ -233,9 +233,7 @@ public class TravelService implements INetworkDispatch {
public void loadTravelPoints() {
List<Planet> planetList = core.terrainService.getPlanetList();
for (Planet planet : planetList) {
addPlanet(planet);
}
planetList.forEach(this::addPlanet);
populateTravelFares();
}