Example #1
0
        public NHLGame(int _gameId)
        {
            guid      = System.Guid.NewGuid();
            gameId    = _gameId;
            homeScore = 0;
            homeShots = 0;
            awayScore = 0;
            awayShots = 0;

            period = String.Empty;
            //intermission = false;
            final      = false;
            time       = String.Empty;
            shootout   = false;
            notStarted = true;
            overtime   = false;

            mutex  = new Object();
            thread = new Thread(new ParameterizedThreadStart(LoopThread));

            lastGoal         = null;
            originalLastGoal = null;
            newEvents        = new Queue <NHLGameEvent>();
            oldEvents        = new List <NHLGameEvent>();

            nhlGameStats   = null;
            nhlSeasonStats = null;

            goalDebug = false;
        }
Example #2
0
        //const string playerListPath = "http://debian3800/otto/nhl/jacked/playerlist.xml";


        public __NHLJacked(string _homeTeam, string _awayTeam, NHLStats _nhlStats)
        {
            homeTeamName = _homeTeam.ToLower();
            awayTeamName = _awayTeam.ToLower();
            stats        = new JackedStatsSet();
            thread       = new Thread(new ParameterizedThreadStart(LoopThread));
            gameId       = null;
            monitorStats = true;
            mutex        = new Object();
            nhlStats     = _nhlStats;
            arenaName    = null;

            thread.Start(this);
        }
Example #3
0
        //const string playerListPath = "http://debian3800/otto/nhl/jacked/playerlist.xml";


        public __NHLJacked(string _homeTeam, string _awayTeam, NHLStats _nhlStats)
        {
            homeTeamName = _homeTeam.ToLower();
            awayTeamName = _awayTeam.ToLower();
            stats = new JackedStatsSet();
            thread = new Thread(new ParameterizedThreadStart(LoopThread));
            gameId = null;
            monitorStats = true;
            mutex = new Object();
            nhlStats = _nhlStats;
            arenaName = null;

            thread.Start(this);
            
        }
Example #4
0
        //const string playerListPath = "http://debian3800/otto/nhl/jacked/playerlist.xml";

        public NHLGameStats(NHLStats _nhlStats, int _gameId, string _homeTeamName, string _awayTeamName, bool _playoffs)
        {
            stats = new JackedStatsSet();
            thread = new Thread(new ParameterizedThreadStart(LoopThread));
            gameId = _gameId;
            monitorStats = true;
            mutex = new Object();
            nhlStats = _nhlStats;
            homeTeamName = _homeTeamName;
            awayTeamName = _awayTeamName;
            playByPlay = new XmlDocument();
            playoffs = _playoffs;
            lastGoalEvent = null;

            thread.Start(this);            
        }
Example #5
0
 public void StartMonitoring(NHLStats _nhlStats)
 {
     nhlSeasonStats = _nhlStats;
     thread.Start(this);           
 }
Example #6
0
        public NHLGame(int _gameId)
        {
            guid = System.Guid.NewGuid();
            gameId = _gameId;
            homeScore = 0;
            homeShots = 0;
            awayScore = 0;
            awayShots = 0;

            period = String.Empty;
            //intermission = false;
            final = false;
            time = String.Empty;
            shootout = false;
            notStarted = true;
            overtime = false;

            mutex = new Object();
            thread = new Thread(new ParameterizedThreadStart(LoopThread));

            lastGoal = null;
            originalLastGoal = null;
            newEvents = new Queue<NHLGameEvent>();
            oldEvents = new List<NHLGameEvent>();

            nhlGameStats = null;
            nhlSeasonStats = null;

            goalDebug = false;
        }
Example #7
0
 public void StartMonitoring(NHLStats _nhlStats)
 {
     nhlSeasonStats = _nhlStats;
     thread.Start(this);
 }
Example #8
0
        public Program()
        {
            runningMutex = new Object();
            lockObj = new Object();

            mainThread = Thread.CurrentThread;

            games = new List<INHLGameInfo>();

            stats = new NHLStats();            

            lastUpdate = DateTime.MinValue;
            FetchGameList();

            stats.UpdateStatsIfRequired();

            irc = new IRC();

            ircThread = new Thread(new ParameterizedThreadStart(IRCThread));
            ircThread.Start(irc);         
        }
Example #9
0
        public int GetFakeLossesForTeam(long seasonId, int lastGames, NHLStats.TeamRecordFilterType filterType, string team)
        {
            DataTable table = new DataTable();
            SQLiteCommand command = new SQLiteCommand();
            command.Connection = connection;
            command.CommandText = string.Format(
                "SELECT Loser, EndType FROM schedule WHERE Season_ID = '{0}' AND (Winner = '{1}' OR LOSER = '{1}')", seasonId, team);

            if (filterType == NHLStats.TeamRecordFilterType.HOME)
                command.CommandText += string.Format(" AND HomeTeam = '{0}'", team);
            else if (filterType == NHLStats.TeamRecordFilterType.AWAY)
                command.CommandText += string.Format(" AND AwayTeam = '{0}'", team);

            command.CommandText += string.Format(" ORDER BY datetime(Date) DESC LIMIT {0}", lastGames);

            SQLiteDataAdapter adapter = new SQLiteDataAdapter(command);
            adapter.Fill(table);

            int fakeLosses = 0;
            foreach (DataRow row in table.Rows)
            {
                if ((string)row["Loser"] == team && ((string)row["EndType"] == "OT" || (string)row["EndType"] == "SO"))
                    fakeLosses++;
            }

            return fakeLosses;
        }