1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Implements TrueZipVFSService

This commit is contained in:
2011-12-27 12:58:09 -02:00
parent 3286488f6e
commit 998a93f9d2
11 changed files with 207 additions and 29 deletions

View File

@@ -27,7 +27,7 @@ import com.l2jserver.service.core.Log4JLoggingService;
import com.l2jserver.service.core.LoggingService;
import com.l2jserver.service.core.threading.ThreadService;
import com.l2jserver.service.core.threading.ThreadServiceImpl;
import com.l2jserver.service.core.vfs.Java7VFSService;
import com.l2jserver.service.core.vfs.TrueZipVFSService;
import com.l2jserver.service.core.vfs.VFSService;
import com.l2jserver.service.database.DatabaseService;
import com.l2jserver.service.database.GameServerOrientDatabaseService;
@@ -81,7 +81,7 @@ public class ServiceModule extends AbstractModule {
bind(ServiceManager.class).in(Scopes.SINGLETON);
bind(LoggingService.class).to(Log4JLoggingService.class).in(
Scopes.SINGLETON);
bind(VFSService.class).to(Java7VFSService.class).in(Scopes.SINGLETON);
bind(VFSService.class).to(TrueZipVFSService.class).in(Scopes.SINGLETON);
bind(ThreadService.class).to(ThreadServiceImpl.class).in(
Scopes.SINGLETON);
bind(ConfigurationService.class).to(XMLConfigurationService.class).in(

View File

@@ -17,7 +17,6 @@
package com.l2jserver.service.database;
import java.io.IOException;
import java.nio.file.Paths;
import com.google.inject.Inject;
import com.l2jserver.service.AbstractService.Depends;
@@ -25,6 +24,7 @@ import com.l2jserver.service.cache.CacheService;
import com.l2jserver.service.configuration.ConfigurationService;
import com.l2jserver.service.core.LoggingService;
import com.l2jserver.service.core.threading.ThreadService;
import com.l2jserver.service.core.vfs.VFSService;
import com.l2jserver.service.database.model.QActorSkill;
import com.l2jserver.service.database.model.QCharacter;
import com.l2jserver.service.database.model.QCharacterFriend;
@@ -64,6 +64,8 @@ import com.l2jserver.service.game.template.TemplateService;
ConfigurationService.class, TemplateService.class, ThreadService.class })
public class GameServerOrientDatabaseService extends
AbstractOrientDatabaseService implements DatabaseService {
private final VFSService vfsService;
/**
* @param configService
* the config service
@@ -77,8 +79,9 @@ public class GameServerOrientDatabaseService extends
@Inject
public GameServerOrientDatabaseService(ConfigurationService configService,
CacheService cacheService, ThreadService threadService,
DAOResolver daoResolver) {
final VFSService vfsService, DAOResolver daoResolver) {
super(configService, cacheService, threadService, daoResolver);
this.vfsService = vfsService;
}
@Override
@@ -92,7 +95,7 @@ public class GameServerOrientDatabaseService extends
updateSchema(QLogChat.logChat);
if (updateSchema(QNPC.npc)) {
try {
importData(Paths.get("data/static/npc.csv"), QNPC.npc);
importData(vfsService.resolve("data/static/npc.csv"), QNPC.npc);
} catch (IOException e) {
throw new DatabaseException(e);
}

View File

@@ -25,9 +25,21 @@ package com.l2jserver.util.calculator;
*/
public abstract class AbstractDoubleFunction<T extends CalculatorContext, V extends Enum<V>>
implements Function<T, V> {
/**
* The execution order
*/
private final int order;
/**
* The parameter type
*/
private final V type;
/**
* @param order
* the execution order
* @param type
* the parameter type
*/
public AbstractDoubleFunction(int order, V type) {
this.order = order;
this.type = type;