mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-31 01:15:57 -04:00
Fixed disconnect bluffs deleting client objects
~experimental
This commit is contained in:
@@ -536,9 +536,17 @@ public class SimulationService implements INetworkDispatch {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Moved this to ConnectionService which will disconnect them
|
||||
* from the server if they don't send packets for 5 minutes or more
|
||||
* like on live.
|
||||
*
|
||||
* We had significant issues with client nulls due to us taking
|
||||
* client disconnect requests too seriously. It has a weird tendency
|
||||
* to bluff and send a disconnect packet when it's not disconnecting
|
||||
* and continues sending packets.
|
||||
*/
|
||||
public void handleDisconnect(IoSession session) {
|
||||
|
||||
Client client = core.getClient((Integer) session.getAttribute("connectionId"));
|
||||
|
||||
if(client == null)
|
||||
@@ -554,55 +562,9 @@ public class SimulationService implements INetworkDispatch {
|
||||
object.setClient(null);
|
||||
PlayerObject ghost = (PlayerObject) object.getSlottedObject("ghost");
|
||||
|
||||
if(object.getGroupId() != 0)
|
||||
core.groupService.handleGroupDisband(object);
|
||||
|
||||
Point3D objectPos = object.getWorldPosition();
|
||||
|
||||
List<AbstractCollidable> collidables = getCollidables(object.getPlanet(), objectPos.x, objectPos.z, 512);
|
||||
|
||||
for(AbstractCollidable collidable : collidables) {
|
||||
collidables.remove(object);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
session.suspendWrite();
|
||||
|
||||
boolean remove = remove(object, object.getPosition().x, object.getPosition().z);
|
||||
if(remove)
|
||||
System.out.println("Successful quadtree remove");
|
||||
|
||||
//if(object.getContainer() == null) {
|
||||
HashSet<Client> oldObservers = new HashSet<Client>(object.getObservers());
|
||||
for(Iterator<Client> it = oldObservers.iterator(); it.hasNext();) {
|
||||
Client observerClient = it.next();
|
||||
if(observerClient.getParent() != null && !(observerClient.getSession() == session)) {
|
||||
observerClient.getParent().makeUnaware(object);
|
||||
}
|
||||
}
|
||||
//} else {
|
||||
// object.getContainer().remove(object);
|
||||
//}
|
||||
|
||||
|
||||
object.createTransaction(core.getCreatureODB().getEnvironment());
|
||||
core.getCreatureODB().put(object, Long.class, CreatureObject.class, object.getTransaction());
|
||||
object.getTransaction().commitSync();
|
||||
core.objectService.destroyObject(object);
|
||||
|
||||
core.getActiveConnectionsMap().remove((Integer) session.getAttribute("connectionId"));
|
||||
|
||||
}
|
||||
|
||||
public void handleZoneIn(Client client) {
|
||||
|
||||
Reference in New Issue
Block a user