mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-10 09:22:49 +00:00
@@ -255,6 +255,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
if(prop != null)
|
||||
return prop;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
prop = new Properties();
|
||||
final File file = new File(directory, config.value() + ".properties");
|
||||
|
||||
@@ -99,4 +99,10 @@ public interface ChatChannel {
|
||||
* @return the chat channel name
|
||||
*/
|
||||
String getChannelName();
|
||||
|
||||
/**
|
||||
* Disposes this channel. Channels should only be disposed by its creator if
|
||||
* there is no more interest in them.
|
||||
*/
|
||||
void dispose();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,8 @@ public interface ChatChannelListener {
|
||||
* @param channel
|
||||
* the chat channel
|
||||
* @param message
|
||||
* the message
|
||||
* the message object that was created by
|
||||
* {@link ChatLoggingService}
|
||||
*/
|
||||
void onMessage(ChatChannel channel, ChatMessage message);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.l2jserver.model.server.ChatMessage;
|
||||
import com.l2jserver.service.Service;
|
||||
|
||||
/**
|
||||
* This service logs each message sent in the server. Implementarions may choose
|
||||
* This service logs each message sent in the server. Implementations may choose
|
||||
* to store in a database, plain text, XML or any other form of logging.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
|
||||
@@ -24,12 +24,15 @@ import com.l2jserver.model.id.object.CharacterID;
|
||||
import com.l2jserver.model.id.object.provider.CharacterIDProvider;
|
||||
import com.l2jserver.model.server.ChatMessage;
|
||||
import com.l2jserver.service.AbstractService;
|
||||
import com.l2jserver.service.AbstractService.Depends;
|
||||
import com.l2jserver.service.database.DatabaseService;
|
||||
|
||||
/**
|
||||
* {@link ChatLoggingService} implementation that stores logs in the database
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
@Depends(DatabaseService.class)
|
||||
public class DatabaseChatLoggingService extends AbstractService implements
|
||||
ChatLoggingService {
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.l2jserver.model.server.ChatMessage;
|
||||
import com.l2jserver.model.world.Clan;
|
||||
import com.l2jserver.model.world.L2Character;
|
||||
import com.l2jserver.service.AbstractService;
|
||||
import com.l2jserver.service.AbstractService.Depends;
|
||||
import com.l2jserver.service.ServiceStartException;
|
||||
import com.l2jserver.service.ServiceStopException;
|
||||
import com.l2jserver.service.game.region.Region;
|
||||
@@ -39,7 +40,7 @@ import com.l2jserver.util.factory.CollectionFactory;
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
// @Depends(RegionService.class)
|
||||
@Depends(ChatLoggingService.class)
|
||||
public class SimpleChatService extends AbstractService implements ChatService {
|
||||
private final ChatLoggingService chatLoggingService;
|
||||
|
||||
@@ -308,6 +309,11 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.SHOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
privateChannels.remove(character);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,6 +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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -334,6 +345,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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +363,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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -359,7 +380,6 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
/**
|
||||
* The clan ID
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private final ClanID clanID;
|
||||
|
||||
/**
|
||||
@@ -376,6 +396,11 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.CLAN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
clanChannels.remove(clanID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -405,5 +430,10 @@ public class SimpleChatService extends AbstractService implements ChatService {
|
||||
public ChatMessageType getMessageType() {
|
||||
return ChatMessageType.ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ public class ScriptContextImpl implements ScriptContext {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptClassLoader getClassLoader() {
|
||||
public synchronized ScriptClassLoader getClassLoader() {
|
||||
return compilationResult.getClassLoader();
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ public class ClassFileManager extends
|
||||
* if something foes wrong
|
||||
*/
|
||||
@Override
|
||||
public Iterable<JavaFileObject> list(Location location, String packageName,
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user