Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateMatrixForTeams(teams []*TeamStats)
- func GenerateRandomAccessTokenHistory() *string
- func GenerateRandomShareCode() *string
- func GenerateRandomSteamIDStr() *string
- func ReplaceWithBadderMark(dest *Marks, src Marks)
- func ReplaceWithBetterMark(dest *Marks, src Marks)
- type BombDefusedEvent
- type BombExplodeEvent
- type BombPlantedEvent
- type BulletStats
- type ChatMessage
- type DeathMatchDemo
- func GenerateRandomDeathMatchDemo(userID uint, steamID string, date time.Time) DeathMatchDemo
- func GenerateRandomDeathMatchDemoStats(userID uint, steamID string, date time.Time) DeathMatchDemo
- func GenerateRandomsDeathMatchDemo(userID uint, steamID string, date time.Time, nbrDemos int) []DeathMatchDemo
- type DeathMatchPlayer
- type DeathMatchWeaponStats
- type Demo
- type DemoGameMode
- type DemoGenerationBones
- type DemoSource
- type DuelsPlayer
- type DuelsTeam
- type EndState
- type Event
- type EventTypeBDD
- type Frame
- type Grenade
- type GrenadeState
- type HeatMapDmg
- type HeatMapKill
- type KillEvent
- type Marks
- type MarksPerRound
- type MatrixFlashs
- type MatrixKills
- type PlayerCard
- type PlayerPositions
- type PlayerStats
- type Round
- type RoundFreezetimeEndEvent
- type RoundsGenerationBones
- type ScoreFacts
- type SteamID
- type TeamStats
- type TeamsStatsGenerationBones
- type TokenUploadDemo
- type User
- type WeaponMarks
- type WeaponPattern
Constants ¶
const LengthSteamID = 17
LengthSteamID the length of a steamID
Variables ¶
var AllSources = []DemoSource{Unknownsource, Valve, Faceit, ESEA, UserUpload}
AllSources every sources
var DemosGenerationAllBones = DemoGenerationBones{ TeamsStats: &TeamsStatsGenerationBones{Matrix: true}, Rounds: &RoundsGenerationBones{}, }
DemosGenerationAllBones genrates everything
var DemosGenerationMatrixBones = DemoGenerationBones{ TeamsStats: &TeamsStatsGenerationBones{Matrix: true}, }
DemosGenerationMatrixBones generates TeamsStats and matrix
var DemosGenerationTeamBones = DemoGenerationBones{ TeamsStats: &TeamsStatsGenerationBones{}, }
DemosGenerationTeamBones generates TeamsStats
var ErrURLNotFound = errors.New("url of replay hasn't been found")
ErrURLNotFound url of replay hasn't been found
var ErrUserDataMissing = errors.New("data from user are missing")
ErrUserDataMissing data from user are missing
var SafeSources = []DemoSource{Valve, Faceit, ESEA}
SafeSources source that I can belive, in example valve, faceit or esea
var UnsafeSources = []DemoSource{UserUpload}
UnsafeSources source that I can't belive and checks must be performed like demos uploaded by the uthers
Functions ¶
func GenerateMatrixForTeams ¶
func GenerateMatrixForTeams(teams []*TeamStats)
GenerateMatrixForTeams generates random matrix
func GenerateRandomAccessTokenHistory ¶
func GenerateRandomAccessTokenHistory() *string
GenerateRandomAccessTokenHistory generates a random access token history
func GenerateRandomShareCode ¶
func GenerateRandomShareCode() *string
GenerateRandomShareCode generates a random share code
func GenerateRandomSteamIDStr ¶
func GenerateRandomSteamIDStr() *string
GenerateRandomSteamIDStr generates random steamID
func ReplaceWithBadderMark ¶
ReplaceWithBadderMark if marks in src is badder than dest, replace
func ReplaceWithBetterMark ¶
ReplaceWithBetterMark if marks in src is better than dest, replace
Types ¶
type BombDefusedEvent ¶
type BombDefusedEvent struct { ID *int64 `gorm:"primaryKey"` FrameID *int64 `gorm:"not null"` Frame *Frame Defuser *string `gorm:"not null"` TimeRemainded *time.Duration `gorm:"not null"` }
BombDefusedEvent event when a bomb has been defused
func GenerateRandomBombDefusedEvent ¶
func GenerateRandomBombDefusedEvent() *BombDefusedEvent
GenerateRandomBombDefusedEvent helper that generate random BombDefusedEvent
func (*BombDefusedEvent) GetIDType ¶
func (bde *BombDefusedEvent) GetIDType() (*int64, string)
GetIDType return the event ID from DB and the name of the table
func (BombDefusedEvent) GetType ¶
func (BombDefusedEvent) GetType() EventTypeBDD
GetType return the type of the event
func (*BombDefusedEvent) MarshalJSON ¶
func (bde *BombDefusedEvent) MarshalJSON() ([]byte, error)
MarshalJSON get the json of the event
func (*BombDefusedEvent) SetFrame ¶
func (bde *BombDefusedEvent) SetFrame(frame *Frame)
SetFrame set the frame IF to the event
type BombExplodeEvent ¶
type BombExplodeEvent struct { ID *int64 `gorm:"primaryKey"` FrameID *int64 `gorm:"not null"` Frame *Frame }
BombExplodeEvent event when a bomb exploded
func GenerateRandomBombExplodeEvent ¶
func GenerateRandomBombExplodeEvent() *BombExplodeEvent
GenerateRandomBombExplodeEvent helper that generate random BombExplodeEvent
func (*BombExplodeEvent) GetIDType ¶
func (bee *BombExplodeEvent) GetIDType() (*int64, string)
GetIDType return the event ID from DB and the name of the table
func (BombExplodeEvent) GetType ¶
func (BombExplodeEvent) GetType() EventTypeBDD
GetType return the type of the event
func (*BombExplodeEvent) MarshalJSON ¶
func (bee *BombExplodeEvent) MarshalJSON() ([]byte, error)
MarshalJSON get the json of the event
func (*BombExplodeEvent) SetFrame ¶
func (bee *BombExplodeEvent) SetFrame(frame *Frame)
SetFrame set the frame IF to the event
type BombPlantedEvent ¶
type BombPlantedEvent struct { ID *int64 `gorm:"primaryKey"` FrameID *int64 `gorm:"not null"` Frame *Frame TimePlanted *time.Duration `gorm:"not null"` Planter *string `gorm:"not null"` Bombsite *string `gorm:"not null"` }
BombPlantedEvent event when a bomb has been planted
func GenerateRandomBombPlantedEvent ¶
func GenerateRandomBombPlantedEvent() *BombPlantedEvent
GenerateRandomBombPlantedEvent helper that generate random BombPlantedEvent
func (*BombPlantedEvent) GetIDType ¶
func (bpe *BombPlantedEvent) GetIDType() (*int64, string)
GetIDType return the event ID from DB and the name of the table
func (BombPlantedEvent) GetType ¶
func (BombPlantedEvent) GetType() EventTypeBDD
GetType return the type of the event
func (*BombPlantedEvent) MarshalJSON ¶
func (bpe *BombPlantedEvent) MarshalJSON() ([]byte, error)
MarshalJSON get the json of the event
func (*BombPlantedEvent) SetFrame ¶
func (bpe *BombPlantedEvent) SetFrame(frame *Frame)
SetFrame set the frame IF to the event
type BulletStats ¶
type BulletStats struct { UUID uuid.UUID `gorm:"primaryKey;default:uuid_generate_v4();index"` WeaponPatternUUID *uuid.UUID `gorm:"not null"` WeaponPattern *WeaponPattern `gorm:"foreignKey:WeaponPatternUUID"` BulletNumber int `gorm:"not null"` NbrBulletFired int64 `gorm:"not null"` NbrBulletHit int64 `gorm:"not null"` NbrBulletHitHS int64 `gorm:"not null"` NbrBulletKill int64 `gorm:"not null"` CumulativeDeltaX float64 `gorm:"not null"` CumulativeDeltaY float64 `gorm:"not null"` }
BulletStats type with stats about bullet
func GenerateRandomsBulletStats ¶
func GenerateRandomsBulletStats(numBullet int) *BulletStats
GenerateRandomsBulletStats generate random BulletStats
func GenerateRandomsBulletsStats ¶
func GenerateRandomsBulletsStats() []*BulletStats
GenerateRandomsBulletsStats generate randoms BulletStats
type ChatMessage ¶
type ChatMessage struct { ID *uint `gorm:"primaryKey"` RoundID *int64 `gorm:"not null"` Round *Round `gorm:"foreignKey:RoundID"` Sender *string `gorm:"not null"` SideSender *int `gorm:"not null"` Message *string `gorm:"not null"` IsChatAll *bool `gorm:"not null"` }
ChatMessage representes
func GenerateRandomChatMessage ¶
func GenerateRandomChatMessage() *ChatMessage
GenerateRandomChatMessage generate a random ChatMessage
func GenerateRandomChatMessages ¶
func GenerateRandomChatMessages(nbrMessage int) []*ChatMessage
GenerateRandomChatMessages generate randoms ChatMessages
type DeathMatchDemo ¶
type DeathMatchDemo struct { ID *int64 `gorm:"primaryKey;autoIncrement:false"` CreatedAt *time.Time UpdatedAt *time.Time HashFile []byte `gorm:"unique"` UserID *uint `gorm:"not null"` User *User VersionAnalyzer *int64 `gorm:"not null"` DeathMatchPlayers []*DeathMatchPlayer `gorm:"constraint:OnDelete:CASCADE;foreignKey:DeathMatchDemoID"` Date *time.Time `gorm:"not null"` MapName *string `gorm:""` Path *string `gorm:"not null; unique"` Name *string `gorm:"not null; unique"` }
DeathMatchDemo data about the deathmatch
func GenerateRandomDeathMatchDemo ¶
func GenerateRandomDeathMatchDemo(userID uint, steamID string, date time.Time) DeathMatchDemo
GenerateRandomDeathMatchDemo generate a random DeathMatchDemo
func GenerateRandomDeathMatchDemoStats ¶
func GenerateRandomDeathMatchDemoStats(userID uint, steamID string, date time.Time) DeathMatchDemo
GenerateRandomDeathMatchDemoStats generate a random DeathMatchDemo with stats
func GenerateRandomsDeathMatchDemo ¶
func GenerateRandomsDeathMatchDemo(userID uint, steamID string, date time.Time, nbrDemos int) []DeathMatchDemo
GenerateRandomsDeathMatchDemo generate randoms DeathMatchDemo
type DeathMatchPlayer ¶
type DeathMatchPlayer struct { ID *uint `gorm:"primaryKey"` SteamID *string `gorm:"not null"` DeathMatchDemoID *int64 `gorm:"not null"` DeathMatchDemo *DeathMatchDemo `gorm:"foreignKey:DeathMatchDemoID"` WeaponsStats []*DeathMatchWeaponStats `gorm:"constraint:OnDelete:CASCADE;foreignKey:DeathMatchPlayerID"` FirstBulletAccuracy *float64 `gorm:"not null"` FirstBulletHS *float64 `gorm:"not null"` BulletAccuracy *float64 `gorm:"not null"` HSPercentage *float64 `gorm:"not null"` NbrBulletFired *int `gorm:"not null"` NbrBulletHit *int `gorm:"not null"` NbrBulletHS *int `gorm:"not null"` NbrFirstBulletFired *int `gorm:"not null"` NbrFirstBulletHit *int `gorm:"not null"` NbrFirstBulletHS *int `gorm:"not null"` AverageVelocityAttacker *float64 `gorm:"not null"` }
DeathMatchPlayer stats about a player during a deathmatch
func GenerateRandomDeathMatchPlayer ¶
func GenerateRandomDeathMatchPlayer(steamID *string) *DeathMatchPlayer
GenerateRandomDeathMatchPlayer generate a random DeathMatchPlayer
func GenerateRandomDeathMatchPlayers ¶
func GenerateRandomDeathMatchPlayers(steamID string) []*DeathMatchPlayer
GenerateRandomDeathMatchPlayers generate randoms DeathMatchPlayer
type DeathMatchWeaponStats ¶
type DeathMatchWeaponStats struct { ID *uint `gorm:"primaryKey"` DeathMatchPlayerID *int64 `gorm:"not null"` DeathMatchPlayer *DeathMatchPlayer `gorm:"foreignKey:DeathMatchPlayerID"` WeaponID *common.EquipmentType `gorm:"not null"` FirstBulletAccuracy *float64 `gorm:"not null"` FirstBulletHS *float64 `gorm:"not null"` BulletAccuracy *float64 `gorm:"not null"` HSPercentage *float64 `gorm:"not null"` NbrBulletFired *int `gorm:"not null"` NbrBulletHit *int `gorm:"not null"` NbrBulletHS *int `gorm:"not null"` NbrFirstBulletFired *int `gorm:"not null"` NbrFirstBulletHit *int `gorm:"not null"` NbrFirstBulletHS *int `gorm:"not null"` AverageVelocityAttacker *float64 `gorm:"not null"` }
DeathMatchWeaponStats stats about weapon
func GenerateRandomWeaponStats ¶
func GenerateRandomWeaponStats(nbrBulletFired int) *DeathMatchWeaponStats
GenerateRandomWeaponStats generate a random DeathMatchWeaponStats
func GenerateRandomWeaponsStats ¶
func GenerateRandomWeaponsStats(maxNbrBulletFired int) []*DeathMatchWeaponStats
GenerateRandomWeaponsStats generate randoms DeathMatchWeaponStats
type Demo ¶
type Demo struct { ID *int64 `gorm:"primaryKey;auto_increment:false"` CreatedAt *time.Time UpdatedAt *time.Time HashFile []byte `gorm:"not null; unique"` VersionAnalyzer *int64 `gorm:"not null"` Downloaded *bool `gorm:"not null"` Source DemoSource `gorm:"not null"` GameMode DemoGameMode `gorm:"not null"` Rounds []*Round `gorm:"constraint:OnDelete:CASCADE"` TeamsStats []*TeamStats `gorm:"constraint:OnDelete:CASCADE"` UserID *uint `gorm:"not null"` User *User SteamsIDs []*SteamID Date *time.Time `gorm:"not null"` MapName *string `gorm:""` Path *string `gorm:"not null"` Name *string `gorm:"not null"` ReplayURL *string `gorm:""` }
Demo demo type with generals data
func GenerateRandomDemo ¶
GenerateRandomDemo generate a random demo
func GenerateRandomDemoWithStats ¶
func GenerateRandomDemoWithStats( user *User, steamID string, versionAnalyzer int64, whatToGenerates DemoGenerationBones, ) *Demo
GenerateRandomDemoWithStats generate a random demo with all the stats
func ParseDemoInfoFromFile ¶
ParseDemoInfoFromFile function that parse a .info file from a reader
func (*Demo) AddSteamsIDs ¶
AddSteamsIDs helper that replace the steamsID struct in the demo
func (Demo) FindBaddestMarks ¶
FindBaddestMarks find in a demo, with all the baddest marks, even if they are not from the same player
func (Demo) FindBestMarks ¶
FindBestMarks find in a demo, with all the best marks, even if they are not from the same player
func (Demo) FindPlayer ¶
func (d Demo) FindPlayer(steamID *string) *PlayerStats
FindPlayer return the struct player from the user's steam ID
type DemoGameMode ¶
type DemoGameMode byte
DemoGameMode game mode of the demo
const ( UnknownGameMode DemoGameMode = iota Competitive DM Wingman )
DemoGameMode consts for game mode of demos
type DemoGenerationBones ¶
type DemoGenerationBones struct { TeamsStats *TeamsStatsGenerationBones Rounds *RoundsGenerationBones }
DemoGenerationBones type to know what to generates
type DemoSource ¶
type DemoSource byte
DemoSource source of the demo
const ( Unknownsource DemoSource = iota Valve Faceit ESEA UserUpload )
DemoSource consts for the source of demos
type DuelsPlayer ¶
type DuelsPlayer struct { ID *uint `gorm:"primaryKey"` PlayerStatsID *uint `gorm:"not null"` PlayerStats *PlayerStats Matchup *string `gorm:"not null"` NbrOccurence *int `gorm:"not null"` NbrWin *int `gorm:"not null"` }
DuelsPlayer duels for the player
func GenerateRandomDuelsPlayers ¶
func GenerateRandomDuelsPlayers() []*DuelsPlayer
GenerateRandomDuelsPlayers for tests, generates random duels
type DuelsTeam ¶
type DuelsTeam struct { ID *uint `gorm:"primaryKey"` TeamStatsID *uint `gorm:"not null"` TeamStats *TeamStats Matchup *string `gorm:"not null"` NbrOccurence *int `gorm:"not null"` NbrWin *int `gorm:"not null"` }
DuelsTeam duels for the team
func GenerateRandomDuelsTeams ¶
func GenerateRandomDuelsTeams() []*DuelsTeam
GenerateRandomDuelsTeams for tests, generates random duels
type Event ¶
type Event interface { GetType() EventTypeBDD SetFrame(*Frame) GetIDType() (*int64, string) MarshalJSON() ([]byte, error) }
Event interface for events during a round (kill, bomb planted etc)
func GenerateRandomEvents ¶
func GenerateRandomEvents() []Event
GenerateRandomEvents generate a random Event
type EventTypeBDD ¶
type EventTypeBDD int
EventTypeBDD the type of event, kill, bomb planted...
const ( NilEvt EventTypeBDD = iota KillEvt BombPlantEvt BombDefusedEvt BombExplodeEvt RoundFreezetimeEndEvt )
constances of events
type Frame ¶
type Frame struct { ID *int64 `gorm:"primaryKey"` RoundID *int64 `gorm:"not null"` Round *Round NumFrame *int `gorm:"not null"` Grenades []*Grenade `gorm:"-"` GrenadesByte []byte `gorm:"not null"` PlayersCard []*PlayerCard `gorm:"-"` PlayersCardByte []byte `gorm:"not null"` PlayersPositions []*PlayerPositions `gorm:"-"` PlayersPositionsByte []byte `gorm:"not null"` BombLastPosDownX *float64 `gorm:"not null"` BombLastPosDownY *float64 `gorm:"not null"` BombLastPosDownZ *float64 `gorm:"not null"` PlayerCarrierSteamID *string `gorm:"not null"` Timer *string `gorm:"not null"` BombPlanted *bool `gorm:"not null"` Events []Event `gorm:"-"` EventsByte []byte `gorm:"not null"` }
Frame reprensent a frame, with the current data of the player, and if there is one, an event attached to it
func GenerateRandomFrame ¶
func GenerateRandomFrame() *Frame
GenerateRandomFrame generate a random Frame
func GenerateRandomFrames ¶
func GenerateRandomFrames() []*Frame
GenerateRandomFrames generate random Frames
type Grenade ¶
type Grenade struct { Frame *Frame ID int64 PositionX float64 PositionY float64 PositionZ float64 Fire []float64 State GrenadeState GrenadeType common.EquipmentType // 50x }
Grenade struct that store all the data for a grenade needed to display its state
func GenerateRandomGrenade ¶
func GenerateRandomGrenade() *Grenade
GenerateRandomGrenade generate randoms Grenade
func GenerateRandomGrenades ¶
func GenerateRandomGrenades() []*Grenade
GenerateRandomGrenades generate a random Grenade
type GrenadeState ¶
type GrenadeState int
GrenadeState represente the state of a grenade
const ( Nil GrenadeState = iota Thrown Start Stop Explode Expired Destroyed )
consts of the stats of the grenades
type HeatMapDmg ¶
type HeatMapDmg struct { ID *int64 `gorm:"primaryKey"` RoundID *int64 `gorm:"not null"` Round *Round DurationSinceRoundBegan *time.Duration `gorm:"not null"` WeaponShooter *common.EquipmentType `gorm:"index"` SteamIDShooter *string `gorm:"index"` SideShooter *int ShooterPosX *float64 ShooterPosY *float64 ActiveWeaponVictim *common.EquipmentType `gorm:"index"` SteamIDVictim *string `gorm:"index"` SideVictim *int VictimPosX *float64 VictimPosY *float64 Dmg *int `gorm:"not null"` }
HeatMapDmg type to store dmgs
func GenerateRandomHeatMapDmg ¶
func GenerateRandomHeatMapDmg() *HeatMapDmg
GenerateRandomHeatMapDmg generate a HeatMapDmg
func GenerateRandomsHeatMapsDmgs ¶
func GenerateRandomsHeatMapsDmgs(nbrHeatMap int) []*HeatMapDmg
GenerateRandomsHeatMapsDmgs generate []*HeatMapDmg
type HeatMapKill ¶
type HeatMapKill struct { ID *int64 `gorm:"primaryKey"` RoundID *int64 `gorm:"not null"` Round *Round DurationSinceRoundBegan *time.Duration `gorm:"not null"` WeaponKiller *common.EquipmentType `gorm:"index"` SteamIDKiller *string `gorm:"index"` SideKiller *int KillerPosX *float64 KillerPosY *float64 ActiveWeaponVictim *common.EquipmentType `gorm:"index"` SteamIDVictim *string `gorm:"index"` SideVictim *int VictimPosX *float64 VictimPosY *float64 }
HeatMapKill type to store kills
func GenerateRandomHeatMapKill ¶
func GenerateRandomHeatMapKill() *HeatMapKill
GenerateRandomHeatMapKill generate a HeatMapKill
func GenerateRandomsHeatMapsKills ¶
func GenerateRandomsHeatMapsKills(nbrHeatMap int) []*HeatMapKill
GenerateRandomsHeatMapsKills generate []*HeatMapKill
type KillEvent ¶
type KillEvent struct { ID *int64 `gorm:"primaryKey"` FrameID *int64 `gorm:"not null"` Frame *Frame TimeKill *time.Duration `gorm:"not null"` IsHeadShot *bool `gorm:"not null"` IsWallBang *bool `gorm:"not null"` KillerName *string `gorm:"not null"` KillerSide *int `gorm:"not null"` Weapon *string `gorm:"not null"` VictimSide *int `gorm:"not null"` VictimName *string `gorm:"not null"` }
KillEvent event for a kill
func GenerateRandomKillEvent ¶
func GenerateRandomKillEvent() *KillEvent
GenerateRandomKillEvent helper that generate random KillEvent
func (KillEvent) GetType ¶
func (KillEvent) GetType() EventTypeBDD
GetType return the type of the event
func (*KillEvent) MarshalJSON ¶
MarshalJSON get the json of the event
type Marks ¶
type Marks struct { ID *uint `gorm:"primaryKey"` Accuracy *float64 `gorm:"not null"` HS *float64 `gorm:"not null"` FirstBulletAccuracy *float64 `gorm:"not null"` FirstBulletHS *float64 `gorm:"not null"` NbrBulletsFired *int `gorm:"not null"` NbrBulletsHit *int `gorm:"not null"` NbrBulletsHS *int `gorm:"not null"` NbrFirstBulletsFired *int `gorm:"not null"` NbrFirstBulletsHit *int `gorm:"not null"` NbrFirstBulletsHS *int `gorm:"not null"` GrenadesValueDeath *float64 `gorm:"not null"` Damage *int `gorm:"not null"` UtilityDamage *int `gorm:"not null"` AverageVelocityShoots *int `gorm:"not null"` AverageDeltaXCrossHair *int `gorm:"not null"` AverageDeltaYCrossHair *int `gorm:"not null"` NbrDeaths *int `gorm:"not null"` NbrKills *int `gorm:"not null"` WeaponsMarks []*WeaponMarks }
Marks reflect how well a player played (not how much he has an impact)
func GenerateRandomMarks ¶
GenerateRandomMarks generate a random marks
type MarksPerRound ¶
type MarksPerRound struct { ID *uint `gorm:"primaryKey"` RoundID *int64 `gorm:"not null"` Round *Round `gorm:"foreignKey:RoundID"` SteamID *string `gorm:"not null"` Side *int `gorm:"not null"` ConstTeam *int `gorm:"not null"` NbrBulletsFired *int `gorm:"not null"` NbrBulletsHit *int `gorm:"not null"` NbrBulletsHS *int `gorm:"not null"` NbrFirstBulletsFired *int `gorm:"not null"` NbrFirstBulletsHit *int `gorm:"not null"` NbrFirstBulletsHS *int `gorm:"not null"` Accuracy *float64 `gorm:"not null"` HS *float64 `gorm:"not null"` FirstBulletAccuracy *float64 `gorm:"not null"` FirstBulletHS *float64 `gorm:"not null"` Damage *int `gorm:"not null"` UtilityDamage *int `gorm:"not null"` AverageVelocityShoots *int `gorm:"not null"` AverageDeltaXCrossHair *int `gorm:"not null"` AverageDeltaYCrossHair *int `gorm:"not null"` NbrDeaths *int `gorm:"not null"` NbrKills *int `gorm:"not null"` }
MarksPerRound represents the marks of a player for 1 round
func GenerateRandomMarkPerRound ¶
func GenerateRandomMarkPerRound(steamID string, side, constTeam int) *MarksPerRound
GenerateRandomMarkPerRound generate a random MarksPerRound
func GenerateRandomMarksPerRound ¶
func GenerateRandomMarksPerRound(steamsID []string, numRound int) []*MarksPerRound
GenerateRandomMarksPerRound generate randoms MarksPerRound
type MatrixFlashs ¶
type MatrixFlashs struct { ID *uint `gorm:"primaryKey"` PlayerStatsID *uint `gorm:"not null"` PlayerStats *PlayerStats FlashedSteamID *string `gorm:"not null"` FlashedUsername *string `gorm:"not null"` NbrSecFlashs *float64 `gorm:"not null"` }
MatrixFlashs matrix to store for one game the amount of time every player has flashed every other players
func GenerateRandomMatrixFlashs ¶
func GenerateRandomMatrixFlashs(teams []*TeamStats) []*MatrixFlashs
GenerateRandomMatrixFlashs generate a random matrix flashs
type MatrixKills ¶
type MatrixKills struct { ID *uint `gorm:"primaryKey"` PlayerStatsID *uint `gorm:"not null"` PlayerStats *PlayerStats KilledSteamID *string `gorm:"not null"` KilledUsername *string `gorm:"not null"` NbrKills *int `gorm:"not null"` }
MatrixKills matrix to store for one game the of time every player has killed every other players from the enemy team
func GenerateRandomMatrixKills ¶
func GenerateRandomMatrixKills(teams []*TeamStats) []*MatrixKills
GenerateRandomMatrixKills generate a random matrix kills
type PlayerCard ¶
type PlayerCard struct { Frame *Frame IsAlive bool IsConnected bool IsControllingBot bool Side int PrimaryWeapon string Pistol string Grenades string HasC4 bool PlayerName string SteamID string Health int Armor int HasHelmet bool HasDefuseKit bool Money int }
PlayerCard struct that store all the data for a player needed to display its state
func GenerateRandomPlayerCard ¶
func GenerateRandomPlayerCard() *PlayerCard
GenerateRandomPlayerCard generate randoms playersCard
func GenerateRandomPlayersCard ¶
func GenerateRandomPlayersCard() []*PlayerCard
GenerateRandomPlayersCard generate a random playerCard
type PlayerPositions ¶
type PlayerPositions struct { Frame *Frame SteamID string NbrShoots int IsAlive bool IsDefusing bool IsPlanting bool Side int PositionX float64 PositionY float64 PositionZ float64 ViewDirectionX float64 }
PlayerPositions struct that store the positions of a player
func GenerateRandomPlayerPositions ¶
func GenerateRandomPlayerPositions() *PlayerPositions
GenerateRandomPlayerPositions generate randoms PlayerPositions
func GenerateRandomPlayersPositions ¶
func GenerateRandomPlayersPositions() []*PlayerPositions
GenerateRandomPlayersPositions generate randoms PlayerPositions
type PlayerStats ¶
type PlayerStats struct { ID *uint `gorm:"primaryKey"` TeamStatsID *uint `gorm:"not null"` TeamStats *TeamStats MarksID *uint `gorm:"not null"` Marks *Marks SteamID *string `gorm:"not null"` Username *string `gorm:"not null"` Rank *int `gorm:""` Color *common.Color `gorm:"not null"` ScoreFactsID *uint `gorm:"not null"` ScoreFacts *ScoreFacts MVPsFacts *int `gorm:"not null;default:0"` Kills *int `gorm:"not null"` Deaths *int `gorm:"not null"` Assists *int `gorm:"not null"` MatrixKills []*MatrixKills `gorm:"constraint:OnDelete:CASCADE"` MatrixFlashs []*MatrixFlashs `gorm:"constraint:OnDelete:CASCADE"` DuelsPlayer []*DuelsPlayer `gorm:"constraint:OnDelete:CASCADE"` WeaponPatterns []*WeaponPattern `gorm:"foreignKey:PlayerStatsID"` }
PlayerStats simple type storing player info from the demo
func GenerateRandomPlayerStats ¶
func GenerateRandomPlayerStats(demoID *int64, steamID *string) *PlayerStats
GenerateRandomPlayerStats generate a random player
type Round ¶
type Round struct { ID *uint `gorm:"primaryKey"` DemoID *int64 `gorm:"not null"` Demo *Demo ScoreFactsPerPlayer []*ScoreFacts `gorm:"constraint:OnDelete:CASCADE"` MarksPerRound []*MarksPerRound `gorm:"constraint:OnDelete:CASCADE"` HeatMapKills []*HeatMapKill `gorm:"constraint:OnDelete:CASCADE"` HeatMapDmgs []*HeatMapDmg `gorm:"constraint:OnDelete:CASCADE"` NumRound *int `gorm:"not null"` Frames []*Frame ChatMessage []*ChatMessage SideWin *int `gorm:""` }
Round describes a round
func GenerateRandomRound ¶
GenerateRandomRound generate a random Round
func GenerateRandomRounds ¶
GenerateRandomRounds generate random Rounds
type RoundFreezetimeEndEvent ¶
type RoundFreezetimeEndEvent struct { ID *int64 `gorm:"primaryKey"` FrameID *int64 `gorm:"not null"` Frame *Frame }
RoundFreezetimeEndEvent event when a freezetime ended, should be removed soon
func GenerateRandomRoundFreezetimeEndEvent ¶
func GenerateRandomRoundFreezetimeEndEvent() *RoundFreezetimeEndEvent
GenerateRandomRoundFreezetimeEndEvent helper that generate random RoundFreezetimeEndEvent
func (*RoundFreezetimeEndEvent) GetIDType ¶
func (rfee *RoundFreezetimeEndEvent) GetIDType() (*int64, string)
GetIDType return the event ID from DB and the name of the table
func (RoundFreezetimeEndEvent) GetType ¶
func (RoundFreezetimeEndEvent) GetType() EventTypeBDD
GetType return the type of the event
func (*RoundFreezetimeEndEvent) MarshalJSON ¶
func (rfee *RoundFreezetimeEndEvent) MarshalJSON() ([]byte, error)
MarshalJSON get the json of the event
func (*RoundFreezetimeEndEvent) SetFrame ¶
func (rfee *RoundFreezetimeEndEvent) SetFrame(frame *Frame)
SetFrame set the frame IF to the event
type RoundsGenerationBones ¶
type RoundsGenerationBones struct { }
RoundsGenerationBones type to know if generates or not rounds
type ScoreFacts ¶
type ScoreFacts struct { ID *uint `gorm:"primaryKey"` RoundID *uint Round *Round SteamID *string `gorm:"not null"` RatioScore *float64 `gorm:"not null"` TotalScore *float64 `gorm:"not null"` DamageScore *float64 `gorm:"not null"` KillScore *float64 `gorm:"not null"` DeathScore *float64 `gorm:"not null"` AssistKillScore *float64 `gorm:"not null"` DropScore *float64 `gorm:"not null"` FlashScore *float64 `gorm:"not null"` RevangedScore *float64 `gorm:"not null"` BombDefuseScore *float64 `gorm:"not null"` BombPlantedScore *float64 `gorm:"not null"` }
ScoreFacts show how much the player made an impact during the round ? in example, accuracy would me in a mark, not here, because the player could have a very bad accuracy, but still have a big impact
func GenerateRandomScoreFacts ¶
func GenerateRandomScoreFacts(steamID string) *ScoreFacts
GenerateRandomScoreFacts generate a random score
func GenerateRandomScoresFacts ¶
func GenerateRandomScoresFacts(steamsID []string) []*ScoreFacts
GenerateRandomScoresFacts generate a random score
type SteamID ¶
type SteamID struct { ID *uint `gorm:"primaryKey"` SteamID *string `gorm:"not null"` DemoID *int64 `gorm:"not null"` Demo *Demo }
SteamID temporary type while I find another way to do this
func GenerateRandomSteamID ¶
func GenerateRandomSteamID() *SteamID
GenerateRandomSteamID generates random steamID
func GenerateRandomSteamsID ¶
GenerateRandomSteamsID generates random steamID
type TeamStats ¶
type TeamStats struct { ID *uint `gorm:"primaryKey"` DemoID *int64 `gorm:"not null"` Demo *Demo DuelsTeam []*DuelsTeam `gorm:"constraint:OnDelete:CASCADE"` PlayersStats []*PlayerStats `gorm:"constraint:OnDelete:CASCADE"` Score *int `gorm:"not null"` }
TeamStats simple type storing team info from the demo
func GenerateRandomTeam ¶
GenerateRandomTeam generate a random team
func GenerateRandomTeamsStats ¶
GenerateRandomTeamsStats generates 2 random teams
type TeamsStatsGenerationBones ¶
type TeamsStatsGenerationBones struct {
Matrix bool
}
TeamsStatsGenerationBones type to know if generates or not matrix of flashs/kills
type TokenUploadDemo ¶
type TokenUploadDemo struct { ID *int64 UserID *uint `gorm:"not null"` User *User Token *string `gorm:"not null"` IPAllowed *string `gorm:"not null"` LastUsed *time.Time }
TokenUploadDemo saving token that allowed user to upload demo
func GenerateRandomToken ¶
func GenerateRandomToken(userID uint) TokenUploadDemo
GenerateRandomToken generates random token
func GenerateRandomTokens ¶
func GenerateRandomTokens(userID uint, nbrToken int) []TokenUploadDemo
GenerateRandomTokens generates random tokens
func (*TokenUploadDemo) Generate ¶
func (t *TokenUploadDemo) Generate()
Generate generates a random token
type User ¶
type User struct { ID *uint `gorm:"primaryKey"` CreatedAt *time.Time UpdatedAt *time.Time SteamID *string `gorm:""` AccessTokenHistory *string `gorm:""` APIValveWorking *bool `gorm:"not null;default:false"` Mail *string `gorm:"not null;unique"` Password *string `gorm:"not null"` Demos []*Demo TokensUpload []*TokenUploadDemo }
User struct of an user
func GenerateRandomCredentials ¶
GenerateRandomCredentials generate a random mail and pass in an user
func GenerateRandomUser ¶
GenerateRandomUser generate a random user
func StoreGeneratedUser ¶
StoreGeneratedUser store a generated user
func (*User) BeforeSave ¶
BeforeSave check for the type user
func (*User) CheckPassword ¶
CheckPassword check if the password hashed of the user match the password given in param
func (*User) HashPassword ¶
HashPassword hash the password of the user
type WeaponMarks ¶
type WeaponMarks struct { ID *uint `gorm:"primaryKey"` MarksID *uint `gorm:"not null"` Marks *Marks `gorm:"foreignKey:MarksID"` WeaponType *common.EquipmentType `gorm:"not null"` NbrBulletsFired *int `gorm:"not null"` NbrBulletsHit *int `gorm:"not null"` NbrBulletsHS *int `gorm:"not null"` NbrFirstBulletsFired *int `gorm:"not null"` NbrFirstBulletsHit *int `gorm:"not null"` NbrFirstBulletsHS *int `gorm:"not null"` Accuracy *float64 `gorm:"not null"` HS *float64 `gorm:"not null"` FirstBulletAccuracy *float64 `gorm:"not null"` FirstBulletHS *float64 `gorm:"not null"` AverageVelocityShoots *int `gorm:"not null"` AverageDeltaXCrossHair *int `gorm:"not null"` AverageDeltaYCrossHair *int `gorm:"not null"` Damage *int `gorm:"not null"` NbrDeaths *int `gorm:"not null"` NbrKills *int `gorm:"not null"` }
WeaponMarks reflect how well a player played with a weapon(not how much he has an impact)
func GenerateRandomWeaponMarks ¶
func GenerateRandomWeaponMarks() *WeaponMarks
GenerateRandomWeaponMarks generate a random marks
func GenerateRandomWeaponsMarks ¶
func GenerateRandomWeaponsMarks() []*WeaponMarks
GenerateRandomWeaponsMarks generate a random marks
type WeaponPattern ¶
type WeaponPattern struct { UUID uuid.UUID `gorm:"primaryKey;default:uuid_generate_v4();index"` PlayerStatsID *int64 `gorm:"not null"` PlayerStats *PlayerStats `gorm:"foreignKey:PlayerStatsID"` BulletStats []*BulletStats `gorm:"foreignKey:WeaponPatternUUID"` WeaponType common.EquipmentType `gorm:"not null"` }
WeaponPattern pattern of a weapon
func GenerateRandomsWeaponPattern ¶
func GenerateRandomsWeaponPattern() *WeaponPattern
GenerateRandomsWeaponPattern generate random WeaponPattern
func GenerateRandomsWeaponPatterns ¶
func GenerateRandomsWeaponPatterns() []*WeaponPattern
GenerateRandomsWeaponPatterns generate randoms WeaponPattern
Source Files ¶
- bulletStats.go
- chatMessage.go
- deathMatchDemo.go
- deathMatchPlayer.go
- deathMatchWeaponStats.go
- demo.go
- demoHelpers.go
- duels.go
- event.go
- frame.go
- grenade.go
- heatMap.go
- mark.go
- markPerRound.go
- matrixFlashs.go
- matrixKills.go
- matrixhelpers.go
- playerCard.go
- playerPositions.go
- playerStats.go
- playerStatsHelpers.go
- round.go
- scoreFact.go
- steamID.go
- teamStats.go
- teamStatsHelpers.go
- tokenUploadDemo.go
- user.go
- userHelpers.go
- weaponMark.go
- weaponPattern.go