Documentation ¶
Overview ¶
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Copyright 2016 The Web BSD Hunt Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment.
Index ¶
- Constants
- func ContentTypeIsJSON(header http.Header) error
- func StringToRpcType(str string) (int, error)
- type ConnectEvent
- type GameClient
- func (gc *GameClient) GameData(r *http.Request, req *GameDataRequest) (*GameDataReply, error)
- func (gc *GameClient) Input(r *http.Request, req *InputRequest) (*InputReply, error)
- func (gc *GameClient) Join(r *http.Request, req *JoinRequest) (*JoinReply, error)
- func (gc *GameClient) Message(r *http.Request, req *MessageRequest) (*MessageReply, error)
- func (gc *GameClient) Ping(r *http.Request, req *PingRequest) (*PingReply, error)
- func (gc *GameClient) Quit(r *http.Request, req *QuitRequest) (*QuitReply, error)
- func (gc *GameClient) Stats(r *http.Request, req *StatsRequest) (*StatsReply, error)
- type GameDataReply
- type GameDataRequest
- type GameServer
- type HTTPServerExit
- type InputReply
- type InputRequest
- type JoinReply
- type JoinRequest
- type KeepaliveReply
- type KeepaliveRequest
- type MessageArgs
- type MessageReply
- type MessageRequest
- type PingReply
- type PingRequest
- type QuitReply
- type QuitRequest
- type StatsReply
- type StatsRequest
Constants ¶
const ( ServerVersion = 0xFFFFFFFF C_PLAYER = 0 // response: game play tcp port C_MONITOR = 1 // response: like C_PLAYER, but no response if 0 players C_MESSAGE = 2 // response: number of players currently in the game C_SCORES = 3 // response: statistics tcp port Q_CLOAK = 1 // enter: cloaked Q_FLY = 2 // enter: flying Q_SCAN = 3 // enter: scanning )
const ( GR_NETRPC = iota + 1 GR_JSONRPC )
Variables ¶
This section is empty.
Functions ¶
func ContentTypeIsJSON ¶
TODO(tadhunt): find a better home for this
func StringToRpcType ¶
Types ¶
type ConnectEvent ¶
type GameClient ¶
func NewGameClient ¶
func NewGameClient(ustr string, rpcTypeStr string, rpOptions uint64) (*GameClient, error)
func (*GameClient) GameData ¶
func (gc *GameClient) GameData(r *http.Request, req *GameDataRequest) (*GameDataReply, error)
func (*GameClient) Input ¶
func (gc *GameClient) Input(r *http.Request, req *InputRequest) (*InputReply, error)
func (*GameClient) Join ¶
func (gc *GameClient) Join(r *http.Request, req *JoinRequest) (*JoinReply, error)
func (*GameClient) Message ¶
func (gc *GameClient) Message(r *http.Request, req *MessageRequest) (*MessageReply, error)
func (*GameClient) Ping ¶
func (gc *GameClient) Ping(r *http.Request, req *PingRequest) (*PingReply, error)
func (*GameClient) Quit ¶
func (gc *GameClient) Quit(r *http.Request, req *QuitRequest) (*QuitReply, error)
func (*GameClient) Stats ¶
func (gc *GameClient) Stats(r *http.Request, req *StatsRequest) (*StatsReply, error)
type GameDataReply ¶
type GameDataRequest ¶
type GameServer ¶
type GameServer struct {
// contains filtered or unexported fields
}
func NewGameServer ¶
type HTTPServerExit ¶
type HTTPServerExit struct {
// contains filtered or unexported fields
}
type InputReply ¶
type InputRequest ¶
type JoinRequest ¶
type KeepaliveReply ¶
type KeepaliveReply struct {
Seq uint64
}
type KeepaliveRequest ¶
type KeepaliveRequest struct {
Seq uint64
}
type MessageArgs ¶
type MessageReply ¶
type MessageReply struct {
Token int
}
type MessageRequest ¶
type MessageRequest struct { Token int Join JoinRequest Message string }
type PingRequest ¶
type QuitRequest ¶
type StatsReply ¶
type StatsRequest ¶
type StatsRequest struct {
Token int
}