Инициализация протокола Rosetta

This commit is contained in:
RoyceDa
2026-02-02 02:08:53 +02:00
parent 782a5b1c9b
commit c1b4ca5db7
17 changed files with 421 additions and 26 deletions

View File

@@ -0,0 +1,42 @@
package com.rosetta.im;
import com.rosetta.im.executors.Executor0Handshake;
import com.rosetta.im.packet.Packet0Handshake;
import com.rosetta.im.protocol.packet.PacketManager;
public class Boot {
private PacketManager packetManager;
public Boot(PacketManager packetManager) {
this.packetManager = packetManager;
}
public PacketManager getPacketManager() {
return this.packetManager;
}
/**
* Инициализация всех пакетов и их обработчиков
*/
public void bootstrap() {
this.registerAllPackets();
this.registerAllExecutors();
this.printBootMessage();
}
private void registerAllPackets() {
this.packetManager.registerPacket(0, Packet0Handshake.class);
}
private void registerAllExecutors() {
this.packetManager.registerExecutor(0, Executor0Handshake.class);
}
private void printBootMessage() {
System.out.println("Bootstrapping completed. All packets and executors are registered.");
System.out.println("Total packets registered: " + this.packetManager.totalPackets());
System.out.println("Total executors registered: " + this.packetManager.totalExecutors());
}
}