mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-09 17:02:53 +00:00
Renamed Lineage2Connection to Lineage2Client to better match its
purpose Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package com.l2jserver.service.game.spawn;
|
||||
|
||||
|
||||
/**
|
||||
* Exception thrown when the target spawn point is not found
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class SpawnPointNotFoundServiceException extends
|
||||
SpawnServiceException {
|
||||
public class SpawnPointNotFoundServiceException extends SpawnServiceException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public interface SpawnService extends Service {
|
||||
* the unit of <tt>time</tt>
|
||||
* @return an future that can be used to obtain spawn exceptions
|
||||
*/
|
||||
AsyncFuture<?> spawn(PositionableObject object, Point3D point, long time,
|
||||
<T extends PositionableObject> AsyncFuture<T> spawn(T object, Point3D point, long time,
|
||||
TimeUnit unit);
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public interface SpawnService extends Service {
|
||||
* the unit of <tt>time</tt>
|
||||
* @return an future that can be used to obtain spawn exceptions
|
||||
*/
|
||||
AsyncFuture<?> unspawn(PositionableObject object, long time, TimeUnit unit);
|
||||
<T extends PositionableObject> AsyncFuture<T> unspawn(T object, long time, TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Teleports the object to the given <tt>point</tt>.
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.inject.Inject;
|
||||
import com.l2jserver.game.net.Lineage2Connection;
|
||||
import com.l2jserver.game.net.Lineage2Client;
|
||||
import com.l2jserver.game.net.packet.server.SM_CHAR_INFO;
|
||||
import com.l2jserver.game.net.packet.server.SM_CHAR_INFO_EXTRA;
|
||||
import com.l2jserver.game.net.packet.server.SM_TELEPORT;
|
||||
@@ -130,15 +130,15 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncFuture<?> spawn(final PositionableObject object,
|
||||
public <T extends PositionableObject> AsyncFuture<T> spawn(final T object,
|
||||
final Point3D point, long time, TimeUnit unit) {
|
||||
Preconditions.checkNotNull(object, "object");
|
||||
Preconditions.checkArgument(time > 0, "time < 0");
|
||||
Preconditions.checkNotNull(unit, "unit");
|
||||
return threadService.async(time, unit,
|
||||
new Callable<PositionableObject>() {
|
||||
new Callable<T>() {
|
||||
@Override
|
||||
public PositionableObject call() throws Exception {
|
||||
public T call() throws Exception {
|
||||
spawn(object, point);
|
||||
return object;
|
||||
}
|
||||
@@ -176,15 +176,15 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncFuture<?> unspawn(final PositionableObject object, long time,
|
||||
public <T extends PositionableObject> AsyncFuture<T> unspawn(final T object, long time,
|
||||
TimeUnit unit) {
|
||||
Preconditions.checkNotNull(object, "object");
|
||||
Preconditions.checkArgument(time > 0, "time <= 0");
|
||||
Preconditions.checkNotNull(unit, "unit");
|
||||
return threadService.async(time, unit,
|
||||
new Callable<PositionableObject>() {
|
||||
new Callable<T>() {
|
||||
@Override
|
||||
public PositionableObject call() throws Exception {
|
||||
public T call() throws Exception {
|
||||
unspawn(object);
|
||||
return object;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService {
|
||||
if (((L2Character) player).isTeleporting())
|
||||
throw new CharacterAlreadyTeleportingServiceException();
|
||||
|
||||
final Lineage2Connection conn = networkService
|
||||
final Lineage2Client conn = networkService
|
||||
.discover((CharacterID) player.getID());
|
||||
if (conn == null)
|
||||
// TODO throw an exception here
|
||||
@@ -223,7 +223,7 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService {
|
||||
throws CharacterNotTeleportingServiceException {
|
||||
Preconditions.checkNotNull(character, "character");
|
||||
final CharacterID id = character.getID();
|
||||
final Lineage2Connection conn = networkService.discover(id);
|
||||
final Lineage2Client conn = networkService.discover(id);
|
||||
|
||||
if (!character.isTeleporting())
|
||||
throw new CharacterNotTeleportingServiceException();
|
||||
|
||||
Reference in New Issue
Block a user