Documentation ¶
Index ¶
- Variables
- func MapStructsToTables(dbmap *gorp.DbMap)
- type BgPartialData
- type BgScoreSupport
- type CheckRoomResult
- type ConnectedResponse
- type ConnectionSummary
- type ErrorMessage
- type Method
- type MstrBoardgame
- type MstrColor
- type MstrUser
- type PlayerInfoSet
- type PointResponse
- type RoomInfoSet
- type RoomResponse
- type RoomSummary
- type TranOwn
- type WsRequest
- type WsResponse
Constants ¶
This section is empty.
Variables ¶
var BgScore = map[string]BgPartialData{}
<summary>: 対応しているボードゲームの情報
var ErrBoardgameNotFound = ErrorMessage{
Error: "E003",
Message: "指定されたボードゲームは存在しません",
}
<summary>: 【エラー】対象のボードゲーム情報が存在しません
var ErrConnectionNotFound = ErrorMessage{
Error: "E002",
Message: "指定された接続元は存在しません",
}
<summary>: 【エラー】対象の接続が存在しません
var ErrEnteredAnotherRoom = ErrorMessage{
Error: "E201",
Message: "一つの部屋へ既に入室しています",
}
<summary>: 【エラー】別室へ既に入室している
var ErrIllegalConnId = ErrorMessage{
Error: "E102",
Message: "不正なconnection_idが検知されました",
}
<summary>: 【エラー】不正なConnectionID
var ErrInvalidMethod = ErrorMessage{
Error: "E101",
Message: "無効なメソッドが指定されました",
}
<summary>: 【エラー】無効なメソッド
var ErrMismatchGame = ErrorMessage{
Error: "E203",
Message: "指定された部屋のゲーム内容が違います",
}
<summary>: 【エラー】部屋のゲーム内容に誤りがある
var ErrNotInRoom = ErrorMessage{
Error: "E004",
Message: "指定された部屋にまだ入室していません",
}
<summary>: 【エラー】部屋の中に入室していません
var ErrRoomExisted = ErrorMessage{
Error: "E202",
Message: "指定された部屋は既に存在しています",
}
<summary>: 【エラー】部屋が既に存在します
var ErrRoomNotFound = ErrorMessage{
Error: "E001",
Message: "指定された部屋は存在しません",
}
<summary>: 【エラー】部屋が存在しません
var ErrSameColorExistedInRoom = ErrorMessage{
Error: "E204",
Message: "指定された部屋には既に同色のプレイヤーが入室しています",
}
<summary>: 【エラー】部屋に同じ色のプレイヤーが参加しようとしている
Functions ¶
func MapStructsToTables ¶
MapStructsToTables 構造体と物理テーブルの紐付け
Types ¶
type BgPartialData ¶
type BgPartialData struct { Title string `json:"title"` MinPlayers int `json:"min_players"` MaxPlayers int `json:"max_players"` Colors []string `json:"colors"` }
<summary>: スコアツール対応のボードゲームデータを格納します
type BgScoreSupport ¶
type CheckRoomResult ¶
<summary>: 部屋の存在確認に使用される構造体
type ConnectedResponse ¶
type ConnectedResponse struct {
ConnId string `json:"connection_id"`
}
<summary>: 接続時、Response内のParamsに使用される構造体
type ConnectionSummary ¶
type ConnectionSummary struct { ConnId string `json:"connection_id"` RoomId string `json:"room_id"` GameId string `json:"game_id"` GameData BgPartialData `json:"gama_data"` PlayerColor string `json:"player_color"` OtherPlayers []PlayerInfoSet `json:"other_players"` }
<summary>: 接続情報を一覧表示するための構造体
type ErrorMessage ¶
<summary>: エラーに関する情報を格納する構造体
type MstrBoardgame ¶
type MstrBoardgame struct { Id string `db:"id, primarykey" json:"id"` UniqueName string `db:"unique_name" json:"unique_name"` Title string `db:"title" json:"title"` MinPlayers int `db:"min_players" json:"min_players"` MaxPlayers int `db:"max_players" json:"max_players"` PlayingTime string `db:"playing_time" json:"playing_time"` MinAge int `db:"min_age" json:"min_age"` IsExpansion bool `db:"is_expansion" json:"is_expansion"` ExpansionBaseId string `db:"expansion_base_id" json:"expansion_base_id"` ProductUrl string `db:"product_url" json:"product_url"` BodogeHoobbyNet bool `db:"bodoge_hoobby_net" json:"bodoge_hoobby_net"` ScoreTool bool `db:"score_tool" json:"score_tool"` }
type PlayerInfoSet ¶
type PlayerInfoSet struct { ConnId string `json:"connection_id"` PlayerColor string `json:"player_color"` }
<summary>: プレーヤーの情報
type PointResponse ¶
type PointResponse struct { Player PlayerInfoSet `json:"player"` Points []int `json:"points"` }
<summary>: 得点のブロードキャスト時、Response内のParamsに使用される構造体
type RoomInfoSet ¶
type RoomInfoSet struct { GameId string `json:"game_id"` Players []PlayerInfoSet `json:"players"` }
<summary>: 部屋のゲーム内容と部屋にいるプレーヤー情報
type RoomResponse ¶
type RoomResponse struct { IsWait bool `json:"is_wait"` RoomInfo RoomInfoSet `json:"room"` }
<summary>: 部屋の情報伝達時、Response内のParamsに使用される構造体
type RoomSummary ¶
type RoomSummary struct { RoomId string `json:"room_id"` GameId string `json:"game_id"` GameData BgPartialData `json:"gama_data"` Players []PlayerInfoSet `json:"players"` }
<summary>: 部屋情報を一覧表示するための構造体
type WsRequest ¶
type WsRequest struct { Method string `json:"method"` ConnId string `json:"connection_id"` RoomId string `json:"room_id"` GameId string `json:"game_id"` PlayerColor string `json:"player_color"` Points []int `json:"points"` }
<summary>: WebSocketでの受信用データの構造体
type WsResponse ¶
type WsResponse struct { Method string `json:"method"` Params interface{} `json:"params"` }
<summary>: WebSocketからの返却用データの構造体