Documentation ¶
Index ¶
- Constants
- func NetBrokerDelay(server string) (map[string]int, error)
- type Client
- func (c *Client) BrokerVersion() (byte, string)
- func (c *Client) Close()
- func (c *Client) Connect() error
- func (c *Client) LocalPort() int
- func (c *Client) PeerHost() string
- func (c *Client) Ping() time.Duration
- func (c *Client) Serve(readFunc, writeFunc utils.PluginCallback, plRoutine utils.PluginGoroutine, ...) error
- func (c *Client) ServerHost() string
- func (c *Client) Serving() bool
- func (c *Client) TunnelDelay() time.Duration
- func (c *Client) TunnelStatus() utils.TunnelStatus
- func (c *Client) TunnelType() string
- func (c *Client) Version() (byte, string, string)
- type Hisoutensoku
- func (h *Hisoutensoku) GetReplayDelay() time.Duration
- func (h *Hisoutensoku) GetSpectatorCount() int
- func (h *Hisoutensoku) GoroutineFunc(tunnelConn interface{}, _ *net.UDPConn)
- func (h *Hisoutensoku) ReadFunc(orig []byte) (bool, []byte)
- func (h *Hisoutensoku) SetQuitFlag()
- func (h *Hisoutensoku) WriteFunc(orig []byte) (bool, []byte)
- type Hyouibana
- type Status123peer
Constants ¶
View Source
const ( DefaultLocalPort = 10800 DefaultServerHost = "thlink.inuyasha.love:4646" DefaultTunnelType = "tcp" )
View Source
const ( HELLO_123 type123pkg = iota + 1 // 0x01 PUNCH_123 // 0x02 OLLEH_123 // 0x03 CHAIN_123 // 0x04 INIT_REQUEST_123 // 0x05 INIT_SUCCESS_123 // 0x06 INIT_ERROR_123 // 0x07 REDIRECT_123 // 0x08 QUIT_123 type123pkg = iota + 3 // 0x0b HOST_GAME_123 type123pkg = iota + 4 // 0x0d CLIENT_GAME_123 // 0x0e SOKUROLL_TIME type123pkg = iota + 5 // 0x10 SOKUROLL_TIME_ACK // 0x11 SOKUROLL_STATE // 0x12 SOKUROLL_SETTINGS // 0x13 SOKUROLL_SETTINGS_ACK // 0x14 )
View Source
const ( GAME_LOADED_123 data123pkg = iota + 1 // 0x01 GAME_LOADED_ACK_123 // 0x02 GAME_INPUT_123 // 0x03 GAME_MATCH_123 // 0x04 GAME_MATCH_ACK_123 // 0x05 GAME_MATCH_REQUEST_123 data123pkg = iota + 3 // 0x08 GAME_REPLAY_123 // 0x09 GAME_REPLAY_REQUEST_123 data123pkg = iota + 4 // 0x0b )
View Source
const ( NOSPECTATE_123 spectate123type = 0x00 SPECTATE_123 spectate123type = 0x10 SPECTATE_FOR_SPECTATOR_123 spectate123type = 0x11 )
View Source
const ( INIT_123 status123req = iota SEND_123 SENT0_123 SENT1_123 SEND_AGAIN_123 )
View Source
const ( CLIENT_T_ACK_155 type155pkg = iota // 0x00 HOST_T_ACK_155 // 0x01 INIT_ACK_155 type155pkg = iota + 2 // 0x04 HOST_T_155 // 0x05 CLIENT_T_155 // 0x06 PUNCH_155 // 0x07 INIT_155 // 0x08 INIT_REQUEST_155 // 0x09 INIT_SUCCESS_155 type155pkg = iota + 3 // 0x0b INIT_ERROR_155 // 0x0c HOST_QUIT_155 type155pkg = iota + 5 // 0x0f CLIENT_QUIT_155 // 0x10 HOST_GAME_155 type155pkg = iota + 6 // 0x12 CLIENT_GAME_155 // 0x13 )
View Source
const ( GAME_SELECT_155 data155pkg = iota + 4 // 0x04 GAME_INPUT_155 data155pkg = iota + 5 // 0x06 GAME_REPLAY_REQUEST_155 data155pkg = iota + 7 // 0x09 GAME_REPLAY_MATCH_155 // 0x0a GAME_REPLAY_DATA_155 // 0x0b GAME_REPLAY_END_155 // 0x0c )
View Source
const ( MATCH_WAIT_155 match155status = iota // no game start MATCH_ACCEPT_155 // peer connected MATCH_SPECT_ACK_155 MATCH_SPECT_INIT_155 MATCH_SPECT_SUCCESS_155 // fetching replay data MATCH_SPECT_ERROR_155 // cannot get replay data )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v0.0.7
type Client struct {
// contains filtered or unexported fields
}
func NewWithDefault ¶ added in v0.0.7
func NewWithDefault() *Client
NewWithDefault set up default client
func (*Client) BrokerVersion ¶ added in v0.0.9
BrokerVersion get broker tunnel version
func (*Client) Serve ¶ added in v0.0.7
func (c *Client) Serve(readFunc, writeFunc utils.PluginCallback, plRoutine utils.PluginGoroutine, plQuit utils.PluginSetQuitFlag) error
func (*Client) ServerHost ¶ added in v0.0.7
ServerHost get client config server host
func (*Client) TunnelDelay ¶ added in v0.0.7
TunnelDelay ping delay between client and broker
func (*Client) TunnelStatus ¶ added in v0.0.11
func (c *Client) TunnelStatus() utils.TunnelStatus
TunnelStatus get tunnel status
func (*Client) TunnelType ¶ added in v0.0.7
TunnelType get client config tunnel type tcp/quic
type Hisoutensoku ¶ added in v0.0.9
type Hisoutensoku struct { PeerStatus Status123peer // current peer status // contains filtered or unexported fields }
func NewHisoutensoku ¶ added in v0.0.9
func NewHisoutensoku() *Hisoutensoku
NewHisoutensoku new Hisoutensoku spectating server
func (*Hisoutensoku) GetReplayDelay ¶ added in v0.0.10
func (h *Hisoutensoku) GetReplayDelay() time.Duration
func (*Hisoutensoku) GetSpectatorCount ¶ added in v0.0.10
func (h *Hisoutensoku) GetSpectatorCount() int
func (*Hisoutensoku) GoroutineFunc ¶ added in v0.0.9
func (h *Hisoutensoku) GoroutineFunc(tunnelConn interface{}, _ *net.UDPConn)
func (*Hisoutensoku) ReadFunc ¶ added in v0.0.9
func (h *Hisoutensoku) ReadFunc(orig []byte) (bool, []byte)
ReadFunc from game client to host orig: original data leads with 1 byte of client id
func (*Hisoutensoku) SetQuitFlag ¶ added in v0.0.11
func (h *Hisoutensoku) SetQuitFlag()
type Hyouibana ¶ added in v0.0.11
type Hyouibana struct { MatchStatus match155status // current match status // contains filtered or unexported fields }
func NewHyouibana ¶ added in v0.0.11
func NewHyouibana() *Hyouibana
NewHyouibana new Hyouibana spectating server
func (*Hyouibana) GetSpectatorCount ¶ added in v0.0.11
func (*Hyouibana) GoroutineFunc ¶ added in v0.0.11
func (*Hyouibana) ReadFunc ¶ added in v0.0.11
ReadFunc from game client to host orig: original data leads with 1 byte of client id
func (*Hyouibana) SetQuitFlag ¶ added in v0.0.11
func (h *Hyouibana) SetQuitFlag()
type Status123peer ¶ added in v0.0.9
type Status123peer byte
const ( INACTIVE_123 Status123peer = iota SUCCESS_123 BATTLE_123 BATTLE_WAIT_ANOTHER_123 )
Click to show internal directories.
Click to hide internal directories.