enter intro cutscene

This commit is contained in:
Naruse
2026-04-20 12:40:38 +08:00
parent 2826239284
commit 279da58dc1
81 changed files with 7279 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using System.Reflection;
namespace MikuSB.GameServer.Server.Packet;
public static class HandlerManager
{
public static Dictionary<int, Handler> handlers = [];
public static void Init()
{
var classes = Assembly.GetExecutingAssembly().GetTypes(); // Get all classes in the assembly
foreach (var cls in classes)
{
var attribute = (Opcode?)Attribute.GetCustomAttribute(cls, typeof(Opcode));
if (attribute != null) handlers.Add(attribute.CmdId, (Handler)Activator.CreateInstance(cls)!);
}
}
public static Handler? GetHandler(int cmdId)
{
try
{
return handlers[cmdId];
}
catch
{
return null;
}
}
}