private void Game_ActivePlayerChanged(object sender, PlayerEventArgs e) { if (e.Player != null) { ActivatePlayer(e.Player); } }
private void AddPlayer(object sender, PlayerEventArgs eventArgs) { var team = sender as Team; team.AddPlayerLate(eventArgs.Player, Tournament.PlayerPairings); OnPropertyChanged("NonplayingPlayers"); }
private void Form1_Load(object sender, EventArgs e) { dgvSearchList.Columns[0].Width = dgvSearchList.Width - 150; ToolStripMenuItem tsmi = new ToolStripMenuItem("Play With..."); ArrayList alMediaPlayers = vdb.GetMediaPlayers(); foreach (String strMediaPlayer in alMediaPlayers) { PlayerEventArgs pea = new PlayerEventArgs(); pea.strPlayer = strMediaPlayer; EventHandler eh = new EventHandler(PlayWithEventhandler); //eh.Method. tsmi.DropDownItems.Add(strMediaPlayer, null, eh); } DataGridViewCellStyle style = new DataGridViewCellStyle(); style.Font = new Font(dgvSearchList.Font, FontStyle.Bold); dgvSearchList.Columns[1].DefaultCellStyle = style; dgvSearchList.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvSearchList.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvSearchList.ColumnHeadersDefaultCellStyle = style; cmsMenu.Items.Add(tsmi); //btnSearch_Click(sender,e); }
private void OnPlayerJoin(object o, PlayerEventArgs eventArgs) { Level level = eventArgs.Level; if (level == null) { throw new ArgumentNullException(nameof(eventArgs.Level)); } Player player = eventArgs.Player; if (player == null) { throw new ArgumentNullException(nameof(eventArgs.Player)); } int idx = 1; player.Inventory.Slots[idx++] = new ItemDiamondSword(); player.Inventory.Slots[idx++] = new ItemBread { Count = 20 }; player.SendPlayerInventory(); level.BroadcastMessage($"{ChatColors.Gold}[{ChatColors.Green}+{ChatColors.Gold}]{ChatFormatting.Reset} {player.Username}"); }
// Player subscriptions // ---------- private static void OnPlayerLoseHandler(PlayerEventArgs e) { if (e.Uuid != TableDealer._id) { // if a player exceeds blackjack value // move to next player PlayerTurnIndex++; // if its dealers turn, check if there are any players left to play against. // if not end the game directly if (PlayerTurnIndex == Players.Count && Players.Any(player => !player.Hand.hasExceeded()) && TableDealer.shouldDrawCard()) { // there more more players to win against, draw cards if needed hitForCurrentPlayer(); } else { endGame(); } } else { // dealer lost by exceeding endGame(); } }
/// <summary> /// Raises the <see cref="PickUp" /> event. /// </summary> /// <param name="e">An <see cref="PlayerEventArgs" /> that contains the event data. </param> public virtual void OnPickUp(PlayerEventArgs e) { if (PickUp != null) { PickUp(this, e); } }
internal static void OnStreamOut(int npcid, int forplayerid) { var fcnpc = Find(npcid); var args = new PlayerEventArgs(BasePlayer.Find(forplayerid)); fcnpc?.StreamedOut?.Invoke(fcnpc, args); }
void playerEvent_Handler(PlayerEventArgs e) { if (e.Event == PlayerEvent.EndOfStream) { Log.Debug("EndOfStream for : " + ServiceManager.PlaybackController.CurrentTrack.TrackTitle); hasTrackFinished = true; } if (e.Event == PlayerEvent.StartOfStream && current_track != ServiceManager.PlaybackController.CurrentTrack) { try { if (current_track != null) { StopTrack(current_track); } Log.Debug("TrackStarted: " + ServiceManager.PlaybackController.CurrentTrack.TrackTitle); Event ev = CreateZgEvent(ServiceManager.PlaybackController.CurrentTrack, Interpretation.Instance.EventInterpretation.AccessEvent); client.InsertEvents(new List <Event> () { ev }); current_track = ServiceManager.PlaybackController.CurrentTrack; // Set this as false only after the previous track finished and new track start event has been logged hasTrackFinished = false; } catch (Exception ex) { Log.Exception(ex); } } }
protected override void HandleUpdate(object sender, PlayerEventArgs e) { if (this.value != null) { this.value.text = e.HP.ToString(); } }
private void OnPlayerEvent(PlayerEventArgs args) { if (((PlayerEventStateChangeArgs)args).Current == PlayerState.Ready) { Actions["View.ShowEqualizerAction"].Sensitive = ServiceManager.PlayerEngine.SupportsEqualizer; } }
private void OnPlayerEvent(PlayerEventArgs args) { if (args.Event == PlayerEvent.StartOfStream) { LoadCurrentTrack(); } else if (args.Event == PlayerEvent.TrackInfoUpdated) { LoadCurrentTrack(true); } else if (args.Event == PlayerEvent.StateChange && (incoming_track != null || incoming_image != null)) { PlayerEventStateChangeArgs state = (PlayerEventStateChangeArgs)args; if (state.Current == PlayerState.Idle) { if (idle_timeout_id > 0) { GLib.Source.Remove(idle_timeout_id); } else { GLib.Timeout.Add(100, IdleTimeout); } } } }
private void OnLocalPlayerIsInitialized(object o, PlayerEventArgs eventArgs) { Thread.Sleep(1000); Player player = eventArgs.Player; Level level = eventArgs.Level; level.BroadcastMessage($"{ChatColors.Gold}[{ChatColors.Green}+{ChatColors.Gold}]{ChatFormatting.Reset} {player.Username} joined the server"); var joinSound = new AnvilUseSound(level.SpawnPoint.ToVector3()); joinSound.Spawn(level); //player.SendTitle(null, TitleType.Clear); player.SendTitle(null, TitleType.AnimationTimes, 6, 6, 20 * 7); // 7 seconds if (Context.Server.IsEdu) { player.SendTitle($"{ChatColors.White}This is a MiNET Education Edition server", TitleType.SubTitle); player.SendTitle($"{ChatColors.Gold}Welcome!", TitleType.Title); } else { player.SendTitle($"{ChatColors.White}This is gurun's MiNET test server", TitleType.SubTitle); player.SendTitle($"{ChatColors.Gold}Welcome {player.Username}!", TitleType.Title); } }
private void OnPlayerLeave(object o, PlayerEventArgs eventArgs) { Level level = eventArgs.Level; if (level == null) { throw new ArgumentNullException(nameof(eventArgs.Level)); } Player player = eventArgs.Player; if (player == null) { throw new ArgumentNullException(nameof(eventArgs.Player)); } Player trash; _players.TryRemove(player.Username, out trash); level.BroadcastMessage($"{ChatColors.Gold}[{ChatColors.Red}-{ChatColors.Gold}]{ChatFormatting.Reset} {player.Username} left the server"); var leaveSound = new AnvilBreakSound(level.SpawnPoint.ToVector3()); leaveSound.Spawn(level); }
private void PlayerFactory_PlayerCreated(object sender, PlayerEventArgs e) { var player = e.Player; player.PlayerJoin += Player_PlayerJoin; player.PlayerLeave += Player_PlayerLeave; }
public static void StandingInVomit(GameObject sender, PlayerEventArgs args) { if(E_StandingInVomit != null) { E_StandingInVomit(sender, args); } }
public static void InvokePlayerDismounted(PlayerEventArgs args) { if (PlayerDismounted != null) { PlayerDismounted(args); } }
private void OnPlayerEvent(PlayerEventArgs args) { if (Enabled) { SetCurrentTrackForActivePage(); } }
private void ServerAPI_PlayerData(object sender, PlayerEventArgs e) { switch (e.Activity) { case PlayerActivityEnum.Join: OnlinePlayers.Add(e.Name); break; case PlayerActivityEnum.Leave: if (OnlinePlayers.Contains(e.Name)) { OnlinePlayers.Remove(e.Name); } break; default: break; } this.Invoke(new Action(() => //Invokes the following action on the same thread as this form, not the thread that requested it!! { toolPlayerCount.Text = "Player Count = " + lstboxOnlinePlayers.Items.Count.ToString(); lstboxOnlinePlayers.DataSource = null; lstboxOnlinePlayers.DataSource = OnlinePlayers; })); }
private void Player_PlayerJoin(object sender, PlayerEventArgs e) { Player player = e.Player; string name = player.Username.ToLower(); String ip = player.EndPoint.Address.MapToIPv4().ToString(); String cid = player.ClientUuid.ToString(); player.Level.BlockBreak += OnBreak; player.Level.BlockPlace += OnPlace; Dictionary <string, string> map = mysql.get(name); if (!map.ContainsValue(name)) { player.SendMessage("[MyAuth]Please Register your account /register <passwd>"); prerg.Add(name, true); } else { var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(map["llogin"])).ToLocalTime(); player.SendMessage("[MyAuth] last login:"******"ip"].Equals(ip) & map["uuid"].Equals(cid)) { player.SendMessage("[MyAuth]Logined!"); lged.Add(name, true); } else { player.SendMessage("[MyAuth]Please Login to server /login <passwd>"); } } }
private static void onPlayerStayHandler(PlayerEventArgs e) { if (e.Uuid != TableDealer._id) { // if its a player that called for stay, // increment player turn index PlayerTurnIndex++; // check if index exceeds index of players. // if it does, it is the dealers turn to draw if (PlayerTurnIndex == Players.Count) { if (TableDealer.shouldDrawCard()) { hitForCurrentPlayer(); } else { TableDealer.emitOnPlayerStay(); } } } else { // dealer emit stay event // end the game endGame(); } }
private void TextBox_PlayerSelected(object sender, PlayerEventArgs e) { if (PlayerSelected != null) { PlayerSelected(sender, e); } }
private void OnEventChanged(PlayerEventArgs args) { Log.Debug("BansheeAwn - " + args.Event.ToString()); switch (args.Event) { //case PlayerEvent.EndOfStream: // UnsetIcon (); // break; //case PlayerEvent.StartOfStream: // SetIcon (); // break; case PlayerEvent.TrackInfoUpdated: SetIcon(); break; case PlayerEvent.StateChange: if (service != null) { if (service.CurrentState != PlayerState.Playing) { UnsetIcon(); } else { SetIcon(); } } break; default: break; } }
void OnPlayerCollectionChanged(object sender, PlayerEventArgs e) { this.Dispatcher.InvokeIfRequired(() => { BindingOperations.GetBindingExpression(characterComboBox, ListView.ItemsSourceProperty).UpdateTarget(); }, DispatcherPriority.DataBind); }
private void OnPlayerEvent(PlayerEventArgs args) { switch (args.Event) { case PlayerEvent.StartOfStream: case PlayerEvent.TrackInfoUpdated: current_track = ServiceManager.PlayerEngine.CurrentTrack; //check to see if there was an album change if (current_track != null && lastAlbum != current_track.AlbumTitle) { if (AlbumArtExists(current_track)) { SetWallpaper(albumWallpaper); } else { SetWallpaper(userWallpaper); } lastAlbum = current_track.AlbumTitle; } break; } }
private void OnPlayerEvent(PlayerEventArgs args) { if (ContactContainerSource.ShareCurrentlyPlayingSchema.Get()) { switch (args.Event) { case PlayerEvent.StartOfStream: AnnounceTrack(ServiceManager.PlayerEngine.CurrentTrack); break; case PlayerEvent.StateChange: PlayerEventStateChangeArgs state = args as PlayerEventStateChangeArgs; if (state != null) { switch (state.Current) { case PlayerState.Paused: announcer.Announce(String.Empty); break; case PlayerState.Playing: AnnounceTrack(ServiceManager.PlayerEngine.CurrentTrack); break; } } break; } } }
private void HandleStart() { // Fire start event if (OnGameStart != null) { GameBoardEventArgs gameBoardEventArgs = new GameBoardEventArgs(board, boardState); OnGameStart(this, gameBoardEventArgs); } if (boardState.CurrentPlayer == PieceType.Red) { // Red player is first gameState = GameState.RedToMove; } else { // Black player is first gameState = GameState.BlackToMove; } // Fire player event if (OnPlayerChanged != null) { if (boardState.CurrentPlayer == PieceType.Red) { PlayerEventArgs playerEventArgs = new PlayerEventArgs(board, boardState, redPlayer); OnPlayerChanged(this, playerEventArgs); } else { PlayerEventArgs playerEventArgs = new PlayerEventArgs(board, boardState, blackPlayer); OnPlayerChanged(this, playerEventArgs); } } }
protected override void HandleUpdate(object sender, PlayerEventArgs e) { if (this.value != null) { this.value.text = e.Name; } }
private void on_player_changed(object gameengine, PlayerEventArgs e) { humanTurn = e.Player is HumanPlayer; Dispatcher.Invoke(() => { updateValidMoves(e); switch (e.State.CurrentPlayer) { case PieceType.Red: HumanScoreLabel.Foreground = Brushes.Red; RobotScoreLabel.Foreground = Brushes.White; GradRed.Color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#FF02D9FB"); break; case PieceType.Black: HumanScoreLabel.Foreground = Brushes.White; RobotScoreLabel.Foreground = Brushes.Red; GradRed.Color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#FFFB0202"); break; } }); }
/// <summary> /// Dispatcher used to avoid threading exeptions /// </summary> private void _playerManager_StateChangeEvent(object sender, PlayerEventArgs e) { Dispatcher.BeginInvoke(() => { var button = ApplicationBar.Buttons[1] as ApplicationBarIconButton; if (button == null) { return; } switch (e.State) { case PlayerState.Stopped: { button.IconUri = new Uri("/Assets/AppBar/appbar.control.play.png", UriKind.Relative); button.Text = AppResources.AppBarPlay; } break; case PlayerState.Playing: { button.IconUri = new Uri("/Assets/AppBar/appbar.control.pause.png", UriKind.Relative); button.Text = AppResources.AppBarPause; } break; case PlayerState.Paused: { button.IconUri = new Uri("/Assets/AppBar/appbar.control.resume.png", UriKind.Relative); button.Text = AppResources.AppBarResume; } break; } }); }
private void OnPlayerEvent(PlayerEventArgs args) { switch (args.Event) { case PlayerEvent.StartOfStream: case PlayerEvent.TrackInfoUpdated: current_track = ServiceManager.PlayerEngine.CurrentTrack; ToggleRatingMenuSensitive(); ShowTrackNotification(); break; case PlayerEvent.StateChange: UpdateActions(); break; case PlayerEvent.EndOfStream: current_track = null; ToggleRatingMenuSensitive(); break; } if (notif_area != null) { notif_area.OnPlayerEvent(args); } }
private void OnPlayerJoin(object o, PlayerEventArgs eventArgs) { Level level = eventArgs.Level; if (level == null) { throw new ArgumentNullException(nameof(eventArgs.Level)); } Player player = eventArgs.Player; if (player == null) { throw new ArgumentNullException(nameof(eventArgs.Player)); } //int idx = 1; //player.Inventory.Slots[idx++] = ItemFactory.GetItem(new ItemIronShovel().Id); //player.Inventory.Slots[idx++] = ItemFactory.GetItem(new ItemIronAxe().Id); //player.Inventory.Slots[idx++] = new ItemBlock(new Sand(), 0) {Count = 64}; //player.Inventory.Slots[idx++] = new ItemFlintAndSteel() {Count = 1}; //player.Inventory.Slots[idx++] = new ItemBlock(new Torch(), 0) {Count = 64}; //player.Inventory.Slots[idx++] = new ItemBlock(new StoneBrick(), 0) {Count = 64}; //player.Inventory.Slots[idx++] = new ItemDiamondSword(); //player.Inventory.Slots[idx++] = new ItemBread {Count = 20}; // for (short i = 0; i < 16; i++) // { // player.Inventory.Slots[idx++] = new ItemBlock(new Glass(), i) { Count = 20 }; // } //player.SendPlayerInventory(); level.BroadcastMessage($"{ChatColors.Gold}[{ChatColors.Green}+{ChatColors.Gold}]{ChatFormatting.Reset} {player.Username}"); }
private void Game_OnPlayerLeave(object sender, PlayerEventArgs e) { if (Game.State != GameState.Lobby) return; if (e.Player.Type != (int)PlayerType.Observer) { Console.WriteLine("::::left-slot|" + e.Player.Type + "|" + e.Player.Name); } else { Console.WriteLine("::::spectator|" + Game.Observers.Count); } }
void doDeletePlayerEvent(object sender, PlayerEventArgs arg) { if (view == null) return; if (view.InvokeRequired) { view.Invoke( new PlayerStateChangerEventHandler(view.DeletePlayer), new object[] { sender, arg.ThisPlayer }); } else { view.DeletePlayer(sender, arg.ThisPlayer); } }
void GamePlay_LeftGame(object sender, PlayerEventArgs e) { // If the opponent leaves the game, back out of the game screen, since we will want // to choose another opponent. DiagnosticsHelper.SafeShow(String.Format("Player '{0}' has left the story",e.playerInfo.PlayerName)); // Opponent has left, so clear the opponent name _opponent = null; if (NavigationService.CanGoBack) NavigationService.GoBack(); }
private void _manager_GameEnded(object sender, PlayerEventArgs e) { if (e.Player == PlayerColor.None) MessageBox.Show(Localization.MainWindowStrings.MainWindow_GameEnded_Draw, Localization.MainWindowStrings.MainWindow_Draw, MessageBoxButton.OK, MessageBoxImage.Information); else MessageBox.Show(string.Format(Localization.MainWindowStrings.MainWIndow_GameEnded_Win, e.Player == PlayerColor.White ? Localization.MainWindowStrings.MainWindow_Player_White : Localization.MainWindowStrings.MainWindow_Player_Black), Localization.MainWindowStrings.MainWindow_Victory, MessageBoxButton.OK, MessageBoxImage.Information); }
void GamePlay_NewGameRequested(object sender, PlayerEventArgs e) { // Either player can tap "Play Again" which sends a message to setup a new game // We encapsualte the setting up of a new game here. SetupNextPage(); }
private void OnSwitchPhysicsGun(PlayerEventArgs e) { if (SwitchPhysicsGun != null) SwitchPhysicsGun(e); }
private void Game_RoundStarted(object sender, PlayerEventArgs e) { if (RoundStarted != null) { RoundStarted(this, e); } }
private void OnJump(PlayerEventArgs e) { if (Jump != null) Jump(e); }
private void OnShoot(PlayerEventArgs e) { if (Shoot != null) Shoot(e); }
public static void InvokePlayerDismounted( PlayerEventArgs args ) { if( PlayerDismounted != null ) PlayerDismounted(args); }
private void TurnChanged(object sender, PlayerEventArgs eventArgs) { Contract.Requires(CurrentState == State.WaitForHeroTurn); Contract.Requires(gameState.CurrentPlayer == 0 || Player.Instance.IsServer); Contract.Requires(playersRemainingTurn.Contains(eventArgs.PlayerId)); Contract.Ensures(CurrentState == State.Equip); gameState.CurrentPlayer = eventArgs.PlayerId; if (Player.Instance.IsServer) { eventManager.QueueEvent(EventType.ChatMessage, new ChatMessageEventArgs(Player.Instance.GetPlayerNick(eventArgs.PlayerId) + " has started his turn.")); } Player.Instance.HeroParty.Heroes[gameState.CurrentPlayer].UntapAll(); stateMachine.PlaceStates(State.HeroTurn, State.Equip, State.WaitForChooseAction, State.WaitForPerformAction); stateMachine.ChangeToNextState(); stateMachine.ChangeToNextState(); }
/*PlayerMoved been removed as event from changeset 5618 of BF3Rcon * * static void rconClient_PlayerMoved(object sender, PlayerMovedEventArgs e) { Log.Info("PlayerMoved - Player: " + e.Player.Name + " - New Team: " + e.NewTeam + " - New Squad: " + e.NewSquad + " - Old Team: " + e.OldTeam + " - Old Squad: " + e.OldSquad); }*/ static void rconClient_PlayerLeft(object sender, PlayerEventArgs e) { if (e.Player == null) { Log.Info("PlayerLeft - Player: n/a"); } else { Log.Info("PlayerLeft - Player: " + e.Player.Name); } }
static void rconClient_PlayerJoined(object sender, PlayerEventArgs e) { // If there is players on the server then heck for players every 5 seconds aTimer.Interval = 5000; Log.Info("PlayerJoined - Player: " + e.Player.Name); }
static void rconClient_PlayerSpawned(object sender, PlayerEventArgs e) { Log.Info("PlayerSpawned - Player: " + e.Player); }
protected abstract void HandleUpdate(object sender, PlayerEventArgs e);
private void Game_OnPlayerReady(object sender, PlayerEventArgs e) { Console.WriteLine("::::lock-slot|" + e.Player.Type + "|" + Game.IsReady[e.Player.Type]); }
private void Game_RoundStarted(object sender, PlayerEventArgs e) { ActivatePlayer(e.Player); }
private void OnPlayerLeave(object o, PlayerEventArgs eventArgs) { Level level = eventArgs.Level; if (level == null) throw new ArgumentNullException(nameof(eventArgs.Level)); Player player = eventArgs.Player; if (player == null) throw new ArgumentNullException(nameof(eventArgs.Player)); level.BroadcastMessage($"{ChatColors.Gold}[{ChatColors.Red}-{ChatColors.Gold}]{ChatFormatting.Reset} {player.Username}"); }
private void OnChangePhysicsGunSettings(PlayerEventArgs e) { if (ChangePhysicsGunSettings != null) ChangePhysicsGunSettings(e); }
private void _manager_PlayersSwapped(object sender, PlayerEventArgs e) { SetCurrentPlayerStatusText(e.Player); }
private void OnMove(PlayerEventArgs e) { if (Move != null) Move(e); }
private void OnCurrentTrackChanged(object sender, PlayerEventArgs e) { _nextVotes.Clear(); /*foreach (IPlayerServiceCallback a in InstanceContext.IncomingChannels.Where(x => x is IPlayerServiceCallback)) { a.OnCurrentTrackChanged(e.Track); }*/ }
private void OnStop(PlayerEventArgs e) { if (Stop != null) Stop(e); }
private void OnTrackStateChanged(object sender, PlayerEventArgs e) { /*foreach (IPlaylistServiceCallback a in InstanceContext.IncomingChannels.Where(x => x is IPlaylistServiceCallback)) { a.OnTrackStateChanged(e.Track); }*/ }
private void Game_ActivePlayerChanged(object sender, PlayerEventArgs e) { if (ActivePlayerChanged != null) { ActivePlayerChanged(this, e); } }
private void Player_CardsResorted(object sender, PlayerEventArgs e) { if (CardsResorted != null) { CardsResorted(this, e); } }
protected virtual void OnPlayerCreated(PlayerEventArgs e) { PlayerCreated?.Invoke(this, e); }