1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 09:22:49 +00:00

Several improvements

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-19 01:40:53 -03:00
parent 9bb83652e4
commit 2c4af6d91d
263 changed files with 2135 additions and 663 deletions

View File

@@ -16,6 +16,11 @@
*/
package com.l2jserver;
import com.google.inject.Injector;
import com.l2jserver.model.id.object.provider.NPCIDProvider;
import com.l2jserver.model.id.template.NPCTemplateID;
import com.l2jserver.model.id.template.provider.NPCTemplateIDProvider;
import com.l2jserver.model.world.NPC;
import com.l2jserver.service.ServiceManager;
import com.l2jserver.service.cache.CacheService;
import com.l2jserver.service.configuration.ConfigurationService;
@@ -23,8 +28,11 @@ import com.l2jserver.service.database.DatabaseService;
import com.l2jserver.service.game.chat.ChatService;
import com.l2jserver.service.game.scripting.ScriptingService;
import com.l2jserver.service.game.template.TemplateService;
import com.l2jserver.service.game.world.WorldService;
import com.l2jserver.service.game.world.id.WorldIDService;
import com.l2jserver.service.network.NetworkService;
import com.l2jserver.service.network.keygen.BlowfishKeygenService;
import com.l2jserver.util.dimensional.Point;
public class L2JGameServerMain {
/**
@@ -40,6 +48,7 @@ public class L2JGameServerMain {
serviceManager.start(CacheService.class);
serviceManager.start(ConfigurationService.class);
serviceManager.start(DatabaseService.class);
serviceManager.start(WorldIDService.class);
serviceManager.start(ScriptingService.class);
serviceManager.start(TemplateService.class);
@@ -48,12 +57,33 @@ public class L2JGameServerMain {
serviceManager.start(BlowfishKeygenService.class);
serviceManager.start(NetworkService.class);
staticSpawn(server.getInjector());
} catch (Exception e) {
System.out.println("GameServer could not be started!");
e.printStackTrace();
}
Thread.sleep(60 * 60 * 1000);
// Thread.sleep(60 * 60 * 1000);
}
/**
* This method does an static spawn for an object
*/
private static void staticSpawn(Injector injector) {
final NPCTemplateIDProvider templateProvider = injector
.getInstance(NPCTemplateIDProvider.class);
final NPCIDProvider provider = injector
.getInstance(NPCIDProvider.class);
final WorldService world = injector.getInstance(WorldService.class);
final NPCTemplateID id = templateProvider.createID(12077);
final NPC npc = id.getTemplate().create();
npc.setID(provider.createID());
// close to char spawn
npc.setPoint(Point.fromXYZ(-71301, 258259, -3134));
world.add(npc);
}
}