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.
Index ¶
- Constants
- func CheckJoin(request *gamerpc.JoinRequest) error
- func DecodeGameData(r io.Reader) (*gamerpc.GameDataRequest, error)
- func DecodeInput(r io.Reader) (*gamerpc.InputRequest, error)
- func DecodeJoin(r io.Reader) (*gamerpc.JoinRequest, error)
- func DecodeKeepalive(r io.Reader) (*gamerpc.KeepaliveRequest, error)
- func DecodeMessage(r io.Reader) (*gamerpc.MessageRequest, error)
- func DecodePing(r io.Reader) (*gamerpc.PingRequest, error)
- func DecodeQuit(r io.Reader) (*gamerpc.QuitRequest, error)
- func FindGameInstance(r *http.Request, urlstr string) (*gamerpc.GameClient, error)
- func NewGameHandler(handler func(game *gamerpc.GameClient, w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
- func ReapGameInstances(r *http.Request) (int, error)
- func UpdateGameInstance(r *http.Request, instance string, urlstr string) (*gamerpc.GameClient, error)
- type AllStatsReply
- type DatastoreGameInfo
- type GameInstance
- type InstanceStatsReply
- type InstancesReply
Constants ¶
const (
GameInstanceTimeout = 2 * time.Minute
)
const (
KeepAliveTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func CheckJoin ¶
func CheckJoin(request *gamerpc.JoinRequest) error
* Side effect: may modify team to meet the backend huntd protocol requirements
func DecodeGameData ¶
func DecodeGameData(r io.Reader) (*gamerpc.GameDataRequest, error)
func DecodeInput ¶
func DecodeInput(r io.Reader) (*gamerpc.InputRequest, error)
func DecodeJoin ¶
func DecodeJoin(r io.Reader) (*gamerpc.JoinRequest, error)
func DecodeKeepalive ¶
func DecodeKeepalive(r io.Reader) (*gamerpc.KeepaliveRequest, error)
func DecodeMessage ¶
func DecodeMessage(r io.Reader) (*gamerpc.MessageRequest, error)
func DecodePing ¶
func DecodePing(r io.Reader) (*gamerpc.PingRequest, error)
func DecodeQuit ¶
func DecodeQuit(r io.Reader) (*gamerpc.QuitRequest, error)
func FindGameInstance ¶
func NewGameHandler ¶
func NewGameHandler(handler func(game *gamerpc.GameClient, w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request)
func ReapGameInstances ¶
Deletes all instances found in the database that aren't in memcache. This technique is used because memcache is setup to expire the instances if not heard from for too long.
func UpdateGameInstance ¶
Types ¶
type AllStatsReply ¶
type AllStatsReply struct {
AllStats []*InstanceStatsReply
}
type DatastoreGameInfo ¶
type DatastoreGameInfo struct {
URL string
}
TODO(tad): this is here because Datastore can't handle the types in a gamerpc.GameClient. Ugh.
type GameInstance ¶
func GameInstances ¶
func GameInstances(r *http.Request) ([]*GameInstance, error)
type InstanceStatsReply ¶
type InstancesReply ¶
type InstancesReply struct {
InstanceIDs []string
}