Documentation
¶
Overview ¶
Package events contains all events that can be sent out from demoinfocs.Parser.
Events are generally named in the tense that fits the best for each event. E.g. SmokeExpired is in the past tense because it's sent out when the smoke has completely faded away while SmokeStart is in the present tense because it's sent out when the smoke starts to bloom.
Index ¶
- Constants
- type AnnouncementFinalRound
- type AnnouncementLastRoundHalf
- type AnnouncementMatchStarted
- type AnnouncementWinPanelMatch
- type BombDefuseStart
- type BombDefused
- type BombDropped
- type BombEvent
- type BombEventIf
- type BombExplode
- type BombPickup
- type BombPlantBegin
- type BombPlanted
- type BotTakenOver
- type ChatMessage
- type DataTablesParsed
- type DecoyExpire
- type DecoyStart
- type FireGrenadeExpired
- type FireGrenadeStart
- type FlashExplode
- type Footstep
- type GenericGameEvent
- type GrenadeEvent
- type GrenadeEventIf
- type GrenadeProjectileBounce
- type GrenadeProjectileDestroy
- type GrenadeProjectileThrow
- type HeExplode
- type HitGroup
- type InfernoExpired
- type InfernoStart
- type ItemDrop
- type ItemEquip
- type ItemPickup
- type Kill
- type MatchStart
- type ParserWarn
- type PlayerConnect
- type PlayerDisconnected
- type PlayerFlashed
- type PlayerHurt
- type PlayerJump
- type PlayerTeamChange
- type RankUpdate
- type RoundEnd
- type RoundEndOfficial
- type RoundEndReason
- type RoundFreezetimeEnd
- type RoundMVPAnnouncement
- type RoundMVPReason
- type RoundStart
- type SayText
- type SayText2
- type SmokeExpired
- type SmokeStart
- type StringTableCreated
- type TickDone
- type WeaponFire
Constants ¶
const ( BombsiteA bombsite = 'A' BombsiteB bombsite = 'B' )
Bombsite identifiers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnouncementFinalRound ¶ added in v1.0.0
type AnnouncementFinalRound struct{}
AnnouncementFinalRound signals the 30th round, not raised if the match ends before that.
type AnnouncementLastRoundHalf ¶ added in v1.0.0
type AnnouncementLastRoundHalf struct{}
AnnouncementLastRoundHalf signals the last round of the first half.
type AnnouncementMatchStarted ¶ added in v1.0.0
type AnnouncementMatchStarted struct{}
AnnouncementMatchStarted signals that the announcement "Match Started" has been displayed.
type AnnouncementWinPanelMatch ¶ added in v1.0.0
type AnnouncementWinPanelMatch struct{}
AnnouncementWinPanelMatch signals that the 'win panel' has been displayed. I guess that's the final scoreboard.
type BombDefuseStart ¶ added in v1.0.0
BombDefuseStart signals the start of defusing.
type BombDefused ¶ added in v1.0.0
type BombDefused struct {
BombEvent
}
BombDefused signals that the bomb has been defused.
type BombDropped ¶ added in v1.0.0
BombDropped signals that the bomb (C4) has been dropped onto the ground. Not fired if it has been dropped to another player (see BombPickup for this).
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 GrenadeEventIf for GrenadeEvents.
type BombExplode ¶ added in v1.0.0
type BombExplode struct {
BombEvent
}
BombExplode signals that the bomb has exploded.
type BombPickup ¶ added in v1.0.0
BombPickup signals that the bomb (C4) has been picked up.
type BombPlantBegin ¶ added in v1.0.0
type BombPlantBegin struct {
BombEvent
}
BombPlantBegin signals the start of a plant.
type BombPlanted ¶ added in v1.0.0
type BombPlanted struct {
BombEvent
}
BombPlanted signals that the bomb has been planted.
type BotTakenOver ¶ added in v1.0.0
BotTakenOver signals that a player took over a bot.
type ChatMessage ¶ added in v1.0.0
ChatMessage signals a player generated chat message. Since team chat is generally not recorded IsChatAll will probably always be false. See SayText for admin / console messages and SayText2 for raw network package data.
type DataTablesParsed ¶ added in v1.0.0
type DataTablesParsed struct{}
DataTablesParsed signals that the datatables were parsed. You can use the Parser.SendTableParser() after this event to register update notification on entities & properties.
type DecoyStart ¶ added in v1.0.0
type DecoyStart struct {
GrenadeEvent
}
DecoyStart signals the start of a decoy.
type FireGrenadeExpired ¶ added in v1.0.0
type FireGrenadeExpired struct {
GrenadeEvent
}
FireGrenadeExpired signals that all fires of a molly/incendiary have extinguished.
type FireGrenadeStart ¶ added in v1.0.0
type FireGrenadeStart struct {
GrenadeEvent
}
FireGrenadeStart signals the start of a molly/incendiary.
type FlashExplode ¶ added in v1.0.0
type FlashExplode struct {
GrenadeEvent
}
FlashExplode signals the explosion of a Flash.
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 GrenadeEvent ¶ added in v1.0.0
type GrenadeEvent struct {
GrenadeType common.EquipmentElement
Position r3.Vector
Thrower *common.Player
GrenadeEntityID int
}
GrenadeEvent contains the common attributes of nade events. Dont register handlers on this tho, you want GrenadeEventIf for that
func (GrenadeEvent) Base ¶ added in v1.0.0
func (ne GrenadeEvent) Base() GrenadeEvent
Base returns the GrenadeEvent itself, used for catching all events with GrenadeEventIf.
type GrenadeEventIf ¶ added in v1.0.0
type GrenadeEventIf interface {
Base() GrenadeEvent
}
GrenadeEventIf is the interface for all GrenadeEvents (except GrenadeProjectile* events). Used to catch the different events with the same handler.
type GrenadeProjectileBounce ¶ added in v1.0.0
type GrenadeProjectileBounce struct {
Projectile *common.GrenadeProjectile
BounceNr int
}
GrenadeProjectileBounce signals that a nade has just bounced off a wall/floor/ceiling or object.
type GrenadeProjectileDestroy ¶ added in v1.0.0
type GrenadeProjectileDestroy struct {
Projectile *common.GrenadeProjectile
}
GrenadeProjectileDestroy signals that a nade entity is being destroyed (i.e. it detonated / expired). This is different from the other Grenade events because it's sent out when the projectile entity is destroyed.
Mainly useful for getting the full trajectory of the projectile.
type GrenadeProjectileThrow ¶ added in v1.0.0
type GrenadeProjectileThrow struct {
Projectile *common.GrenadeProjectile
}
GrenadeProjectileThrow signals that a nade has just been thrown. This is different from the WeaponFired because it's sent out when the projectile entity is created.
type HeExplode ¶ added in v1.0.0
type HeExplode struct {
GrenadeEvent
}
HeExplode signals the explosion of a HE.
type HitGroup ¶ added in v1.0.0
type HitGroup byte
HitGroup is the type for the various HitGroupXYZ constants.
See PlayerHurt.
const ( HitGroupGeneric HitGroup = 0 HitGroupHead HitGroup = 1 HitGroupChest HitGroup = 2 HitGroupStomach HitGroup = 3 HitGroupLeftArm HitGroup = 4 HitGroupRightArm HitGroup = 5 HitGroupLeftLeg HitGroup = 6 HitGroupRightLeg HitGroup = 7 HitGroupGear HitGroup = 10 )
HitGroup constants give information about where a player got hit. e.g. head, chest, legs etc.
type InfernoExpired ¶ added in v1.0.0
InfernoExpired signals that all fire from a incendiary or Molotov has extinguished. This is different from the FireGrenadeExpire event because it's sent out when the inferno entity is destroyed instead of on the game-event.
Mainly useful for getting the final area of an inferno.
type InfernoStart ¶ added in v1.0.0
InfernoStart signals that the fire of a incendiary or Molotov is starting. This is different from the FireGrenadeStart because it's sent out when the inferno entity is created instead of on the game-event.
type ItemPickup ¶ added in v1.0.0
ItemPickup signals an item was bought or picked up.
type Kill ¶ added in v1.0.0
type Kill struct {
Weapon *common.Equipment
Victim *common.Player
Killer *common.Player
Assister *common.Player
PenetratedObjects int
IsHeadshot bool
}
Kill signals that a player has been killed.
type MatchStart ¶ added in v1.0.0
type MatchStart struct{}
MatchStart signals that the match has started.
type ParserWarn ¶ added in v1.0.0
type ParserWarn struct {
Message string
}
ParserWarn signals that a non-fatal problem occurred during parsing.
type PlayerConnect ¶ added in v1.0.0
PlayerConnect signals that a player has started connecting.
type PlayerDisconnected ¶ added in v1.0.0
PlayerDisconnected signals that a player has disconnected.
type PlayerFlashed ¶ added in v1.0.0
PlayerFlashed signals that a player was flashed.
type PlayerHurt ¶ added in v1.0.0
type PlayerHurt 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 HitGroup
}
PlayerHurt signals that a player has been damaged.
type PlayerJump ¶ added in v1.0.0
PlayerJump signals that a player has jumped.
type PlayerTeamChange ¶ added in v1.0.0
type PlayerTeamChange struct {
Player *common.Player
NewTeam common.Team
OldTeam common.Team
Silent bool
IsBot bool
}
PlayerTeamChange occurs when a player swaps teams.
type RankUpdate ¶ added in v1.0.0
RankUpdate signals the new rank. Not sure if this only occurs if the rank changed.
type RoundEnd ¶ added in v1.0.0
type RoundEnd struct {
Message string
Reason RoundEndReason
Winner common.Team
}
RoundEnd 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 RoundEndOfficial ¶ added in v1.0.0
type RoundEndOfficial struct{}
RoundEndOfficial signals that the round has 'officially' ended. After RoundEnd and before this players are still able to walk around.
type RoundEndReason ¶ added in v1.0.0
type RoundEndReason byte
RoundEndReason is the type for the various RoundEndReasonXYZ constants.
See RoundEnd.
const ( RoundEndReasonTargetBombed RoundEndReason = 1 RoundEndReasonVIPEscaped RoundEndReason = 2 RoundEndReasonVIPKilled RoundEndReason = 3 RoundEndReasonTerroristsEscaped RoundEndReason = 4 RoundEndReasonCTStoppedEscape RoundEndReason = 5 RoundEndReasonTerroristsStopped RoundEndReason = 6 RoundEndReasonBombDefused RoundEndReason = 7 RoundEndReasonCTWin RoundEndReason = 8 RoundEndReasonTerroristsWin RoundEndReason = 9 RoundEndReasonDraw RoundEndReason = 10 RoundEndReasonHostagesRescued RoundEndReason = 11 RoundEndReasonTargetSaved RoundEndReason = 12 RoundEndReasonHostagesNotRescued RoundEndReason = 13 RoundEndReasonTerroristsNotEscaped RoundEndReason = 14 RoundEndReasonVIPNotEscaped RoundEndReason = 15 RoundEndReasonGameStart RoundEndReason = 16 RoundEndReasonTerroristsSurrender RoundEndReason = 17 RoundEndReasonCTSurrender RoundEndReason = 18 )
RoundEndReason constants give information about why a round ended (Bomb defused, exploded etc.).
type RoundFreezetimeEnd ¶ added in v1.0.0
type RoundFreezetimeEnd struct{}
RoundFreezetimeEnd signals that the freeze time is over.
type RoundMVPAnnouncement ¶ added in v1.0.0
type RoundMVPAnnouncement struct {
Player *common.Player
Reason RoundMVPReason
}
RoundMVPAnnouncement signals the announcement of the last rounds MVP.
type RoundMVPReason ¶ added in v1.0.0
type RoundMVPReason byte
RoundMVPReason is the type for the various MVPReasonYXZ constants.
See RoundMVPAnnouncement.
const ( MVPReasonMostEliminations RoundMVPReason = 1 MVPReasonBombDefused RoundMVPReason = 2 MVPReasonBombPlanted RoundMVPReason = 3 )
RoundMVPReasons constants give information about why a player got the MVP award.
type RoundStart ¶ added in v1.0.0
RoundStart signals that a new round has started.
type SayText ¶ added in v1.0.0
type SayText 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
}
SayText signals a chat message. It contains the raw network message data for admin / console messages. EntIdx will probably always be 0 See ChatMessage and SayText2 for player chat messages.
type SayText2 ¶ added in v1.0.0
type SayText2 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
}
SayText2 signals a chat message. It just contains the raw network message. For player chat messages, ChatMessage may be more interesting. Team chat is generally not recorded so IsChatAll will probably always be false. See SayText for admin / console messages.
type SmokeExpired ¶ added in v1.0.0
type SmokeExpired struct {
GrenadeEvent
}
SmokeExpired signals that a smoke as completely faded away.
type SmokeStart ¶ added in v1.0.0
type SmokeStart struct {
GrenadeEvent
}
SmokeStart signals the start of a smoke (pop).
type StringTableCreated ¶ added in v1.0.0
type StringTableCreated struct {
TableName string
}
StringTableCreated 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 TickDone. 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.