Конфигурационный файл

This commit is contained in:
RoyceDa
2026-02-10 07:34:13 +02:00
parent b671262aa2
commit f8be7f5c65
9 changed files with 163 additions and 15 deletions

View File

@@ -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() {