Documentation
¶
Index ¶
- Constants
- Variables
- func AdvanceFrame(inputs []byte, disconnectFlags int64)
- func BoolToByte(inputs [input.ActionLast]bool) []byte
- func ByteToBool(inputs []byte) [input.ActionLast]bool
- func DisconnectPlayer(player int64)
- func GetCurrentTimeMS() uint64
- func Idle()
- func Init(numPlayers int64, players []ggponet.GGPOPlayer, localPort string, ...)
- func InitSpectator(numPlayers int64, hostIp string, hostPort uint64)
- func RandBoolSlice() [input.ActionLast]bool
- func RunFrame()
- type Callbacks
- func (c *Callbacks) AdvanceFrame(flags int64)
- func (c *Callbacks) BeginGame(game string) bool
- func (c *Callbacks) LoadGameState(buffer []byte, length int64)
- func (c *Callbacks) LogGameState(filename string, buffer *byte, len int64)
- func (c *Callbacks) OnEvent(info *ggponet.GGPOEvent)
- func (c *Callbacks) SaveGameState(buffer []byte, length *int64, checksum *int64, frame int64)
- type ChecksumInfo
- type NonGameState
- func (n *NonGameState) SetAllConnectState(state PlayerConnectState)
- func (n *NonGameState) SetConnectState(handle ggponet.GGPOPlayerHandle, state PlayerConnectState)
- func (n *NonGameState) SetDisconnectTimeout(handle ggponet.GGPOPlayerHandle, when int64, timeout int64)
- func (n *NonGameState) UpdateConnectProgress(handle ggponet.GGPOPlayerHandle, progress int64)
- type PlayerConnectState
- type PlayerConnectionInfo
Constants ¶
View Source
const MAX_PLAYERS = 64
Variables ¶
View Source
var FRAME_DELAY int64 = 2 // default frame delay set to 2, could use ping instead
View Source
var MAX_FRAME_DELAY int64 = 6
View Source
var Synchronized = false
Functions ¶
func AdvanceFrame ¶
func BoolToByte ¶
func BoolToByte(inputs [input.ActionLast]bool) []byte
func ByteToBool ¶
func ByteToBool(inputs []byte) [input.ActionLast]bool
func DisconnectPlayer ¶
func DisconnectPlayer(player int64)
func GetCurrentTimeMS ¶
func GetCurrentTimeMS() uint64
func InitSpectator ¶
func RandBoolSlice ¶
func RandBoolSlice() [input.ActionLast]bool
Types ¶
type Callbacks ¶
type Callbacks struct{}
func (*Callbacks) AdvanceFrame ¶
func (*Callbacks) LoadGameState ¶
func (*Callbacks) LogGameState ¶
type ChecksumInfo ¶
type NonGameState ¶
type NonGameState struct { LocalPlayerHandle ggponet.GGPOPlayerHandle Players [MAX_PLAYERS]PlayerConnectionInfo NumPlayers int64 Now ChecksumInfo Periodic ChecksumInfo }
func (*NonGameState) SetAllConnectState ¶
func (n *NonGameState) SetAllConnectState(state PlayerConnectState)
func (*NonGameState) SetConnectState ¶
func (n *NonGameState) SetConnectState(handle ggponet.GGPOPlayerHandle, state PlayerConnectState)
func (*NonGameState) SetDisconnectTimeout ¶
func (n *NonGameState) SetDisconnectTimeout(handle ggponet.GGPOPlayerHandle, when int64, timeout int64)
func (*NonGameState) UpdateConnectProgress ¶
func (n *NonGameState) UpdateConnectProgress(handle ggponet.GGPOPlayerHandle, progress int64)
type PlayerConnectState ¶
type PlayerConnectState int64
const ( Connecting PlayerConnectState = 0 Synchronizing PlayerConnectState = 1 Running PlayerConnectState = 2 Disconnected PlayerConnectState = 3 Disconnecting PlayerConnectState = 4 )
type PlayerConnectionInfo ¶
type PlayerConnectionInfo struct { Type ggponet.GGPOPlayerType Handle ggponet.GGPOPlayerHandle State PlayerConnectState ConnectProgress int64 DisconnectTimeout int64 DisconnectStart int64 }
Click to show internal directories.
Click to hide internal directories.