public void OnDialogConfirm(DialogConfirmEvent e, SingleNode <InviteToLobbyDialogComponent> dialog, [JoinAll] SingleNode <SelfUserComponent> user)
        {
            AcceptInviteEvent event3 = new AcceptInviteEvent {
                lobbyId  = dialog.component.lobbyId,
                engineId = dialog.component.engineId
            };
            ExitOtherLobbyAndAcceptInviteEvent eventInstance = new ExitOtherLobbyAndAcceptInviteEvent {
                AcceptInviteEvent = event3
            };

            base.NewEvent(eventInstance).Attach(user).Attach(dialog).Schedule();
        }
 public void ExitLobbyOrAcceptInvite(ExitOtherLobbyAndAcceptInviteEvent e, SingleNode <SelfUserComponent> user, [Combine] SingleNode <InviteToLobbyDialogComponent> dialog, [JoinAll] Optional <LobbyNode> lobby)
 {
     if (!lobby.IsPresent() || (lobby.Get().battleLobbyGroup.Key == e.AcceptInviteEvent.lobbyId))
     {
         base.ScheduleEvent(e.AcceptInviteEvent, user);
     }
     else
     {
         WaitingLobbyExitComponent component = new WaitingLobbyExitComponent {
             AcceptInviteEvent = e.AcceptInviteEvent
         };
         dialog.Entity.AddComponent(component);
         base.ScheduleEvent <ClientExitLobbyEvent>(lobby.Get());
     }
 }