Documentation
¶
Index ¶
- Variables
- func GetBodyByIDHandler(c *gin.Context)
- func GetBodyHandler(c *gin.Context)
- func GetListHandler(c *gin.Context)
- func InitMatchEngine(auth string, delay uint32)
- func PostBodyByIDHandler(c *gin.Context)
- func PostBodyHandler(c *gin.Context)
- func SyncByIDHandler(c *gin.Context)
- func SyncHandler(c *gin.Context)
- type Deltaframes
- type Fullframe
- type Match
- func (m *Match) GetDeltaFrame(fragnumber uint32) (*Deltaframes, error)
- func (m *Match) GetFullFrame(fragnumber uint32) (*Fullframe, error)
- func (m *Match) GetStartFrame(fragnumber uint32) (*Startframe, error)
- func (m *Match) IsSyncReady(fragnumber uint32) bool
- func (m *Match) RegisterDeltaFrame(fragment uint32, delta *Deltaframes) error
- func (m *Match) RegisterFullFrame(fragment uint32, full *Fullframe) error
- func (m *Match) RegisterStartFrame(fragment uint32, start *Startframe, tps uint32) error
- func (m *Match) SaveMatchToFile(filename string) error
- func (m *Match) Sync(fragnumber uint32) (*SyncJSON, error)
- func (m *Match) TagID(id string) error
- type MatchesEngine
- func (m *MatchesEngine) Delete(ms *Match) error
- func (m *MatchesEngine) GetAll() ([]*Match, error)
- func (m *MatchesEngine) GetMatchByID(id string) (*Match, error)
- func (m *MatchesEngine) GetMatchByToken(token string) (*Match, error)
- func (m *MatchesEngine) GetTokens() ([]string, error)
- func (m *MatchesEngine) LoadMatchFromFile(path string) (string, error)
- func (m *MatchesEngine) Register(ms *Match)
- type Startframe
- type SyncJSON
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Matches *MatchesEngine Auth string Delay uint32 )
Functions ¶
func GetBodyByIDHandler ¶
GetBodyByIDHandler handles fragment request from CS:GO client
func GetBodyHandler ¶
GetBodyHandler handles fragment request from CS:GO client
func InitMatchEngine ¶
InitMatchEngine Initializes MatchEngine
func PostBodyByIDHandler ¶
func PostBodyHandler ¶
PostBodyHandler handles fragment registration from CS:GO Server
func SyncByIDHandler ¶
SyncByIDHandler handlers request against /match/:token/sync by ID
func SyncHandler ¶
SyncHandler handlers request against /match/:token/sync
Types ¶
type Match ¶
type Match struct { sync.Mutex ID string // Manually tagged ID. Token string // Match token Auth string // auth for POST auths Startframe map[uint32]*Startframe // start frame data Fullframes map[uint32]*Fullframe // full frame data Deltaframes map[uint32]*Deltaframes // delta frame data SignupFragment uint32 // sign up fragment for /sync Tps uint32 // tickrate per secs for /sync Map string // map for /sync Protocol uint8 // protocol for /sync // RtDelay uint8 // Real-time delay: delay of this fragment from real-time, in seconds // RcVage uint8 // Receive age: how many seconds since relay last received data from game server Latest uint32 // latest fragment number }
func (*Match) GetDeltaFrame ¶ added in v1.1.0
func (m *Match) GetDeltaFrame(fragnumber uint32) (*Deltaframes, error)
func (*Match) GetStartFrame ¶ added in v1.1.0
func (m *Match) GetStartFrame(fragnumber uint32) (*Startframe, error)
func (*Match) IsSyncReady ¶ added in v1.1.0
func (*Match) RegisterDeltaFrame ¶ added in v1.1.0
func (m *Match) RegisterDeltaFrame(fragment uint32, delta *Deltaframes) error
func (*Match) RegisterFullFrame ¶ added in v1.1.0
func (*Match) RegisterStartFrame ¶ added in v1.1.0
func (m *Match) RegisterStartFrame(fragment uint32, start *Startframe, tps uint32) error
func (*Match) SaveMatchToFile ¶ added in v1.1.0
type MatchesEngine ¶
type MatchesEngine struct { sync.Mutex Matches map[string]*Match // string=token Auth string Delay uint32 }
func (*MatchesEngine) Delete ¶ added in v1.1.0
func (m *MatchesEngine) Delete(ms *Match) error
func (*MatchesEngine) GetAll ¶
func (m *MatchesEngine) GetAll() ([]*Match, error)
func (*MatchesEngine) GetMatchByID ¶
func (m *MatchesEngine) GetMatchByID(id string) (*Match, error)
func (*MatchesEngine) GetMatchByToken ¶
func (m *MatchesEngine) GetMatchByToken(token string) (*Match, error)
func (*MatchesEngine) GetTokens ¶
func (m *MatchesEngine) GetTokens() ([]string, error)
func (*MatchesEngine) LoadMatchFromFile ¶ added in v1.1.0
func (m *MatchesEngine) LoadMatchFromFile(path string) (string, error)
func (*MatchesEngine) Register ¶
func (m *MatchesEngine) Register(ms *Match)
type Startframe ¶
type SyncJSON ¶ added in v1.1.0
type SyncJSON struct { Tick uint64 `json:"tick"` Endtick uint64 `json:"endtick,omitempty"` RealTimeDelay float64 `json:"rtdelay,omitempty"` ReceiveAge float64 `json:"rcvage,omitempty"` Fragment uint32 `json:"fragment"` SignupFragment uint32 `json:"signup_fragment"` TickPerSecond uint32 `json:"tps"` KeyframeInterval float64 `json:"keyframe_interval,omitempty"` Map string `json:"map"` Protocol uint8 `json:"protocol"` }
Click to show internal directories.
Click to hide internal directories.