events

package
v1.0.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package events contains all events that can be sent out from demoinfocs.Parser.

Index

Constants

View Source
const (
	BombsiteA bombsite = 'A'
	BombsiteB bombsite = 'B'
)

Bombsite identifiers

Variables

This section is empty.

Functions

This section is empty.

Types

type BombBeginDefuseEvent

type BombBeginDefuseEvent struct {
	Player *common.Player
	HasKit bool
}

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

type BombEvent struct {
	Player *common.Player
	Site   bombsite
}

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

type BotTakenOverEvent struct {
	Taker *common.Player
}

BotTakenOverEvent signals that a player took over a bot.

type ChatMessageEvent

type ChatMessageEvent struct {
	Sender    *common.Player
	Text      string
	IsChatAll bool
}

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 packages.

type DataTablesParsedEvent

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.

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

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 HitGroup

type HitGroup byte

HitGroup is the type for the various HitGroupXYZ constants.

See PlayerHurtEvent.

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 ItemDropEvent

type ItemDropEvent struct {
	Weapon common.Equipment
	Player *common.Player
}

ItemDropEvent signals an item was dropped.

type ItemEquipEvent

type ItemEquipEvent struct {
	Weapon common.Equipment
	Player *common.Player
}

ItemEquipEvent signals an item was equipped.

type ItemPickupEvent

type ItemPickupEvent struct {
	Weapon common.Equipment
	Player *common.Player
}

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

func (NadeEvent) Base

func (ne NadeEvent) Base() NadeEvent

Base returns the NadeEvent itself, used for catching all events with NadeEventIf.

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

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

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

type ParserWarnEvent struct {
	Message string
}

ParserWarnEvent signals that a non-fatal problem occurred during parsing.

type PlayerBindEvent

type PlayerBindEvent struct {
	Player *common.Player
}

PlayerBindEvent signals that a player has connected.

type PlayerDisconnectEvent

type PlayerDisconnectEvent struct {
	Player *common.Player
}

PlayerDisconnectEvent signals that a player has disconnected.

type PlayerFlashedEvent

type PlayerFlashedEvent struct {
	Player *common.Player
}

PlayerFlashedEvent signals that a player was flashed.

type PlayerFootstepEvent

type PlayerFootstepEvent struct {
	Player *common.Player
}

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     HitGroup
}

PlayerHurtEvent signals that a player has been damaged.

type PlayerJumpEvent

type PlayerJumpEvent struct {
	Player *common.Player
}

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 RoundEndReason

type RoundEndReason byte

RoundEndReason is the type for the various RoundEndReasonXYZ constants.

See RoundEndedEvent.

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 RoundEndedEvent

type RoundEndedEvent struct {
	Message string
	Reason  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 RoundMVPReason
}

RoundMVPEvent signals the announcement of the last rounds MVP.

type RoundMVPReason

type RoundMVPReason byte

RoundMVPReason is the type for the various MVPReasonYXZ constants.

See RoundMVPEvent.

const (
	MVPReasonMostEliminations RoundMVPReason = 1
	MVPReasonBombDefused      RoundMVPReason = 2
	MVPReasonBombPlanted      RoundMVPReason = 3
)

RoundMVPReasons constants give information about why a player got the MVP award.

type RoundOfficiallyEndedEvent

type RoundOfficiallyEndedEvent struct{}

RoundOfficiallyEndedEvent signals that the round 'has officially ended', not exactly sure what that is tbh.

type RoundStartedEvent

type RoundStartedEvent struct {
	TimeLimit int
	FragLimit int
	Objective string
}

RoundStartedEvent signals that a new round has started.

type SayText2Event

type SayText2Event struct {
	Sender    *common.Player
	MsgName   string
	Params    []string
	IsChat    bool
	IsChatAll bool
}

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 {
	EntityIndex int
	Text        string
	IsChat      bool
	IsChatAll   bool
}

SayTextEvent signals a chat message. It contains the raw network message data for admin / console messages. EntityIndex 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

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 TickDoneEvent

type TickDoneEvent struct{}

TickDoneEvent signals that a tick is done.

type WeaponFiredEvent

type WeaponFiredEvent struct {
	Shooter *common.Player
	Weapon  *common.Equipment
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL