mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-30 00:15:57 -04:00
Binary file not shown.
+3
-2
@@ -5,5 +5,6 @@ def addZones(core):
|
||||
gcwService = core.gcwService
|
||||
|
||||
gcwService.addPvPZone('rori', 5318, 5680, 400)
|
||||
|
||||
|
||||
gcwService.addPvPZone('corellia', 4722, -5233, 200)
|
||||
gcwService.addPvPZone('naboo', 1019, -1508, 150)
|
||||
gcwService.addPvPZone('talus', -4899, -3137, 150)
|
||||
+6
-6
@@ -97,20 +97,20 @@ public class AuctionQueryHeadersResponseMessage extends SWGMessage {
|
||||
result.putInt(item.getPrice());
|
||||
result.putInt((int) ((item.getExpireTime() - System.currentTimeMillis()) / 1000));
|
||||
result.putInt(item.getPrice());
|
||||
result.putShort((short) getStringIndex(item.getOwnerName()));
|
||||
result.putShort((short) getStringIndex(item.getVuid()));
|
||||
result.putInt(0);
|
||||
result.putShort((short) 0);
|
||||
result.put((byte) 0);
|
||||
result.putShort((short) getStringIndex(item.getOwnerName()));
|
||||
result.put((byte) 0);
|
||||
result.put((byte) (item.isAuction() ? 0 : 1));
|
||||
result.putLong(0);
|
||||
result.putShort((short) 0);
|
||||
result.put((byte) 0);
|
||||
result.putInt(2); // unk
|
||||
result.putInt(0);
|
||||
result.putShort((short) 0);
|
||||
result.putInt(0);
|
||||
result.putInt(item.getItemType()); // gameObjectType/category bitmask
|
||||
|
||||
//result.putInt(0x400C); // category bitmask?
|
||||
result.putInt(0);
|
||||
result.putInt(0); // gameObjectType/category bitmask
|
||||
int options = 0;
|
||||
|
||||
if(item.getOwnerId() == playerId && (item.getStatus() == AuctionItem.OFFERED || item.getStatus() == AuctionItem.FORSALE))
|
||||
|
||||
@@ -91,6 +91,9 @@ public class ChatPersistentMessageToClient extends SWGMessage {
|
||||
|
||||
for(WaypointAttachment attachment : attachments) {
|
||||
|
||||
result.putShort((short) 0);
|
||||
result.put((byte) 4);
|
||||
result.putInt(0xFFFFFFFD);
|
||||
result.putInt(0);
|
||||
result.putFloat(attachment.positionX);
|
||||
result.putFloat(attachment.positionY);
|
||||
@@ -101,6 +104,7 @@ public class ChatPersistentMessageToClient extends SWGMessage {
|
||||
result.putLong(attachment.cellID);
|
||||
result.put(attachment.color);
|
||||
result.put((byte) (attachment.active ? 1 : 0));
|
||||
result.put((byte) 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +114,7 @@ public class ChatPersistentMessageToClient extends SWGMessage {
|
||||
|
||||
result.put(status);
|
||||
result.putInt(timestamp);
|
||||
result.putInt(0);
|
||||
//result.putInt(0);
|
||||
|
||||
int size = result.position();
|
||||
result = IoBuffer.allocate(size).put(result.array(), 0, size);
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ChatPersistentMessageToServer extends SWGMessage {
|
||||
waypoint.active = false;
|
||||
|
||||
waypointAttachments.add(waypoint);
|
||||
System.out.println(waypoint.name);
|
||||
//System.out.println(waypoint.name);
|
||||
if(appendByte > 0)
|
||||
buffer.get();
|
||||
|
||||
|
||||
@@ -200,27 +200,43 @@ public class ConnectionService implements INetworkDispatch {
|
||||
|
||||
CreatureObject object = (CreatureObject) client.getParent();
|
||||
|
||||
object.setInviteCounter(0);
|
||||
object.setInviteSenderId(0);
|
||||
object.setInviteSenderName("");
|
||||
|
||||
if(object.getAttachment("inspireDuration") != null)
|
||||
object.setAttachment("inspireDuration", null);
|
||||
|
||||
if(object.getPerformanceListenee() != null) {
|
||||
object.getPerformanceListenee().removeSpectator(object);
|
||||
object.setPerformanceListenee(null);
|
||||
try {
|
||||
object.setInviteCounter(0);
|
||||
object.setInviteSenderId(0);
|
||||
object.setInviteSenderName("");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(object.getPerformanceWatchee() != null) {
|
||||
object.getPerformanceWatchee().removeSpectator(object);
|
||||
object.setPerformanceWatchee(null);
|
||||
try {
|
||||
if(object.getAttachment("inspireDuration") != null)
|
||||
object.setAttachment("inspireDuration", null);
|
||||
|
||||
if(object.getPerformanceListenee() != null) {
|
||||
object.getPerformanceListenee().removeSpectator(object);
|
||||
object.setPerformanceListenee(null);
|
||||
}
|
||||
|
||||
if(object.getPerformanceWatchee() != null) {
|
||||
object.getPerformanceWatchee().removeSpectator(object);
|
||||
object.setPerformanceWatchee(null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
core.groupService.handleGroupDisband(object, false);
|
||||
try {
|
||||
core.groupService.handleGroupDisband(object, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (core.instanceService.isInInstance(object)) {
|
||||
core.instanceService.remove(core.instanceService.getActiveInstance(object), object);
|
||||
try {
|
||||
if (core.instanceService.isInInstance(object)) {
|
||||
core.instanceService.remove(core.instanceService.getActiveInstance(object), object);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
object.setClient(null);
|
||||
@@ -232,20 +248,27 @@ public class ConnectionService implements INetworkDispatch {
|
||||
|
||||
Point3D objectPos = object.getWorldPosition();
|
||||
|
||||
List<AbstractCollidable> collidables = core.simulationService.getCollidables(object.getPlanet(), objectPos.x, objectPos.z, 512);
|
||||
|
||||
collidables.forEach(c -> c.removeCollidedObject(object));
|
||||
try {
|
||||
List<AbstractCollidable> collidables = core.simulationService.getCollidables(object.getPlanet(), objectPos.x, objectPos.z, 512);
|
||||
|
||||
collidables.forEach(c -> c.removeCollidedObject(object));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (ghost != null) {
|
||||
String objectShortName = object.getCustomName();
|
||||
|
||||
if (object.getCustomName().contains(" ")) {
|
||||
String[] splitName = object.getCustomName().toLowerCase().split(" ");
|
||||
objectShortName = splitName[0];
|
||||
try {
|
||||
if (ghost != null) {
|
||||
String objectShortName = object.getCustomName();
|
||||
|
||||
if (object.getCustomName().contains(" ")) {
|
||||
String[] splitName = object.getCustomName().toLowerCase().split(" ");
|
||||
objectShortName = splitName[0];
|
||||
}
|
||||
|
||||
core.chatService.playerStatusChange(objectShortName, (byte) 0);
|
||||
}
|
||||
|
||||
core.chatService.playerStatusChange(objectShortName, (byte) 0);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long parentId = object.getParentId();
|
||||
@@ -268,8 +291,12 @@ public class ConnectionService implements INetworkDispatch {
|
||||
}
|
||||
}*/
|
||||
|
||||
if (core.getBountiesODB().contains(object.getObjectID())) {
|
||||
core.missionService.getBountyMap().remove(core.getBountiesODB().get(object.getObjectID()));
|
||||
try {
|
||||
if (core.getBountiesODB().contains(object.getObjectID())) {
|
||||
core.missionService.getBountyMap().remove(core.getBountiesODB().get(object.getObjectID()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ghost.toggleFlag(PlayerFlags.LD);
|
||||
@@ -278,16 +305,23 @@ public class ConnectionService implements INetworkDispatch {
|
||||
object.setPerformanceWatchee(null);
|
||||
object.setAttachment("disconnectTask", null);
|
||||
|
||||
List<ScheduledFuture<?>> schedulers = core.playerService.getSchedulers().get(object.getObjectID());
|
||||
if(schedulers != null) {
|
||||
schedulers.forEach(s -> s.cancel(true));
|
||||
schedulers.clear();
|
||||
try {
|
||||
List<ScheduledFuture<?>> schedulers = core.playerService.getSchedulers().get(object.getObjectID());
|
||||
if(schedulers != null) {
|
||||
schedulers.forEach(s -> s.cancel(true));
|
||||
schedulers.clear();
|
||||
}
|
||||
core.playerService.getSchedulers().remove(object.getObjectID());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
core.playerService.getSchedulers().remove(object.getObjectID());
|
||||
|
||||
core.getSWGObjectODB().put(object.getObjectID(), object);
|
||||
core.objectService.destroyObject(object);
|
||||
|
||||
try {
|
||||
core.getSWGObjectODB().put(object.getObjectID(), object);
|
||||
core.objectService.destroyObject(object);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -793,32 +793,46 @@ public class SimulationService implements INetworkDispatch {
|
||||
if(object.getAttachment("proposer") != null)
|
||||
object.setAttachment("proposer", null);
|
||||
|
||||
//session.suspendWrite();
|
||||
final long objectId = object.getObjectID();
|
||||
|
||||
if(!ghost.isSet(PlayerFlags.LD))
|
||||
ghost.toggleFlag(PlayerFlags.LD);
|
||||
|
||||
for (CreatureObject opponent : new ArrayList<CreatureObject>(object.getDuelList())) {
|
||||
if (opponent != null) {
|
||||
core.combatService.handleEndDuel(object, opponent, true);
|
||||
try {
|
||||
for (CreatureObject opponent : new ArrayList<CreatureObject>(object.getDuelList())) {
|
||||
if (opponent != null) {
|
||||
core.combatService.handleEndDuel(object, opponent, true);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (core.mountService.isMounted(object)) {
|
||||
core.mountService.dismount(object, (CreatureObject) container);
|
||||
}
|
||||
|
||||
core.mountService.storeAll(object);
|
||||
|
||||
List<Integer> joinedChannels = ghost.getJoinedChatChannels();
|
||||
for (Integer roomId : joinedChannels) {
|
||||
ChatRoom room = core.chatService.getChatRoom(roomId.intValue());
|
||||
try {
|
||||
if (core.mountService.isMounted(object)) {
|
||||
core.mountService.dismount(object, (CreatureObject) container);
|
||||
}
|
||||
|
||||
if (room != null) { core.chatService.leaveChatRoom(object, roomId.intValue(), false); }
|
||||
// work-around for any channels that may have been deleted, or only spawn on server startup, that were added to the joined channels
|
||||
else { ghost.removeChannel(roomId); }
|
||||
core.mountService.storeAll(object);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
for (Integer roomId : ghost.getJoinedChatChannels()) {
|
||||
ChatRoom room = core.chatService.getChatRoom(roomId.intValue());
|
||||
|
||||
if (room != null) {
|
||||
core.chatService.leaveChatRoom(object, roomId.intValue(), false);
|
||||
} else {
|
||||
// work-around for any channels that may have been deleted, or only spawn on server startup, that were added to the joined channels
|
||||
ghost.removeChannel(roomId);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/*
|
||||
object.createTransaction(core.getCreatureODB().getEnvironment());
|
||||
core.getCreatureODB().put(object, Long.class, CreatureObject.class, object.getTransaction());
|
||||
@@ -830,15 +844,40 @@ public class SimulationService implements INetworkDispatch {
|
||||
SWGObject object = core.objectService.getObject(objectId);
|
||||
|
||||
if (object.getAttachment("disconnectTask") != null) {
|
||||
//core.connectionService.disconnect(client);
|
||||
try {
|
||||
core.combatService.endCombat((CreatureObject) object);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
core.simulationService.remove(object, object.getPosition().x, object.getPosition().z, true);
|
||||
|
||||
/*
|
||||
try {
|
||||
Thread.sleep(900000)
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// If connectionService fails for some reason, this will call disconnect again after 15 mins.
|
||||
// This should never actually be needed though:
|
||||
|
||||
try {
|
||||
if (object != null && object.getAttachment("disconnectTask") != null && client != null) {
|
||||
core.connectionService.disconnect(client);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("ConnectionService:disconnect(): Error disconnecting client.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}, 120, TimeUnit.SECONDS);
|
||||
|
||||
core.removeClient(session);
|
||||
|
||||
object.setAttachment("disconnectTask", disconnectTask);
|
||||
core.combatService.endCombat(object); // temp fix for ending combat on disconnect
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -687,6 +687,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
try {
|
||||
DatatableVisitor visitor = ClientFileManager.loadFile("datatables/timer/template_command_mapping.iff", DatatableVisitor.class);
|
||||
|
||||
boolean foundTemplate = false;
|
||||
|
||||
for (int i = 0; i < visitor.getRowCount(); i++) {
|
||||
if (visitor.getObject(i, 0) != null && ((String) (visitor.getObject(i, 0))).equalsIgnoreCase(object.getTemplate())) {
|
||||
String commandName = (String) visitor.getObject(i, 1);
|
||||
@@ -709,12 +711,22 @@ public class ObjectService implements INetworkDispatch {
|
||||
return;
|
||||
}
|
||||
|
||||
creature.addCooldown(cooldownGroup, object.getIntAttribute("reuse_time"));
|
||||
creature.addCooldown(cooldownGroup, reuse_time);
|
||||
}
|
||||
|
||||
foundTemplate = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundTemplate && reuse_time > 0) {
|
||||
if (creature.hasCooldown(object.getTemplate())) {
|
||||
return;
|
||||
}
|
||||
|
||||
creature.addCooldown(object.getTemplate(), reuse_time);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user