示例#1
0
        private void OnLobbyUpdated(object sender, LobbyEventArgs args)
        {
            DinnergeddonServiceReference.Lobby updatedLobby  = args.Lobby;
            DinnergeddonServiceReference.Lobby lobbyToUpdate = _lobbies.Where(x => x.Id == updatedLobby.Id).FirstOrDefault();
            lobbyToUpdate.Players = updatedLobby.Players;
            lobbyToUpdate.Limit   = updatedLobby.Limit;
            Guid lid = lobbyToUpdate.Id;
            Guid uId = updatedLobby.Id;
            // _proxy.GetLobbyById(updatedLobby.Id);
            //if (!IsJoinedInTheLobby(customPrincipal.Identity.Id, lobbyToUpdate.Id))
            //{
            //    IsJoined = false;
            //    JoinedLobby = null;
            //}
            //OnPropertyChanged("Lobbies");
            bool isJoined = false;

            foreach (Account a in lobbyToUpdate.Players)
            {
                if (a.Id == customPrincipal.Identity.Id)
                {
                    isJoined    = true;
                    JoinedLobby = lobbyToUpdate;
                }
            }
            if (!isJoined)
            {
                if (!IsJoinedInALobby(customPrincipal.Identity.Id))
                {
                    IsJoined    = false;
                    JoinedLobby = null;
                }
            }
        }
        private void on_lobby_update(object sender, LobbyEventArgs e)
        {
            KulamiPeer peer = sender as KulamiPeer;

            if (peer == null)
            {
                return;
            }
            peer_update(peer);
        }
示例#3
0
 public static string getName(this EventArgs ev)
 {
     return(ev switch
     {
         GameStateEventArgs _ => "state",
         PlayerChangedEventArgs _ => "player",
         LobbyEventArgs _ => "lobby",
         AmongUsData _ => "refresh",
         EndPlayerStatsEventArgs _ => "endplayerstats",
         _ => "null"
     });
示例#4
0
 private void OnJoinedLobby(object sender, LobbyEventArgs e)
 {
     GameCodeBox.BeginInvoke(a => a.Text = e.LobbyCode);
     this.BeginInvoke(a =>
     {
         if (context.Settings.AlwaysCopyGameCode)
         {
             Clipboard.SetText(e.LobbyCode);
         }
     });
     MapBox.BeginInvoke(a => a.Text = e.Map.ToString());
 }
示例#5
0
 private void OnJoinedLobby(object sender, LobbyEventArgs e)
 {
     context.GameCode = e.LobbyCode;
     context.GameMap  = e.Map;
     this.BeginInvoke(a =>
     {
         if (context.Settings.AlwaysCopyGameCode)
         {
             Clipboard.SetText(e.LobbyCode);
         }
     });
 }
示例#6
0
        //private void OnLobbiesRecieved(object sender, IEnumerable<DinnergeddonServiceReference.Lobby> lobbies)
        //{
        //    Lobbies = new ObservableCollection<DinnergeddonServiceReference.Lobby>(lobbies);
        //}

        //private void OnLobbyRecieved(object sender, LobbyEventArgs args)
        //{
        //    JoinedLobby = args.Lobby;
        //    _currentLobby = args.Lobby;

        //}

        private void OnLobbyCreated(object sender, LobbyEventArgs args)
        {
            DinnergeddonServiceReference.Lobby createdLobby = args.Lobby;

            App.Current.Dispatcher.Invoke((Action) delegate
            {
                _lobbies.Add(createdLobby);
            });

            Lobbies = _lobbies;
            OnPropertyChanged("Lobbies");
        }
示例#7
0
        private void JoinedLobbyHandler(object sender, LobbyEventArgs e)
        {
            var embed = new EmbedBuilder()
                        .WithTitle("New Lobby Created")
                        .WithImageUrl("https://cdn.discordapp.com/avatars/770073344468713572/3b7966fccd41b4572839a49db914508b.png")
                        .WithFooter(footer => footer.Text = "AmongUs Moderator")
                        .WithColor(Color.Blue)
                        .WithCurrentTimestamp()
                        .AddField("Lobby Code", e.LobbyCode)
                        .AddField("Region", e.Region);

            channel.SendMessageAsync(embed: embed.Build());
        }
示例#8
0
 private static void OnJoinedLobby(object?sender, LobbyEventArgs e)
 {
     AmongUsCapture.Settings.conInterface.WriteModuleTextColored("Join", Color.DarkKhaki, $"Joined lobby: {e.LobbyCode}");
 }
 private void OnJoinedLobby(object sender, LobbyEventArgs e)
 {
     GameCodeBox.BeginInvoke(a => a.Text = e.LobbyCode);
 }
示例#10
0
 private static void OnJoinedLobby(object?sender, LobbyEventArgs e)
 {
     Logger.Debug("Joined lobby: {lobbyCode}", e.LobbyCode);
 }
        private void OnLobbyCreated(object sender, LobbyEventArgs args)
        {
            Lobby lobby = args.Lobby;

            Mediator.Notify("LobbyCreated", lobby.Id);
        }
 private void OnLobbyUpdated(object sender, LobbyEventArgs args)
 {
     _lobby        = args.Lobby;
     LobbyName     = _lobby.Name;
     JoinedPlayers = new ObservableCollection <Account>(_lobby.Players.ToList());
 }