Пример #1
0
        public static EndOfRound ReadEndOfRound(string line)
        {
            var match = EndOfRoundPattern.Match(line);

            if (!match.Success)
            {
                return(null);
            }
            var    reader                = new MatchReader(match);
            var    time                  = ReadDate(reader);
            string triggeringTeam        = reader.String();
            string sfuiNotice            = reader.String();
            int    counterTerroristScore = reader.Int();
            int    terroristScore        = reader.Int();
            var    output                = new EndOfRound
            {
                Time                  = time,
                TriggeringTeam        = triggeringTeam,
                SfuiNotice            = sfuiNotice,
                TerroristScore        = terroristScore,
                CounterTerroristScore = counterTerroristScore,
            };

            return(output);
        }
Пример #2
0
        public static Disconnect ReadDisconnect(string line)
        {
            var match = DisconnectPattern.Match(line);

            if (!match.Success)
            {
                return(null);
            }
            var    reader  = new MatchReader(match);
            var    time    = ReadDate(reader);
            string name    = reader.String();
            string steamId = reader.String();
            string team    = reader.String();
            string reason  = reader.String();
            var    output  = new Disconnect
            {
                Time   = time,
                Player = new PlayerIdentity(name, steamId),
                Team   = team,
                Reason = reason,
            };

            return(output);
        }
Пример #3
0
        public static Purchase ReadPurchase(string line)
        {
            var match = PurchasePattern.Match(line);

            if (!match.Success)
            {
                return(null);
            }
            var    reader  = new MatchReader(match);
            var    time    = ReadDate(reader);
            string name    = reader.String();
            string steamId = reader.String();
            string team    = reader.String();
            string item    = reader.String();
            var    output  = new Purchase
            {
                Time   = time,
                Player = new PlayerIdentity(name, steamId),
                Team   = team,
                Item   = item
            };

            return(output);
        }
Пример #4
0
        public static TeamSwitch ReadTeamSwitch(string line)
        {
            var match = TeamSwitchPattern.Match(line);

            if (!match.Success)
            {
                return(null);
            }
            var    reader       = new MatchReader(match);
            var    time         = ReadDate(reader);
            string name         = reader.String();
            string steamId      = reader.String();
            string previousTeam = reader.String();
            string currentTeam  = reader.String();
            var    output       = new TeamSwitch
            {
                Time         = time,
                Player       = new PlayerIdentity(name, steamId),
                PreviousTeam = previousTeam,
                CurrentTeam  = currentTeam,
            };

            return(output);
        }
Пример #5
0
        public static PlayerKill ReadPlayerKill(string line)
        {
            var match = KillPattern.Match(line);

            if (!match.Success)
            {
                return(null);
            }
            var    reader        = new MatchReader(match);
            var    time          = ReadDate(reader);
            string killerName    = reader.String();
            string killerSteamId = reader.String();
            string killerTeam    = reader.String();
            int    killerX       = reader.Int();
            int    killerY       = reader.Int();
            int    killerZ       = reader.Int();
            string victimName    = reader.String();
            string victimSteamId = reader.String();
            string victimTeam    = reader.String();
            int    victimX       = reader.Int();
            int    victimY       = reader.Int();
            int    victimZ       = reader.Int();
            string weapon        = reader.String();
            bool   headshot      = reader.String() != "";
            var    output        = new PlayerKill
            {
                Time           = time,
                Killer         = new PlayerIdentity(killerName, killerSteamId),
                KillerTeam     = killerTeam,
                KillerPosition = new Vector(killerX, killerY, killerZ),
                Victim         = new PlayerIdentity(victimName, victimSteamId),
                VictimTeam     = victimTeam,
                VictimPosition = new Vector(victimX, victimY, victimZ),
                Headshot       = headshot,
                Weapon         = weapon,
            };

            return(output);
        }