mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-10 09:22:49 +00:00
Code formatting
This commit is contained in:
@@ -114,8 +114,7 @@ public class ServiceManager {
|
||||
serviceClass.getSimpleName());
|
||||
stopDependencies(service);
|
||||
service.stop();
|
||||
logger.info("{0}: Service stopped!",
|
||||
serviceClass.getSimpleName());
|
||||
logger.info("{0}: Service stopped!", serviceClass.getSimpleName());
|
||||
} catch (ServiceStopException e) {
|
||||
logger.error("{0}: Error stopping service: {1}",
|
||||
serviceClass.getSimpleName(), e.getCause());
|
||||
@@ -163,8 +162,7 @@ public class ServiceManager {
|
||||
logger.debug("{0}: Restaring service...",
|
||||
serviceClass.getSimpleName());
|
||||
service.restart();
|
||||
logger.info("{0}: Service restarted!",
|
||||
serviceClass.getSimpleName());
|
||||
logger.info("{0}: Service restarted!", serviceClass.getSimpleName());
|
||||
return service;
|
||||
} catch (ServiceStartException e) {
|
||||
logger.error("{0}: Error starting service: {1}",
|
||||
|
||||
@@ -35,7 +35,8 @@ import com.l2jserver.service.ServiceStartException;
|
||||
import com.l2jserver.service.ServiceStopException;
|
||||
|
||||
/**
|
||||
* Simple cache that stores invocation results in a EhCache {@link Cache}.
|
||||
* Simple cache that stores invocation results in a EhCache
|
||||
* {@link net.sf.ehcache.Cache Cache}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
@@ -62,7 +63,7 @@ public class EhCacheService extends AbstractService implements CacheService {
|
||||
Preconditions.checkNotNull(interfaceType, "interfaceType");
|
||||
Preconditions.checkNotNull(instance, "instance");
|
||||
Preconditions.checkArgument(interfaceType.isInterface(),
|
||||
"interfaceType is not an interface");
|
||||
"interfaceType is not an interface");
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final T proxy = (T) Proxy.newProxyInstance(this.getClass()
|
||||
|
||||
@@ -252,7 +252,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
if (config == null) {
|
||||
for (final Class<?> parent : clazz.getInterfaces()) {
|
||||
prop = findProperties(parent);
|
||||
if(prop != null)
|
||||
if (prop != null)
|
||||
return prop;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -30,8 +30,8 @@ import com.l2jserver.service.Service;
|
||||
* The service does not directly provide much functionality most of its
|
||||
* operations are done trough an {@link DataAccessObject}. Each service
|
||||
* implementation provides an custom interface that is used to link
|
||||
* {@link DataAccessObject}-{@link DatabaseService Service}. See implementation specific
|
||||
* documentation for more information.
|
||||
* {@link DataAccessObject}-{@link DatabaseService Service}. See implementation
|
||||
* specific documentation for more information.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
|
||||
@@ -86,7 +86,7 @@ public interface JDBCDatabaseConfiguration extends DatabaseConfiguration {
|
||||
*/
|
||||
@ConfigurationPropertySetter(name = "jdbc.active.max")
|
||||
void setMaxActiveConnections(int password);
|
||||
|
||||
|
||||
/**
|
||||
* @return the maximum number of idle connections
|
||||
*/
|
||||
@@ -99,7 +99,7 @@ public interface JDBCDatabaseConfiguration extends DatabaseConfiguration {
|
||||
*/
|
||||
@ConfigurationPropertySetter(name = "jdbc.idle.max")
|
||||
void setMaxIdleConnections(int password);
|
||||
|
||||
|
||||
/**
|
||||
* @return the minimum number of idle connections
|
||||
*/
|
||||
|
||||
@@ -24,5 +24,5 @@ import com.l2jserver.service.Service;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface PvPService extends Service {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ public interface AdministratorService extends Service {
|
||||
* @param args
|
||||
* the arguments
|
||||
*/
|
||||
void command(Lineage2Client conn, L2Character character,
|
||||
String command, String... args);
|
||||
void command(Lineage2Client conn, L2Character character, String command,
|
||||
String... args);
|
||||
|
||||
/**
|
||||
* The base interface for Administrator commands
|
||||
|
||||
@@ -70,16 +70,16 @@ public class AIServiceImpl extends AbstractService implements AIService {
|
||||
|
||||
@Override
|
||||
protected void doStart() throws ServiceStartException {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void walk(Actor actor, Coordinate coordinate) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStop() throws ServiceStopException {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package com.l2jserver.service.game.character;
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CannotSetTargetServiceException extends
|
||||
CharacterServiceException {
|
||||
public class CannotSetTargetServiceException extends CharacterServiceException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -21,7 +21,6 @@ package com.l2jserver.service.game.character;
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class CharacterInJailServiceException extends
|
||||
CharacterServiceException {
|
||||
public class CharacterInJailServiceException extends CharacterServiceException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -185,8 +185,7 @@ public class CharacterServiceImpl extends AbstractService implements
|
||||
});
|
||||
|
||||
// register global chat listener
|
||||
chatService.getGlobalChannel().addMessageListener(
|
||||
globalChatListener);
|
||||
chatService.getGlobalChannel().addMessageListener(globalChatListener);
|
||||
chatService.getTradeChannel().addMessageListener(tradeChatListener);
|
||||
|
||||
// query client game guard -- if key is invalid, the connection will be
|
||||
|
||||
@@ -16,14 +16,11 @@
|
||||
*/
|
||||
package com.l2jserver.service.game.chat;
|
||||
|
||||
|
||||
/**
|
||||
* Exception thrown if the player trying to send a message is currently
|
||||
* banned.
|
||||
* Exception thrown if the player trying to send a message is currently banned.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class ChatBanActiveChatServiceException extends
|
||||
ChatServiceException {
|
||||
public class ChatBanActiveChatServiceException extends ChatServiceException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -327,10 +327,11 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.ALL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
throw new UnsupportedOperationException("Cannot dispose the Global Chat Channel");
|
||||
throw new UnsupportedOperationException(
|
||||
"Cannot dispose the Global Chat Channel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,10 +346,11 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.TRADE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
throw new UnsupportedOperationException("Cannot dispose the Trade Chat Channel");
|
||||
throw new UnsupportedOperationException(
|
||||
"Cannot dispose the Trade Chat Channel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,10 +365,11 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.ANNOUNCEMENT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
throw new UnsupportedOperationException("Cannot dispose the Announcement Chat Channel");
|
||||
throw new UnsupportedOperationException(
|
||||
"Cannot dispose the Announcement Chat Channel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +399,7 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.CLAN;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
clanChannels.remove(clanID);
|
||||
@@ -430,7 +433,7 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.ALL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -24,5 +24,5 @@ import com.l2jserver.service.Service;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface MapService extends Service {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -142,8 +142,7 @@ public class NPCServiceImpl extends AbstractService implements NPCService {
|
||||
Preconditions.checkNotNull(character, "character");
|
||||
Preconditions.checkNotNull(action, "action");
|
||||
|
||||
final Lineage2Client conn = networkService.discover(character
|
||||
.getID());
|
||||
final Lineage2Client conn = networkService.discover(character.getID());
|
||||
try {
|
||||
final NPCController controller = getController(npc);
|
||||
controller.action(npc, conn, character, new String[0]);
|
||||
@@ -160,8 +159,7 @@ public class NPCServiceImpl extends AbstractService implements NPCService {
|
||||
if (args == null)
|
||||
args = new String[0];
|
||||
|
||||
final Lineage2Client conn = networkService.discover(character
|
||||
.getID());
|
||||
final Lineage2Client conn = networkService.discover(character.getID());
|
||||
try {
|
||||
final NPCController controller = getController(npc);
|
||||
controller.action(npc, conn, character, args);
|
||||
|
||||
@@ -197,8 +197,9 @@ public class ClassFileManager extends
|
||||
* if something foes wrong
|
||||
*/
|
||||
@Override
|
||||
public synchronized Iterable<JavaFileObject> list(Location location, String packageName,
|
||||
Set<Kind> kinds, boolean recurse) throws IOException {
|
||||
public synchronized Iterable<JavaFileObject> list(Location location,
|
||||
String packageName, Set<Kind> kinds, boolean recurse)
|
||||
throws IOException {
|
||||
Iterable<JavaFileObject> objects = super.list(location, packageName,
|
||||
kinds, recurse);
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package com.l2jserver.service.game.spawn;
|
||||
|
||||
|
||||
/**
|
||||
* Exception thrown when the object is already spawned and registered in the
|
||||
* world
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package com.l2jserver.service.game.spawn;
|
||||
|
||||
|
||||
/**
|
||||
* Exception thrown when trying to unspawn an object that is not spawned
|
||||
*
|
||||
|
||||
@@ -135,14 +135,13 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService {
|
||||
Preconditions.checkNotNull(object, "object");
|
||||
Preconditions.checkArgument(time > 0, "time < 0");
|
||||
Preconditions.checkNotNull(unit, "unit");
|
||||
return threadService.async(time, unit,
|
||||
new Callable<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
spawn(object, point);
|
||||
return object;
|
||||
}
|
||||
});
|
||||
return threadService.async(time, unit, new Callable<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
spawn(object, point);
|
||||
return object;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -176,19 +175,18 @@ public class SpawnServiceImpl extends AbstractService implements SpawnService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends PositionableObject> AsyncFuture<T> unspawn(final T object, long time,
|
||||
TimeUnit unit) {
|
||||
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<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
unspawn(object);
|
||||
return object;
|
||||
}
|
||||
});
|
||||
return threadService.async(time, unit, new Callable<T>() {
|
||||
@Override
|
||||
public T call() throws Exception {
|
||||
unspawn(object);
|
||||
return object;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,10 +27,11 @@ import com.l2jserver.service.Service;
|
||||
|
||||
/**
|
||||
* Service that loads {@link L2Character}, {@link NPC}, {@link Item} and
|
||||
* {@link Skill} {@link Template templates}. The service on startup, loads from files or from the
|
||||
* database the data and parses them into <tt>com.l2jserver.model.template</tt>
|
||||
* classes. Once they are loaded, templates can be retrieved using any
|
||||
* {@link TemplateID} object created from a {@link TemplateIDProvider}.
|
||||
* {@link Skill} {@link Template templates}. The service on startup, loads from
|
||||
* files or from the database the data and parses them into
|
||||
* <tt>com.l2jserver.model.template</tt> classes. Once they are loaded,
|
||||
* templates can be retrieved using any {@link TemplateID} object created from a
|
||||
* {@link TemplateIDProvider}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,8 @@ import com.l2jserver.service.Service;
|
||||
* <li>Process incoming connections and filter them for blocked IPs (not yet
|
||||
* implemented);</li>
|
||||
* <li>Handshake with the client and enable Cryptography;</li>
|
||||
* <li>Read incoming packets, decrypt and parse them into a ClientPacket;</li>
|
||||
* <li>Read incoming packets, decrypt and parse them into a {@link ClientPacket}
|
||||
* ;</li>
|
||||
* <li>Write outgoing packets ServerPacket and encrypt them;</li>
|
||||
* <li>(optional) Validate GameGuard responses (see GameGuardService);</li>
|
||||
* </ul>
|
||||
|
||||
@@ -170,8 +170,8 @@ public class BroadcastServiceImpl extends AbstractService implements
|
||||
* @param point
|
||||
* the old point
|
||||
*/
|
||||
private void broadcastUpdate(Lineage2Client conn,
|
||||
L2Character character, Point3D point) {
|
||||
private void broadcastUpdate(Lineage2Client conn, L2Character character,
|
||||
Point3D point) {
|
||||
for (final WorldObject o : worldService
|
||||
.iterable(new KnownListUpdateFilter(character, point))) {
|
||||
broadcast(conn, o);
|
||||
|
||||
Reference in New Issue
Block a user