Конфигурационный файл
This commit is contained in:
@@ -2,6 +2,7 @@ package com.rosetta.im;
|
||||
|
||||
import com.rosetta.im.client.ClientManager;
|
||||
import com.rosetta.im.client.OnlineManager;
|
||||
import com.rosetta.im.config.Configuration;
|
||||
import com.rosetta.im.event.EventManager;
|
||||
import com.rosetta.im.executors.Executor0Handshake;
|
||||
import com.rosetta.im.executors.Executor11Typeing;
|
||||
@@ -53,6 +54,7 @@ public class Boot {
|
||||
private ServerAdapter serverAdapter;
|
||||
private ClientManager clientManager;
|
||||
private OnlineManager onlineManager;
|
||||
private Configuration configuration;
|
||||
|
||||
public Boot() {
|
||||
this.packetManager = new PacketManager();
|
||||
@@ -65,6 +67,7 @@ public class Boot {
|
||||
30
|
||||
), packetManager, this.serverAdapter);
|
||||
this.clientManager = new ClientManager(server);
|
||||
this.configuration = new Configuration("server.yml");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,12 +107,19 @@ public class Boot {
|
||||
* @return Boot
|
||||
*/
|
||||
public Boot bootstrap() {
|
||||
this.server.start();
|
||||
this.registerAllPackets();
|
||||
this.registerAllExecutors();
|
||||
this.registerAllEvents();
|
||||
this.printBootMessage();
|
||||
return this;
|
||||
try{
|
||||
this.configuration.loadConfiguration();
|
||||
this.server.start();
|
||||
this.registerAllPackets();
|
||||
this.registerAllExecutors();
|
||||
this.registerAllEvents();
|
||||
this.printBootMessage();
|
||||
return this;
|
||||
}catch(Exception e){
|
||||
this.logger.error("Booting error, stack trace:");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void registerAllEvents() {
|
||||
|
||||
Reference in New Issue
Block a user