Documentation ¶
Overview ¶
Package events contains all events that can be sent out from demoinfocs.Parser.
Index ¶
- Constants
- type BombBeginDefuseEvent
- type BombBeginPlant
- type BombDefusedEvent
- type BombEvent
- type BombEventIf
- type BombExplodedEvent
- type BombPlantedEvent
- type BotTakenOverEvent
- type ChatMessageEvent
- type DataTablesParsedEvent
- type DecoyEndEvent
- type DecoyStartEvent
- type FinalRoundEvent
- type FireNadeEndEvent
- type FireNadeStartEvent
- type FlashExplodedEvent
- type FreezetimeEndedEvent
- type GenericGameEvent
- type HeExplodedEvent
- type HeaderParsedEvent
- type ItemDropEvent
- type ItemEquipEvent
- type ItemPickupEvent
- type LastRoundHalfEvent
- type MatchStartedEvent
- type NadeEvent
- type NadeEventIf
- type NadeProjectileBouncedEvent
- type NadeProjectileThrownEvent
- type ParserWarnEvent
- type PlayerBindEvent
- type PlayerDisconnectEvent
- type PlayerFlashedEvent
- type PlayerFootstepEvent
- type PlayerHurtEvent
- type PlayerJumpEvent
- type PlayerKilledEvent
- type PlayerTeamChangeEvent
- type RankUpdateEvent
- type RoundAnnounceMatchStartedEvent
- type RoundEndedEvent
- type RoundMVPEvent
- type RoundOfficialyEndedEvent
- type RoundStartedEvent
- type SayText2Event
- type SayTextEvent
- type SmokeEndEvent
- type SmokeStartEvent
- type StringTableCreatedEvent
- type TickDoneEvent
- type WeaponFiredEvent
- type WinPanelMatchEvent
Constants ¶
const ( BombsiteA bombsite = 'A' BombsiteB bombsite = 'B' )
Bombsite identifiers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BombBeginDefuseEvent ¶
BombBeginDefuseEvent signals the start of defusing.
type BombBeginPlant ¶
type BombBeginPlant struct {
BombEvent
}
BombBeginPlant signals the start of a plant.
type BombDefusedEvent ¶
type BombDefusedEvent struct {
BombEvent
}
BombDefusedEvent signals that the bomb has been defused.
type BombEvent ¶
BombEvent contains the common attributes of bomb events. Dont register handlers on this tho, you want BombEventIf for that.
type BombEventIf ¶
type BombEventIf interface {
// contains filtered or unexported methods
}
BombEventIf is the interface for all the bomb events. Like NadeEventIf for NadeEvents.
type BombExplodedEvent ¶
type BombExplodedEvent struct {
BombEvent
}
BombExplodedEvent signals that the bomb has exploded.
type BombPlantedEvent ¶
type BombPlantedEvent struct {
BombEvent
}
BombPlantedEvent signals that the bomb has been planted.
type BotTakenOverEvent ¶
BotTakenOverEvent signals that a player took over a bot.
type ChatMessageEvent ¶
ChatMessageEvent signals a player generated chat message. Since team chat is generally not recorded IsChatAll will probably always be false. See SayTextEvent for admin / console messages and SayText2Event for raw network package data.
type DataTablesParsedEvent ¶ added in v0.4.0
type DataTablesParsedEvent struct{}
DataTablesParsedEvent signals that the datatables were parsed. You can use the Parser.SendTableParser() after this event to register update notification on entities & properties. DataTablesParsedEvent is a beta feature, it may be replaced or changed without notice.
type DecoyEndEvent ¶
type DecoyEndEvent struct {
NadeEvent
}
DecoyEndEvent signals the end of a decoy.
type DecoyStartEvent ¶
type DecoyStartEvent struct {
NadeEvent
}
DecoyStartEvent signals the start of a decoy.
type FinalRoundEvent ¶
type FinalRoundEvent struct{}
FinalRoundEvent signals the 30th round, not raised if the match ends before that.
type FireNadeEndEvent ¶
type FireNadeEndEvent struct {
NadeEvent
}
FireNadeEndEvent signals the end of a molly/incendiary.
type FireNadeStartEvent ¶
type FireNadeStartEvent struct {
NadeEvent
}
FireNadeStartEvent signals the start of a molly/incendiary.
type FlashExplodedEvent ¶
type FlashExplodedEvent struct {
NadeEvent
}
FlashExplodedEvent signals the explosion of a Flash.
type FreezetimeEndedEvent ¶
type FreezetimeEndedEvent struct{}
FreezetimeEndedEvent signals that the freeze time is over.
type GenericGameEvent ¶ added in v0.5.0
type GenericGameEvent struct { Name string Data map[string]*msg.CSVCMsg_GameEventKeyT }
GenericGameEvent signals a otherwise unhandled event.
type HeExplodedEvent ¶
type HeExplodedEvent struct {
NadeEvent
}
HeExplodedEvent signals the explosion of a HE.
type HeaderParsedEvent ¶
type HeaderParsedEvent struct {
Header common.DemoHeader
}
HeaderParsedEvent signals that the header has been parsed. Deprecated, use Parser.Header() instead.
type ItemDropEvent ¶
ItemDropEvent signals an item was dropped.
type ItemEquipEvent ¶
ItemEquipEvent signals an item was equipped.
type ItemPickupEvent ¶
ItemPickupEvent signals an item was bought or picked up.
type LastRoundHalfEvent ¶
type LastRoundHalfEvent struct{}
LastRoundHalfEvent signals the last round of the first half.
type MatchStartedEvent ¶
type MatchStartedEvent struct{}
MatchStartedEvent signals that the match has started.
type NadeEvent ¶
type NadeEvent struct { NadeType common.EquipmentElement Position r3.Vector Thrower *common.Player NadeEntityID int }
NadeEvent contains the common attributes of nade events. Dont register handlers on this tho, you want NadeEventIf for that
type NadeEventIf ¶
type NadeEventIf interface {
Base() NadeEvent
}
NadeEventIf is the interface for all NadeEvents (except NadeProjectile* events). Used to catch the different events with the same handler.
type NadeProjectileBouncedEvent ¶ added in v0.5.4
type NadeProjectileBouncedEvent struct { Projectile *common.GrenadeProjectile BounceNr int }
NadeProjectileBouncedEvent signals that a nade has just bounced off a wall/floor/ceiling or object.
type NadeProjectileThrownEvent ¶ added in v0.5.4
type NadeProjectileThrownEvent struct {
Projectile *common.GrenadeProjectile
}
NadeProjectileThrownEvent signals that a nade has just been thrown. This is different from the WeaponFiredEvent because it's sent out when the projectile entity is created.
type ParserWarnEvent ¶ added in v0.5.0
type ParserWarnEvent struct {
Message string
}
ParserWarnEvent signals that a non-fatal problem occurred during parsing. This is a beta feature, it may be replaced or changed without notice.
type PlayerBindEvent ¶
PlayerBindEvent signals that a player has connected.
type PlayerDisconnectEvent ¶
PlayerDisconnectEvent signals that a player has disconnected.
type PlayerFlashedEvent ¶
PlayerFlashedEvent signals that a player was flashed.
type PlayerFootstepEvent ¶
PlayerFootstepEvent occurs when a player makes a footstep.
type PlayerHurtEvent ¶
type PlayerHurtEvent struct { Player *common.Player Attacker *common.Player Health int Armor int Weapon *common.Equipment WeaponString string // Wrong for CZ, M4A1-S etc. HealthDamage int ArmorDamage int HitGroup common.HitGroup }
PlayerHurtEvent signals that a player has been damaged.
type PlayerJumpEvent ¶
PlayerJumpEvent signals that a player has jumped.
type PlayerKilledEvent ¶
type PlayerKilledEvent struct { Weapon *common.Equipment Victim *common.Player Killer *common.Player Assister *common.Player PenetratedObjects int IsHeadshot bool }
PlayerKilledEvent signals that a player has been killed.
type PlayerTeamChangeEvent ¶
type PlayerTeamChangeEvent struct { Player *common.Player NewTeam common.Team OldTeam common.Team Silent bool IsBot bool }
PlayerTeamChangeEvent occurs when a player swaps teams.
type RankUpdateEvent ¶
type RankUpdateEvent struct { SteamID int64 RankOld int RankNew int WinCount int RankChange float32 }
RankUpdateEvent signals the new rank. Not sure if this only occurs if the rank changed.
type RoundAnnounceMatchStartedEvent ¶
type RoundAnnounceMatchStartedEvent struct{}
RoundAnnounceMatchStartedEvent signals that the announcement "Match Started" has been displayed.
type RoundEndedEvent ¶
type RoundEndedEvent struct { Message string Reason common.RoundEndReason Winner common.Team }
RoundEndedEvent signals that a round just finished. Attention: TeamState.Score() won't be up to date yet after this. Add +1 to the winner's score as a workaround.
type RoundMVPEvent ¶
type RoundMVPEvent struct { Player *common.Player Reason common.RoundMVPReason }
RoundMVPEvent signals the announcement of the last rounds MVP.
type RoundOfficialyEndedEvent ¶
type RoundOfficialyEndedEvent struct{}
RoundOfficialyEndedEvent signals that the round 'has officially ended', not exactly sure what that is tbh.
type RoundStartedEvent ¶
RoundStartedEvent signals that a new round has started.
type SayText2Event ¶
type SayText2Event struct { EntIdx int // Not sure what this is, doesn't seem to be the entity-ID MsgName string // The message type, e.g. Cstrike_Chat_All for global chat Params []string // The message's parameters, for Cstrike_Chat_All parameter 1 is the player and 2 the message for example IsChat bool // Not sure, from the net-message IsChatAll bool // Seems to always be false, team chat might not be recorded }
SayText2Event signals a chat message. It just contains the raw network message. For player chat messages, ChatMessageEvent may be more interesting. Team chat is generally not recorded so IsChatAll will probably always be false. See SayTextEvent for admin / console messages.
type SayTextEvent ¶
type SayTextEvent struct { EntIdx int // Not sure what this is, doesn't seem to be the entity-ID Text string IsChat bool // Not sure, from the net-message IsChatAll bool // Seems to always be false, team chat might not be recorded }
SayTextEvent signals a chat message. It contains the raw network message data for admin / console messages. EntIdx will probably always be 0 See ChatMessageEvent and SayText2Event for player chat messages.
type SmokeEndEvent ¶
type SmokeEndEvent struct {
NadeEvent
}
SmokeEndEvent signals the end of a smoke (fade). Not sure if this means it started to fade, completely faded or something in between.
type SmokeStartEvent ¶
type SmokeStartEvent struct {
NadeEvent
}
SmokeStartEvent signals the start of a smoke (pop).
type StringTableCreatedEvent ¶ added in v0.4.0
type StringTableCreatedEvent struct {
TableName string
}
StringTableCreatedEvent signals that a string table was created via net message. Can be useful for figuring out when player-info is available via Parser.GameState().[Playing]Participants(). E.g. after the table 'userinfo' has been created the player-data should be available after the next TickDoneEvent. The reason it's not immediately available is because we need to do some post-processing to prep that data after a tick has finished.
type WeaponFiredEvent ¶
WeaponFiredEvent signals that a weapon has been fired.
type WinPanelMatchEvent ¶
type WinPanelMatchEvent struct{}
WinPanelMatchEvent signals that the 'win panel' has been displayed. I guess that's the final scoreboard.