21 lines
631 B
C#
21 lines
631 B
C#
using SVSim.BattleNode.Lifecycle;
|
|
using SVSim.BattleNode.Protocol;
|
|
|
|
namespace SVSim.BattleNode.Sessions.Dispatch.Handlers;
|
|
|
|
internal sealed class InitNetworkHandler : IFrameHandler
|
|
{
|
|
public IReadOnlyList<DispatchRoute> Handle(FrameDispatchContext ctx)
|
|
{
|
|
if (ctx.SenderPhase != BattleSessionPhase.AwaitingInitNetwork)
|
|
return Array.Empty<DispatchRoute>();
|
|
|
|
var routes = new List<DispatchRoute>
|
|
{
|
|
new(ctx.From, BattleFrames.BuildAck(NetworkBattleUri.InitNetwork), true),
|
|
};
|
|
ctx.SenderPhase = BattleSessionPhase.AwaitingInitBattle;
|
|
return routes;
|
|
}
|
|
}
|