public void AddPlayer(PokerPlayer player) { Mobile from = player.Mobile; if (from == null) { return; } if (from is PlayerMobile) { var playermob = from as PlayerMobile; if (playermob.PokerJoinTimer > DateTime.UtcNow) { TimeSpan nextuse = playermob.PokerJoinTimer - DateTime.UtcNow; from.SendMessage("You cannot join another poker game for " + nextuse.Seconds + " seconds."); return; } if (playermob.Aggressed.Any(info => (DateTime.UtcNow - info.LastCombatTime) < TimeSpan.FromSeconds(60))) { playermob.SendMessage("You cannot join poker while you are in combat!"); return; } if (playermob.Aggressors.Any(info => (DateTime.UtcNow - info.LastCombatTime) < TimeSpan.FromSeconds(60))) { playermob.SendMessage("You cannot join poker while you are in combat!"); return; } if (playermob.Party != null) { playermob.SendMessage("You cannot join a poker game while in a party."); return; } } if (!Dealer.InRange(from.Location, 8)) { from.PrivateOverheadMessage(MessageType.Regular, 0x22, true, "I am too far away to do that", from.NetState); } else if (GetIndexFor(from) != -1) { from.SendMessage(0x22, "You are already seated at this table"); } else if (Players.Count >= Dealer.MaxPlayers) { from.SendMessage(0x22, "Sorry, that table is full"); } else if (Banker.Withdraw(from, TypeOfCurrency, player.Currency)) { Point3D seat = Point3D.Zero; foreach (Point3D seats in Dealer.Seats.Where(seats => !Dealer.SeatTaken(seats))) { seat = seats; break; } if (seat == Point3D.Zero) { from.SendMessage(0x22, "Sorry, that table is full"); return; } player.Game = this; player.Seat = seat; player.TeleportToSeat(); Players.Players.Add(player); ((PlayerMobile)from).PokerGame = this; from.SendMessage(0x22, "You have been seated at the table"); if (Players.Count == 1 && !GameBackup.PokerGames.Contains(this)) { GameBackup.PokerGames.Add(this); } else if (State == PokerGameState.Inactive && Players.Count > 1 && !Dealer.TournamentMode) { Begin(); } else if (State == PokerGameState.Inactive && Players.Count >= Dealer.MaxPlayers && Dealer.TournamentMode) { Dealer.TournamentMode = false; Begin(); } player.CloseGump(typeof(PokerTableGump)); player.SendGump(new PokerTableGump(this, player)); NeedsGumpUpdate = true; player.Chat = true; player.Mobile.Blessed = true; } else { from.SendMessage(0x22, "Your bank box lacks the funds to join this poker table"); } }
public void AddPlayer(PokerPlayer player) { Mobile from = player.Mobile; if (from == null) { return; } if (from is PlayerMobile) { var playermob = from as PlayerMobile; if (playermob.PokerJoinTimer > DateTime.UtcNow) { TimeSpan nextuse = playermob.PokerJoinTimer - DateTime.UtcNow; from.SendMessage("You cannot join another poker game for " + nextuse.Seconds + " seconds."); return; } if (playermob.Aggressed.Any(info => (DateTime.UtcNow - info.LastCombatTime) < TimeSpan.FromSeconds(60))) { playermob.SendMessage("You cannot join poker while you are in combat!"); return; } if (playermob.Aggressors.Any(info => (DateTime.UtcNow - info.LastCombatTime) < TimeSpan.FromSeconds(60))) { playermob.SendMessage("You cannot join poker while you are in combat!"); return; } if (playermob.Party != null) { playermob.SendMessage("You cannot join a poker game while in a party."); return; } } if (!Dealer.InRange(from.Location, 8)) { from.PrivateOverheadMessage(MessageType.Regular, 0x22, true, "I am too far away to do that", from.NetState); } else if (GetIndexFor(from) != -1) { from.SendMessage(0x22, "You are already seated at this table"); } else if (Players.Count >= Dealer.MaxPlayers) { from.SendMessage(0x22, "Sorry, that table is full"); } else if (Banker.Withdraw(from, TypeOfCurrency, player.Currency)) { Point3D seat = Point3D.Zero; foreach (Point3D seats in Dealer.Seats.Where(seats => !Dealer.SeatTaken(seats))) { seat = seats; break; } if (seat == Point3D.Zero) { from.SendMessage(0x22, "Sorry, that table is full"); return; } player.Game = this; player.Seat = seat; player.TeleportToSeat(); Players.Players.Add(player); ((PlayerMobile) from).PokerGame = this; from.SendMessage(0x22, "You have been seated at the table"); if (Players.Count == 1 && !GameBackup.PokerGames.Contains(this)) { GameBackup.PokerGames.Add(this); } else if (State == PokerGameState.Inactive && Players.Count > 1 && !Dealer.TournamentMode) { Begin(); } else if (State == PokerGameState.Inactive && Players.Count >= Dealer.MaxPlayers && Dealer.TournamentMode) { Dealer.TournamentMode = false; Begin(); } player.CloseGump(typeof(PokerTableGump)); player.SendGump(new PokerTableGump(this, player)); NeedsGumpUpdate = true; player.Chat = true; player.Mobile.Blessed = true; } else { from.SendMessage(0x22, "Your bank box lacks the funds to join this poker table"); } }
public void AddPlayer( PokerPlayer player ) { Mobile from = player.Mobile; if ( from == null ) return; if ( !m_Dealer.InRange( from.Location, 8 ) ) from.PrivateOverheadMessage( Server.Network.MessageType.Regular, 0x22, true, "I am too far away to do that", from.NetState ); else if ( GetIndexFor( from ) != -1 ) from.SendMessage( 0x22, "You are already seated at this table" ); else if ( m_Players.Count >= m_Dealer.MaxPlayers ) from.SendMessage( 0x22, "Sorry, that table is full" ); /*else if ( TournamentSystem.TournamentCore.SignedUpTeam( from ) != null || TournamentSystem.TournamentCore.FindTeam( from ) != null ) from.SendMessage( 0x22, "You may not join a poker game while signed up for a tournament." );*/ else if ( Banker.Withdraw( from, player.Gold ) ) { Point3D seat = Point3D.Zero; foreach ( Point3D seats in m_Dealer.Seats ) if ( !m_Dealer.SeatTaken( seats ) ) { seat = seats; break; } if ( seat == Point3D.Zero ) { from.SendMessage( 0x22, "Sorry, that table is full" ); return; } player.Game = this; player.Seat = seat; player.TeleportToSeat(); m_Players.Players.Add( player ); ( (PlayerMobile)from ).PokerGame = this; from.SendMessage( 0x22, "You have been seated at the table" ); if ( m_Players.Count == 1 && !GameBackup.PokerGames.Contains( this ) ) GameBackup.PokerGames.Add( this ); else if ( m_State == PokerGameState.Inactive && m_Players.Count > 1 && !m_Dealer.TournamentMode ) Begin(); else if ( m_State == PokerGameState.Inactive && m_Players.Count >= m_Dealer.MaxPlayers && m_Dealer.TournamentMode ) { m_Dealer.TournamentMode = false; Begin(); } player.CloseGump( typeof( PokerTableGump ) ); player.SendGump( new PokerTableGump( this, player ) ); m_NeedsGumpUpdate = true; } else from.SendMessage( 0x22, "Your bank box lacks the funds to join this poker table" ); }
public void AddPlayer(PokerPlayer player) { Mobile from = player.Mobile; if (from == null) { return; } if (!m_Dealer.InRange(from.Location, 8)) { from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x22, true, "I am too far away to do that", from.NetState); } else if (GetIndexFor(from) != -1) { from.SendMessage(0x22, "You are already seated at this table"); } else if (m_Players.Count >= m_Dealer.MaxPlayers) { from.SendMessage(0x22, "Sorry, that table is full"); } /*else if ( TournamentSystem.TournamentCore.SignedUpTeam( from ) != null || TournamentSystem.TournamentCore.FindTeam( from ) != null ) * from.SendMessage( 0x22, "You may not join a poker game while signed up for a tournament." );*/ else if (Banker.Withdraw(from, player.Gold)) { Point3D seat = Point3D.Zero; foreach (Point3D seats in m_Dealer.Seats) { if (!m_Dealer.SeatTaken(seats)) { seat = seats; break; } } if (seat == Point3D.Zero) { from.SendMessage(0x22, "Sorry, that table is full"); return; } player.Game = this; player.Seat = seat; player.TeleportToSeat(); m_Players.Players.Add(player); ((PlayerMobile)from).PokerGame = this; from.SendMessage(0x22, "You have been seated at the table"); if (m_Players.Count == 1 && !GameBackup.PokerGames.Contains(this)) { GameBackup.PokerGames.Add(this); } else if (m_State == PokerGameState.Inactive && m_Players.Count > 1 && !m_Dealer.TournamentMode) { Begin(); } else if (m_State == PokerGameState.Inactive && m_Players.Count >= m_Dealer.MaxPlayers && m_Dealer.TournamentMode) { m_Dealer.TournamentMode = false; Begin(); } player.Mobile.CloseGump <PokerTableGump>(); player.SendGump(new PokerTableGump(this, player)); m_NeedsGumpUpdate = true; } else { from.SendMessage(0x22, "Your bank box lacks the funds to join this poker table"); } }