internal static CustomLobby Join(Invitation invite) { var lobby = new CustomLobby(); Session.Current.CurrentLobby = lobby; var task = invite.Join(); task.ContinueWith(t => lobby.GotLobbyStatus(t.Result)); return lobby; }
internal static CustomLobby Join(Invitation invite) { var lobby = new CustomLobby(); Session.Current.CurrentLobby = lobby; var task = invite.Join(); task.ContinueWith(t => lobby.GotLobbyStatus(t.Result)); return(lobby); }
public static async Task<CustomLobby> CreateLobby(PracticeGameConfig config) { var lobby = new CustomLobby(); Session.Current.CurrentLobby = lobby; GameDTO game = await RiotServices.GameService.CreatePracticeGame(config); if (game?.Name == null) { throw new Exception("Invalid name"); } else { lobby.GotGameData(game); return lobby; } }
public static async Task <CustomLobby> CreateLobby(PracticeGameConfig config) { var lobby = new CustomLobby(); Session.Current.CurrentLobby = lobby; GameDTO game = await RiotServices.GameService.CreatePracticeGame(config); if (game?.Name == null) { throw new Exception("Invalid name"); } else { lobby.GotGameData(game); return(lobby); } }
public CustomLobbyPage(CustomLobby lobby) { InitializeComponent(); this.lobby = lobby; lobby.MemberJoined += Lobby_MemberJoined; lobby.MemberChangedTeam += Lobby_MemberChangedTeam; lobby.MemberLeft += Lobby_MemberLeft; lobby.LeftLobby += Lobby_LeftLobby; lobby.Loaded += Lobby_Loaded; lobby.GameStarted += Lobby_GameStarted; lobby.Updated += Lobby_GotGameDTO; lobby.CatchUp(); Session.Current.ChatManager.Status = ChatStatus.hostingPracticeGame; }
public Lobby Accept() { var metadata = JSONParser.ParseObject(invite.GameMetaData); if ((int)metadata["gameTypeConfigId"] == GameConfig.CapDraft.Key) { return(TBDLobby.Join(this, (int)metadata["queueId"])); } else { switch ((string)metadata["gameType"]) { case "PRACTICE_GAME": return(CustomLobby.Join(this)); case "NORMAL_GAME": return(QueueLobby.Join(this, (int)metadata["queueId"])); default: throw new Exception("Lobby type not found: " + invite.InviteType); } } }
internal virtual void Associate(CustomLobby teamSelect) { this.teamSelect = teamSelect; }
protected virtual void OnGameCancel(CustomLobby lobby) { GameCancelled?.Invoke(this, lobby); }
internal CustomLobbyMember(GameObserver observer, CustomLobby lobby) : base((BotParticipant)null, 2, lobby) { this.observer = observer; Team = 2; }
internal CustomLobbyMember(BotParticipant bot, int team, CustomLobby lobby) : base(bot, team, lobby) { }
internal CustomLobbyMember(PlayerParticipant player, int team, CustomLobby lobby) : base(player, team, lobby) { }
internal CustomLobbyMember(GameObserver observer, CustomLobby lobby) : base((BotParticipant) null, 2, lobby) { this.observer = observer; Team = 2; }