Connect all the players to the server.
ActionsPlayer with index 0 is always the goalie.
Connects a coach if there is one.
439675
public void connectAll() {
        for (int i = 0; i < size(); i++) {
            if (i == 0) {
                players[i].connect(true);
            } else if (i >= 1) {
                try {
                    players[i].connect(false);
                } catch (Exception ex) {
                    players[i].handleError(ex.getMessage());
                }
            }
            pause(500);
        }
        if (hasCoach) {
            try {
                coach.connect();
            } catch (Exception ex) {
                coach.handleError(ex.getMessage());
            }
            pause(500);
        }
    }
892972
def report_player(player)
      result = {}
      plugins.each {|each| result.merge!(each.report(player))}
      result
    end
280846
def participants(self):
        """"""
        ret = []
        for p in self.players:
            try:
                if     p.isComputer: ret.append(p)
                if not p.isObserver: ret.append(p) # could cause an exception if player isn't a PlayerPreGame
            except AttributeError: pass
        return ret
785502
public static List<Player> loadPlayers(List<String> playersFiles) throws PlayerException {
	log.info("[loadPlayers] Loading all players");
	List<Player> players = new ArrayList<>();
	if (playersFiles.size() < 1) {
	    log.warn("[loadPlayers] No players to load");
	}

	for (String singlePath : playersFiles) {
	    Player single = new Player(new File(singlePath));
	    players.add(single);
	}

	return players;
    }
222190
def _connect_remote(self, host, host_port, lan_ports, race, name, map_inst,
                      save_map, interface):
    """"""
    # Connect!
    logging.info("Connecting...")
    self._controllers = [remote_controller.RemoteController(host, host_port)]
    logging.info("Connected")

    if map_inst and save_map:
      run_config = run_configs.get()
      self._controllers[0].save_map(map_inst.path, map_inst.data(run_config))

    # Create the join request.
    join = sc_pb.RequestJoinGame(options=interface)
    join.race = race
    join.player_name = name
    join.shared_port = 0  # unused
    join.server_ports.game_port = lan_ports.pop(0)
    join.server_ports.base_port = lan_ports.pop(0)
    join.client_ports.add(
        game_port=lan_ports.pop(0), base_port=lan_ports.pop(0))

    logging.info("Joining game.")
    self._controllers[0].join_game(join)
    self._in_game = True
    logging.info("Game joined.")
116788
def _connect(self):
        
        server = self.servers.peek()
        try:
            self.connect(
                server.host, server.port, self._nickname,
                server.password, ircname=self._realname,
                **self.__connect_params)
        except irc.client.ServerConnectionError:
            pass
941401
def _set_players(self, _players):
        
        self._players = list()
        _players = list(_players)
        _players.sort(key=lambda p: p.seat)
        for p in _players:
            self._players.append(p)
761432
function GameMsgGenerator(gameServer) {
    this.session = gameServer.session;
    this.sender = gameServer.name;
    this.stage = null;
}
1135091
function onGetPlayers(pdata) {
    $(PLAYERS).empty();
    // display all players
    for (var p in pdata) {
        if (!pdata.hasOwnProperty(p)) {
            continue;
        }
        var turn = pdata[p].has_turn ? "has_turn" : "";
        $(PLAYERS).append("<dt class='" + turn + "'>" + esc(p) + "</dt>" +
                          "<dd>" + pdata[p].points + "</dd>");
    }

    var my_game = $.cookie("game");
    var my_player = $.cookie("player");
    if (my_player) {
        if (pdata[my_player] === undefined) {
            // I've got a player name, but we need to add it to the game
            $.post("/games/" + enc(my_game) + "/players", {name: my_player},
                   function() {getPlayers();});
        } else if (HAVETURN !== pdata[my_player].has_turn) {
            HAVETURN = pdata[my_player].has_turn;
            if (HAVETURN) {
                countdownTimer();
            } else {
                clearTimeout(COUNTDOWNTID);
            }
            drawTurnInfo(pdata);
        }
    }
}
274236
public function majRankPointGame()
    {
        $players = $this->findBy(array(), array('pointGame' => 'DESC'));

        Ranking::addObjectRank($players, 'rankPointGame', array('pointGame'));
        $this->getEntityManager()->flush();
    }
529778
function onUserPlayerChange(data){

            var player = gameData.player;

            //Check if data contains different values
            if (player.get("angle") !== data.angle.toPrecision(1) || player.get("isAccelerating") !== data.isAccelerating){
                var buffer = micro.toBinary(data, "PlayerUpdate");
                socket.send(buffer);

                //Allow for latency before setting these changes on the player
                setTimeout(function(){
                    player.set(data);
                }, latency);
            }
        }
1005025
function connectToServers() {
        var knownServers = signallingServerSelector.getServerSpecsInPriorityOrder();

        for (var i = 0; i < knownServers.length; i++) {
            var connectionsRemaining = signallingServerService.getPreferredNumberOfSockets() - Object.keys(connectedSockets).length;

            //
            // We have enough connections
            //
            if (connectionsRemaining === 0) {
                break;
            }

            //
            // Try to connect to a new server
            //
            var serverSpec = knownServers[i];
            if (!currentlyConnectedToServer(serverSpec)) {
                var socket;
                try {
                    socket = socketFactory.createSocket(serverSpec);
                    storeSocket(serverSpec, socket);
                    addListeners(socket, serverSpec);
                    loggingService.info("Attempting to connect to signalling server (" + serverSpec.signallingApiBase + ")");
                }
                catch (error) {
                    loggingService.error("Error connecting to socket " + serverSpec.signallingApiBase, error);
                }
            }
        }

        //
        // Store the new set of connected servers in session storage so we
        // can prefer them in the event of a reload
        //
        signallingServerSelector.setLastConnectedServers(getListOfCurrentSignallingApiBases());
    }
1149968
function addPlayer(userId, callbacks) {
        let player = factory.addPlayer();
        if(!player) return null;

        self._callbacks.set(player, callbacks);

        // If the game didn't have an owner, it does now
        // This should only happen when the game is first created
        // and the initial player is added
        if(!owner)
            owner = player;

        self._users[userId] = { id: userId, player };

        return player;
    }
1359632
def get_players(self, team):
        
        team_id = self.__get_team_id(team)
        self.logger.debug(f'Getting players of team {team_id}.')
        return self._request('teams', team_id, 'players')
583989
public void connect() {
        CommandFactory f = new CommandFactory();
        f.addTrainerInitCommand();
        initMessage = f.next();
        super.start();
        super.setName("Trainer");
    }
131070
async def handle_player_update(self, state: "node.PlayerState"):
        
        if state.position > self.position:
            self._is_playing = True
        self.position = state.position
21941
function handlePlayers(request, response, game, path) {
    var func, player, resp;
    if (!path.length) {
        // return info on the players collection

        if (request.method === "POST") {
            player = playerFromReq(request, response, game);
            if (player) {
                // end turn
                // TODO should this be under /players/<name>/?
                func = function (form) {
                    if (form && form.end_turn) {
                        switchPlayers(game, player);
                        respOk(response);
                    }
                };
            } else {
                // add player to a game
                func = function(form) {
                    if (form && form.name) {
                        addPlayerToGame(game, form.name);
                        var jar = new cookies(request, response);
                        jar.set("player", encodeURIComponent(form.name),
                                {httpOnly: false});
                        respOk(response, '', 'text/json');
                    }
                };
            }
            requestBody(request, func);
            return;
        } else if (request.method === 'DELETE') {
            // delete player from a game
            func = function(form) {
                if (form && form.name) {
                    player = game.players[form.name];
                    if (player === undefined) {
                        // huh? player is not in this game
                        response.writeHead(404, {'Content-Type': 'text/json'});
                        response.end();
                        return;
                    }
                    nextTurn(game, player);
                    game.returnPieces(player.pieces);
                    delete game.players[form.name];
                    if (Object.keys(game.players).length === 0) {
                        delete games[game.name];
                    }
                    respOk(response);
                }
            };
            requestBody(request, func);
            return;
        }  else {
            resp = JSON.stringify(game.players);
        }

    } else {
        // return info on a specific player
        player = game.players[path[0]];
        if (typeof player === 'undefined') {
            // player not found
            response.writeHead(404, {'Content-Type': 'text/json'});
            response.end();
            return;
        }

        if (path[1] === 'pieces') {
            resp = JSON.stringify(player.pieces);
        }
    }
    respOk(response, resp, 'text/json');
}