@param PlayerContract $player

@throws RoundException
346164
public function playerChecks(PlayerContract $player)
    {
        $this->checkPlayerTryingToAct($player);

        if ($this->playerBetStack($player)->amount() !== $this->betStacks()->max()->amount()) {
            throw RoundException::cantCheckWithBetActive();
        }

        $this->actions()->push(new Action($player, Action::CHECK));
        $this->leftToAct = $this->leftToAct()->playerHasActioned($player, LeftToAct::ACTIONED);
    }
661130
public function onPlayerChat(Player $player, $text)
    {
        $text = trim($text);
        $nick = trim($player->getNickName());

        if ($player->getPlayerId() == 0) {
            return;
        }

        if ($player->getPlayerId() != 0 && substr($text, 0, 1) != "/") {
            $matches = [];

            if ($this->enabled || $this->adminGroups->isAdmin($player->getLogin())) {
                $matchFound = false;
                $matchLogin = [];

                //match urls and shorten them to fit in chat.
                if (preg_match_all('/(\$[l,h]\[?){0,1}(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6})\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)(\]?)/',
                    $text, $urls)) {
                    foreach ($urls[0] as $k => $url) {
                        if ($urls[1][$k] == '$l' || $urls[1][$k] == '$L') {
                            $url = str_replace(['$l', '$L'], '', $url);
                            $text = str_replace(['$l', '$L'], '', $text);

                            if (strlen($url) >= 33) {
                                $short = substr($url, 0, 30)."...";
                                $text = str_replace($url, '$l['.$url.']'.$short.'$l', $text);
                            } else {
                                $text = str_replace($url, '$l'.$url.'$l', $text);
                            }
                        } elseif ($urls[1][$k] == '$h' || $urls[1][$k] == '$H') {
                            $url = str_replace(['$h', '$H'], '', $url);
                            $text = str_replace(['$h', '$H'], '', $text);

                            if (strlen($url) >= 33) {
                                $short = substr($url, 0, 30)."...";
                                $text = str_replace($url, '$h['.$url.']'.$short.'$h', $text);
                            } else {
                                $text = str_replace($url, '$h'.$url.'$h', $text);
                            }
                        }

                    }

                }

                if (preg_match_all("/(\s|\G)(\@(?P<login>[\w-\._]+)[\s]{0,1})/", $text, $matches)) {
                    $group = [];

                    foreach ($matches['login'] as $login) {
                        foreach ($this->playerStorage->getOnline() as $player2) {
                            if ($player2->getLogin() == $login) {
                                $matchFound = true;
                                $matchLogin[$player2->getLogin()] = $player2->getLogin();
                            } else {
                                if (!in_array($player->getLogin(), $matchLogin)) {
                                    $group[$player2->getLogin()] = $player2->getLogin();
                                }
                            }
                        }
                    }

                    $diff = array_diff($group, $matchLogin);

                    if ($matchFound) {
                        $this->sendChat($player, $text, '$f90', $matchLogin);
                        $this->notifications->notice($text, [], "Chat Notification", 0, $matchLogin);
                        if (count($diff) > 0) {
                            $this->sendChat($player, $text, '$ff0', $group);
                        }
                        $this->console->writeln('$ff0['.$nick.'$ff0] '.$text);

                        return;
                    } else {
                        $this->sendChat($player, $text, '$ff0', null);
                        $this->console->writeln('$ff0['.$nick.'$ff0] '.$text);

                        return;
                    }
                } else {
                    $this->sendChat($player, $text, '$ff0', null);
                    $this->console->writeln('$ff0['.$nick.'$ff0] '.$text);
                }
            } else {
                $this->console->writeln('$333['.$nick.'$333] '.$text);
                $this->chatNotification->sendMessage('expansion_customchat.chat.disabledstate',
                    $player->getLogin());
            }
        }

    }
720895
public static void send(EntityPlayerMP player)
	{
		Packet packet = new Packet();
		MalisisCore.network.sendTo(packet, player);
	}
983741
public static function notRegistered(Client $player, Game $game, $message = null)
    {
        $defaultMessage = sprintf('%s is not registered to game: "%s"', $player, $game);
        $message = is_null($message) ? $defaultMessage : $message;

        return new static($message);
    }
959666
public function onPlayerConnect($login, $isSpectator = false, $dispatch = true)
    {
        try {
            $playerData = $this->playerStorage->getPlayerInfo($login);
        } catch (\Exception $e) {
            // TODO log that player disconnected very fast.
            return;
        }

        $this->playerStorage->onPlayerConnect($playerData);

        if ($dispatch) {
            $this->dispatch(__FUNCTION__, [$playerData]);
        }
    }
185195
public function saveAll($players)
    {
        $connection = Propel::getWriteConnection(PlayerTableMap::DATABASE_NAME);
        $connection->beginTransaction();

        foreach ($players as $record) {
            $this->save($record);
        }

        $connection->commit();
        PlayerTableMap::clearInstancePool();
    }
1059849
public function createPlayer(PlayerInfo $playerInfo, PlayerDetailedInfo $playerDetailedInfo)
    {
        $class = $this->class;
        $player = new $class();

        $player->merge($playerInfo);
        $player->merge($playerDetailedInfo);

        return $player;
    }
901464
public function playerRaises(PlayerContract $player, Chips $chips)
    {
        $this->checkPlayerTryingToAct($player);

        $highestChipBet = $this->highestBet();
        if ($chips->amount() < $highestChipBet->amount()) {
            throw RoundException::raiseNotHighEnough($chips, $highestChipBet);
        }

        $chipStackLeft = Chips::fromAmount($player->chipStack()->amount() - $chips->amount());
        if ($chipStackLeft->amount() === 0) {
            return $this->playerPushesAllIn($player, $chips);
        }

        $betAmount = Chips::fromAmount($highestChipBet->amount() + $chips->amount());

        $this->actions->push(new Action($player, Action::RAISE, ['chips' => $betAmount]));
        $this->placeChipBet($player, $betAmount);

        $action = $chipStackLeft->amount() === 0 ? LeftToAct::ALLIN : LeftToAct::AGGRESSIVELY_ACTIONED;
        $this->leftToAct = $this->leftToAct()->playerHasActioned($player, $action);
    }
1163001
public function onVoteNew(Player $player, $cmdName, $cmdValue)
    {
        if ($cmdValue instanceof Vote) {
            $this->updateVoteWidgetFactory->create($this->players);
            $this->voteWidgetFactory->create($this->players);
        } else {
            $this->voteService->startVote($player, $cmdName, ['value' => $cmdValue]);
        }
    }
146976
public function canFeedOpponent($player)
    {
        if (0 === $player) {
            for ($i = 0; $i < 6; $i++) {
                if ($this->grid[0]['seeds'][$i] > $i) {
                    return true;
                }
            }
        }

        if (1 === $player) {
            for ($i = 0; $i < 6; $i++) {
                if ($this->grid[1]['seeds'][$i] > (5 - $i)) {
                    return true;
                }
            }
        }

        return false;
    }
758646
public function dealTurn()
    {
        if ($this->dealer()->communityCards()->count() !== 3) {
            throw RoundException::turnHasBeenDealt();
        }
        if (($player = $this->whosTurnIsIt()) !== false) {
            throw RoundException::playerStillNeedsToAct($player);
        }

        $this->collectChipTotal();

        $seat = $this->table()->findSeat($this->playerWithSmallBlind());
        $this->resetPlayerList($seat);

        $this->dealer()->dealCommunityCards(1);
        $this->actions()->push(new Action($this->dealer(), Action::DEALT_TURN, [
            'communityCards' => $this->dealer()->communityCards()->only(3),
        ]));
    }
892972
def report_player(player)
      result = {}
      plugins.each {|each| result.merge!(each.report(player))}
      result
    end
630494
public function addPlayers()
    {
        if (func_num_args() < 1) {
            throw new RockPaperScissorsSpockLizardException('No player objects supplied to addPlayers()');
        }
        
        $count = 0;
        foreach (func_get_args() as $player) {
            
            $count++;
            // error if not Player objects
            if (!$player instanceof Player) {
                throw new RockPaperScissorsSpockLizardException('Parameter # ' . $count . ' is not an instance of Player()');
            }
            
            $this->addPlayer($player);
        }
        
        return $this;
    }
1088613
public function playerPushesAllIn(PlayerContract $player)
    {
        $this->checkPlayerTryingToAct($player);

        // got the players chipStack
        $chips = $player->chipStack();

        // gotta create a new chip obj here cause of PHPs /awesome/ objRef ability :D
        $this->actions()->push(new Action($player, Action::ALLIN, ['chips' => Chips::fromAmount($chips->amount())]));

        $this->placeChipBet($player, $chips);
        $this->leftToAct = $this->leftToAct()->playerHasActioned($player, LeftToAct::ALLIN);
    }
458819
public function equals(PlayerContract $object): bool
    {
        return static::class === get_class($object)
        && $this->id() === $object->id()
        && $this->name() === $object->name()
        && $this->wallet() === $object->wallet();
    }
207329
public function checkPlayer($player)
    {
        if (!in_array($player, array(self::PLAYER_0, self::PLAYER_1))) {
            throw new AwaleException('Invalid player value.');
        }

        return $this;
    }
289384
public function play($player, $move)
    {
        if (!$this->isPlayerTurn($player)) {
            throw new AwaleException('Not your turn.');
        }

        if (0 === $this->grid[$player]['seeds'][$move]) {
            throw new AwaleException('This container is empty.');
        }

        $this->checkMustFeedOpponentRule($player, $move);

        $this
            ->move($player, $move)
            ->setLastMove(array(
                'player' => $player,
                'move' => $move,
            ))
            ->changePlayerTurn()
        ;

        if (!$this->hasSeeds(1 - $this->currentPlayer) && !$this->canFeedOpponent($this->currentPlayer)) {
            $this->storeRemainingSeeds($this->currentPlayer);
        }

        return $this;
    }