Documentation ¶
Overview ¶
Package logparse provides functionality for parsing TF2 console logs into known events and values.
It should be able to parse logs from servers using SupStats2 & MedicStats plugins. These are the same requirements as logs.tf, so you should be able to download and parse them without much trouble.
Index ¶
- Variables
- func NewPosFromString(s string, p *Pos) error
- func ParsePlayerClass(classStr string, class *PlayerClass) bool
- func ParseTeam(teamStr string, team *Team) bool
- func Unmarshal(input interface{}, output interface{}) error
- type BuiltObjectEvt
- type CVAREvt
- type CaptureBlockedEvt
- type CarryObjectEvt
- type ChangeClassEvt
- type ChargeDeployedEvt
- type ChargeEndedEvt
- type ChargeReadyEvt
- type ConnectedEvt
- type DamageEvt
- type DisconnectedEvt
- type DominationEvt
- type DropObjectEvt
- type EmptyEvt
- type EmptyUberEvt
- type EnteredEvt
- type FirstHealAfterSpawnEvt
- type HealedEvt
- type JoinedTeamEvt
- type KillAssistEvt
- type KilledEvt
- type KilledObjectEvt
- type LogStartEvt
- type LogStopEvt
- type LostUberAdvantageEvt
- type MedicDeathEvt
- type MedicDeathExEvt
- type Medigun
- type MsgType
- type PickupEvt
- type PickupItem
- type PlayerClass
- type PointCapturedEvt
- type Pos
- type RCONEvt
- type Results
- type RevengeEvt
- type SayEvt
- type SayTeamEvt
- type ShotFiredEvt
- type ShotHitEvt
- type SourcePlayer
- type SuicideEvt
- type TargetPlayer
- type Team
- type UnhandledMsgEvt
- type WGameOverEvt
- type WPausedEvt
- type WResumedEvt
- type WRoundLenEvt
- type WRoundOvertimeEvt
- type WRoundStartEvt
- type WRoundWinEvt
- type WTeamFinalScoreEvt
- type WTeamScoreEvt
- type Weapon
Constants ¶
This section is empty.
Variables ¶
View Source
var Weapons = map[PlayerClass][]Weapon{ Multi: { ConscientiousObjector, FryingPan, HamShank, NecroSmasher, Pistol, ReserveShooter, Telefrag, World, }, Scout: { Atomizer, Bat, ForceANature, PepPistol, PistolScout, Sandman, Scattergun, ShortStop, SodaPopper, WrapAssassin, }, Soldier: { Airstrike, Blackbox, CowMangler, DirectHit, DisciplinaryAction, EscapePlan, LibertyLauncher, MarketGardener, Original, ProjectileRocket, ShotgunSoldier, }, Pyro: { AiFlamethrower, Backburner, BackScratcher, DeflectPromode, DeflectRocket, Degreaser, Detonator, DragonsFury, DragonsFuryBonus, FlameThrower, FlareGun, HotHand, Maul, Phlog, Powerjack, Rainblower, ScorchShot, ShotgunPyro, Sledgehammer, }, Demo: { Bottle, Caber, DemoKatana, IronBomber, LockNLoad, LooseCannon, LooseCannonImpact, ProjectilePipe, ProjectilePipeRemote, Quickiebomb, ScottishResistance, }, Heavy: { BrassBeast, FamilyBusiness, Fists, FistsOfSteel, IronCurtain, LongHeatmaker, MiniGun, Natascha, Tomislav, WarriorsSpirit, }, Engineer: { FrontierJustice, Gunslinger, GunslingerCombo, GunslingerTaunt, Jag, MiniSentry, RescueRanger, Sentry1, Sentry2, Sentry3, ShotgunPrimary, WidowMaker, Wrangler, Wrench, }, Medic: { Amputator, Blutsauger, Bonesaw, Crossbow, ProtoSyringe, SyringeGun, TauntMedic, Ubersaw, }, Sniper: { AwperHand, BazaarBargain, Bushwacka, Club, Huntsman, Kukri, Machina, MachinaPen, ProRifle, ProSMG, ShootingStar, SMG, SniperRifle, SydneySleeper, TheClassic, }, Spy: { Ambassador, BigEarner, BlackRose, DiamondBack, Enforcer, EternalReward, Knife, Kunai, Letranger, Revolver, Sapper, SharpDresser, Spycicle, }, }
Functions ¶
func NewPosFromString ¶ added in v0.1.8
func ParsePlayerClass ¶ added in v0.1.8
func ParsePlayerClass(classStr string, class *PlayerClass) bool
Types ¶
type BuiltObjectEvt ¶
type BuiltObjectEvt CarryObjectEvt
type CaptureBlockedEvt ¶
type CaptureBlockedEvt struct { EmptyEvt SourcePlayer CP int `json:"cp"` CPName string `json:"cp_name"` Pos Pos `json:"pos"` }
type CarryObjectEvt ¶
type CarryObjectEvt struct { EmptyEvt SourcePlayer Object string `json:"object"` Pos Pos `json:"a_pos"` }
type ChangeClassEvt ¶
type ChangeClassEvt struct { EmptyEvt Class PlayerClass `json:"class"` }
type ChargeDeployedEvt ¶
type ChargeDeployedEvt struct { EmptyEvt SourcePlayer Medigun Medigun `json:"medigun"` }
type ChargeEndedEvt ¶
type ChargeEndedEvt struct { EmptyEvt SourcePlayer Duration float32 `json:"duration"` }
type ChargeReadyEvt ¶
type ChargeReadyEvt struct { EmptyEvt SourcePlayer }
type ConnectedEvt ¶
type ConnectedEvt struct { EmptyEvt SourcePlayer Address string `json:"address"` }
type DamageEvt ¶
type DamageEvt struct { EmptyEvt SourcePlayer TargetPlayer Damage int `json:"damage"` RealDamage int `json:"real_damage"` Weapon Weapon `json:"weapon"` Healing int `json:"healing,omitempty"` // On ubersaw }
type DisconnectedEvt ¶
type DisconnectedEvt struct { EmptyEvt SourcePlayer Reason string `json:"reason"` }
type DominationEvt ¶
type DominationEvt struct { EmptyEvt SourcePlayer `json:"source"` TargetPlayer `json:"target"` }
type DropObjectEvt ¶
type DropObjectEvt CarryObjectEvt
type EmptyUberEvt ¶
type EmptyUberEvt struct { EmptyEvt SourcePlayer }
type EnteredEvt ¶
type EnteredEvt EmptyEvt
type FirstHealAfterSpawnEvt ¶
type FirstHealAfterSpawnEvt struct { EmptyEvt SourcePlayer HealTime float32 `json:"time"` }
type HealedEvt ¶ added in v0.1.8
type HealedEvt struct { EmptyEvt SourcePlayer TargetPlayer Healing int `json:"healing,omitempty"` // On ubersaw }
type JoinedTeamEvt ¶
type JoinedTeamEvt struct { EmptyEvt SourcePlayer Team Team `json:"team"` }
type KillAssistEvt ¶
type KillAssistEvt struct { EmptyEvt SourcePlayer TargetPlayer ASPos Pos `json:"as_pos"` APos Pos `json:"a_pos"` VPos Pos `json:"v_pos"` }
type KilledEvt ¶ added in v0.1.8
type KilledEvt struct { EmptyEvt SourcePlayer TargetPlayer APos Pos `json:"attacker_position" mapstructure:"attacker_position"` VPos Pos `json:"victim_position" mapstructure:"victim_position"` Weapon Weapon `json:"weapon" mapstructure:"weapon"` CustomKill string `json:"custom_kill" mapstructure:"customkill"` }
type KilledObjectEvt ¶
type KilledObjectEvt struct { EmptyEvt SourcePlayer TargetPlayer Object string `json:"object"` Weapon Weapon `json:"weapon"` APos Pos `json:"a_pos"` }
type LogStartEvt ¶
type LogStopEvt ¶
type LogStopEvt EmptyEvt
LogStopEvt is the server shutting down the map and closing the log
type LostUberAdvantageEvt ¶
type LostUberAdvantageEvt struct { EmptyEvt SourcePlayer AdvTime int `json:"advtime"` }
type MedicDeathEvt ¶
type MedicDeathEvt struct { EmptyEvt SourcePlayer TargetPlayer Healing int `json:"healing"` Uber int `json:"uber"` }
type MedicDeathExEvt ¶
type MsgType ¶
type MsgType int
MsgType defines a known, parsable message type
const ( // UnhandledMsg is used for messages we are ignoring UnhandledMsg MsgType = 0 // UnknownMsg is for any unexpected message formats UnknownMsg MsgType = 1 Say MsgType = 10 SayTeam MsgType = 11 Killed MsgType = 12 KillAssist MsgType = 13 Suicide MsgType = 14 ShotFired MsgType = 15 ShotHit MsgType = 16 Damage MsgType = 17 Domination MsgType = 18 Revenge MsgType = 19 Pickup MsgType = 20 EmptyUber MsgType = 21 MedicDeath MsgType = 22 MedicDeathEx MsgType = 23 LostUberAdv MsgType = 24 ChargeReady MsgType = 25 ChargeDeployed MsgType = 26 ChargeEnded MsgType = 27 Healed MsgType = 28 Extinguished MsgType = 29 BuiltObject MsgType = 30 CarryObject MsgType = 31 KilledObject MsgType = 32 DetonatedObject MsgType = 33 DropObject MsgType = 34 FirstHealAfterSpawn MsgType = 35 CaptureBlocked MsgType = 36 PointCaptured MsgType = 48 JoinedTeam MsgType = 49 ChangeClass MsgType = 50 SpawnedAs MsgType = 51 WRoundOvertime MsgType = 100 WRoundStart MsgType = 101 WRoundWin MsgType = 102 WRoundLen MsgType = 103 WTeamScore MsgType = 104 WTeamFinalScore MsgType = 105 WGameOver MsgType = 106 WPaused MsgType = 107 WResumed MsgType = 108 LogStart MsgType = 1000 LogStop MsgType = 1001 CVAR MsgType = 1002 RCON MsgType = 1003 Connected MsgType = 1004 Disconnected MsgType = 1005 Validated MsgType = 1006 Entered MsgType = 1007 Any MsgType = 10000 )
type PickupEvt ¶
type PickupEvt struct { EmptyEvt SourcePlayer Item PickupItem }
type PickupItem ¶ added in v0.1.8
type PickupItem int
PickupItem is used for
const ( ItemHPSmall PickupItem = iota ItemHPMedium ItemHPLarge ItemAmmoSmall ItemAmmoMedium ItemAmmoLarge )
type PlayerClass ¶
type PlayerClass int
const ( Spectator PlayerClass = 0 Scout PlayerClass = 1 Soldier PlayerClass = 2 Pyro PlayerClass = 3 Demo PlayerClass = 4 Heavy PlayerClass = 5 Engineer PlayerClass = 6 Medic PlayerClass = 7 Sniper PlayerClass = 8 Spy PlayerClass = 9 Multi PlayerClass = 10 )
type PointCapturedEvt ¶
type RevengeEvt ¶
type RevengeEvt DominationEvt
type SayEvt ¶
type SayEvt struct { EmptyEvt SourcePlayer `json:"source"` Msg string `json:"msg"` }
type SayTeamEvt ¶
type SayTeamEvt SayEvt
type ShotFiredEvt ¶
type ShotFiredEvt struct { EmptyEvt SourcePlayer Weapon Weapon `json:"weapon"` }
type ShotHitEvt ¶
type ShotHitEvt struct { EmptyEvt SourcePlayer Weapon Weapon `json:"weapon"` }
type SourcePlayer ¶ added in v0.1.6
type SourcePlayer struct { Name string `json:"name"` PID int `json:"pid"` SID steamid.SID64 `json:"sid"` Team Team `json:"team"` }
SourcePlayer represents the player who initiated the event
type SuicideEvt ¶
type SuicideEvt struct { EmptyEvt SourcePlayer Pos Pos `json:"pos"` }
type TargetPlayer ¶
type TargetPlayer struct { Name2 string `json:"name2"` PID2 int `json:"pid2"` SID2 steamid.SID64 `json:"sid2"` Team2 Team `json:"team2"` }
TargetPlayer maps the common secondary player values name_2
type UnhandledMsgEvt ¶
type UnhandledMsgEvt EmptyEvt
type WGameOverEvt ¶
type WPausedEvt ¶
type WPausedEvt EmptyEvt
type WResumedEvt ¶
type WResumedEvt EmptyEvt
type WRoundLenEvt ¶
type WRoundOvertimeEvt ¶
type WRoundOvertimeEvt EmptyEvt
type WRoundStartEvt ¶
type WRoundStartEvt EmptyEvt
type WRoundWinEvt ¶
type WTeamFinalScoreEvt ¶
type WTeamScoreEvt ¶
type Weapon ¶
type Weapon int
const ( UnknownWeapon Weapon = iota AiFlamethrower Airstrike Ambassador Amputator Atomizer AwperHand Backburner BackScratcher Bat BazaarBargain BigEarner Blackbox BlackRose Blutsauger Bonesaw Bottle BrassBeast Bushwacka Caber Club ConscientiousObjector CowMangler Crossbow DeflectPromode DeflectRocket Degreaser DemoKatana Detonator DiamondBack DirectHit DisciplinaryAction DragonsFury DragonsFuryBonus Enforcer EscapePlan EternalReward FamilyBusiness Fists FistsOfSteel FlameThrower FlareGun ForceANature FrontierJustice FryingPan Gunslinger GunslingerCombo GunslingerTaunt HamShank HotHand Huntsman IronBomber IronCurtain Jag Knife Kukri Kunai Letranger LibertyLauncher LockNLoad LongHeatmaker LooseCannon LooseCannonImpact Machina MachinaPen MarketGardener Maul MiniGun MiniSentry Natascha NecroSmasher Original PepPistol Phlog Pistol PistolScout Powerjack ProjectilePipe ProjectilePipeRemote ProjectileRocket ProRifle ProSMG ProtoSyringe Quickiebomb Rainblower RescueRanger ReserveShooter Revolver Sandman Scattergun ScorchShot ScottishResistance Sentry1 Sentry2 Sentry3 SharpDresser ShootingStar ShortStop ShotgunPrimary ShotgunPyro ShotgunSoldier Sledgehammer SMG SniperRifle SodaPopper Spycicle SydneySleeper SyringeGun TauntMedic Telefrag TheClassic Tomislav Ubersaw WarriorsSpirit WidowMaker World Wrangler WrapAssassin Wrench Sapper )
func WeaponFromString ¶ added in v0.1.8
Click to show internal directories.
Click to hide internal directories.