<commit_before>/************************************************************************
  This file is part of Freekick.

  Freekick is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Freekick is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with Freekick.  If not, see <http://www.gnu.org/licenses/>.

  Copyright <NAME>, 2008
**************************************************************************/

#include <cstdlib>

#include <iostream>
#include <exception>

#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>

#include "addutil/Exception.h"

#include "freekick/match/server/ServerManager.h"
#include "Club.h"
#include "Player.h"
#include "Lineup.h"
#include "MatchStatus.h"

using namespace addutil;
using namespace freekick;

using namespace freekick::soccer;
using freekick::match::MatchStatus;
using freekick::match::server::ServerManager;

int main(int argc, char** argv)
{
    try
    {
        boost::shared_ptr<Club> club1(new Club("home club name"));
        boost::shared_ptr<Club> club2(new Club("away club name"));

        int idnum;
        for(idnum = 100; idnum < 120; idnum++)
        {
            int pos = idnum % 4;
            PlayerPosition ppos = IntToPlayerPosition(pos);
            boost::shared_ptr<Player> p(new Player("home player name", idnum % 20 + 1, idnum, ppos));
            club1->addPlayer(p, NotPlaying);
        }
        club1->setupStandardLineup();

        for(idnum = 200; idnum < 220; idnum++)
        {
            int pos = idnum % 4;
            PlayerPosition ppos = IntToPlayerPosition(pos);
            boost::shared_ptr<Player> p(new Player("away player name", idnum % 20 + 1, idnum, ppos));
            club2->addPlayer(p, NotPlaying);
        }
        club2->setupStandardLineup();

        boost::shared_ptr<Stadium> stadium(new Stadium(70.0f, 100.0f));

        boost::shared_ptr<MatchData> data(new MatchData(club1, club2, stadium));
        boost::shared_ptr<MatchStatus> status(new MatchStatus(data));

        std::cerr << "Starting Freekick server" << std::endl;
        ServerManager sm(32105, status, 
                         "Freekick C++ Server", 
                         "Welcome to the world's second Freekick server!\nHopefully you enjoy your stay.");
        sm.run();
    }
    catch (boost::exception& e)
    {
        addutil::output_boost_exception(e);<commit_msg>Server: matchdata will now be parsed from a file<commit_after>/************************************************************************
  This file is part of Freekick.

  Freekick is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Freekick is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with Freekick.  If not, see <http://www.gnu.org/licenses/>.

  Copyright <NAME>, 2008
**************************************************************************/

#include <cstdlib>

#include <iostream>
#include <exception>

#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>

#include "addutil/Exception.h"

#include "freekick/match/server/ServerManager.h"
#include "Club.h"
#include "Player.h"
#include "Lineup.h"
#include "MatchStatus.h"

using namespace addutil;
using namespace freekick;

using namespace freekick::soccer;
using freekick::match::MatchStatus;
using freekick::match::server::ServerManager;

int main(int argc, char** argv)
{
    try
    {
        if(argc == 1)
        {
            std::cerr << "No command line argument - please specify a matchdata file to load." << std::endl;
            exit(1);
        }
        boost::shared_ptr<MatchData> data(new MatchData(argv[1]));
        boost::shared_ptr<MatchStatus> status(new MatchStatus(data));

        std::cerr << "Starting Freekick server" << std::endl;
        ServerManager sm(32105, status, 
                         "Freekick C++ Server", 
                         "Welcome to the world's second Freekick server!\nHopefully you enjoy your stay.");
        sm.run();
    }
    catch (boost::exception& e)
    {
        addutil::output_boost_exception(e);
{'fraction_non_alphanumeric': 0.15703824247355574, 'fraction_numerical': 0.011798209926769731, 'mean_word_length': 3.3474801061007957, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7301113', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1330, 'n_words': 457}