Esempio n. 1
0
        private void onClick(object sender, EventArgs e)
        {
            if (Lobby.Status == LobbyStatus.PendingCreate)
            {
                return;
            }

            if (usePassword.Checked && gamePassword.Box.Text.Length == 0)
            {
                NotificationManager.ShowMessage("Enter a password before attempting to start the game...");
                return;
            }

            NotificationManager.ShowMessageMassive("Creating game...", 1600);
            Lobby.Status = LobbyStatus.PendingCreate;

            ClientSideMatch match = new ClientSideMatch(MatchTypes.Standard,
                                                        MatchScoringTypes.Score,
                                                        MatchTeamTypes.HeadToHead,
                                                        PlayModes.Osu,
                                                        gameName.Box.Text,
                                                        usePassword.Checked ? gamePassword.Box.Text : null,
                                                        (int)playerCount.SelectedObject,
                                                        BeatmapManager.Current.DisplayTitle,
                                                        BeatmapManager.Current.BeatmapChecksum,
                                                        BeatmapManager.Current.BeatmapId,
                                                        Mods.None,
                                                        GameBase.User.Id,
                                                        MultiSpecialModes.None,
                                                        Player.Seed);

            MatchSetup.Match = match;
            BanchoClient.SendRequest(RequestType.Osu_MatchCreate, match);
        }
Esempio n. 2
0
        public static void IncomingMatch(ClientSideMatch match)
        {
            if (MatchSetup.Match != null && MatchSetup.Match.matchId == match.matchId)
            {
                MatchSetup.IncomingMatch(match);
            }

            lock (Matches)
            {
                int found = Matches.FindIndex(m => m.matchInfo.matchId == match.matchId);
                if (found < 0)
                {
                    Matches.Add(new LobbyMatch(match));
                }
                else
                {
                    Matches[found].matchInfo = match;
                }
            }

            LobbyUpdatePending = true;
        }