Documentation ¶
Index ¶
- Constants
- func AnnotatedChannelName(gameID string) string
- func MergeGameDocuments(dst *ipc.GameDocument, src *ipc.GameDocument) error
- type OMGWordsService
- func (gs *OMGWordsService) CreateBroadcastGame(ctx context.Context, req *connect.Request[pb.CreateBroadcastGameRequest]) (*connect.Response[pb.CreateBroadcastGameResponse], error)
- func (gs *OMGWordsService) DeleteBroadcastGame(ctx context.Context, req *connect.Request[pb.DeleteBroadcastGameRequest]) (*connect.Response[pb.DeleteBroadcastGameResponse], error)
- func (gs *OMGWordsService) GetCGP(ctx context.Context, req *connect.Request[pb.GetCGPRequest]) (*connect.Response[pb.CGPResponse], error)
- func (gs *OMGWordsService) GetGameDocument(ctx context.Context, req *connect.Request[pb.GetGameDocumentRequest]) (*connect.Response[ipc.GameDocument], error)
- func (gs *OMGWordsService) GetGamesForEditor(ctx context.Context, req *connect.Request[pb.GetGamesForEditorRequest]) (*connect.Response[pb.BroadcastGamesResponse], error)
- func (gs *OMGWordsService) GetMyUnfinishedGames(ctx context.Context, req *connect.Request[pb.GetMyUnfinishedGamesRequest]) (*connect.Response[pb.BroadcastGamesResponse], error)
- func (gs *OMGWordsService) GetRecentAnnotatedGames(ctx context.Context, req *connect.Request[pb.GetRecentAnnotatedGamesRequest]) (*connect.Response[pb.BroadcastGamesResponse], error)
- func (gs *OMGWordsService) ImportGCG(ctx context.Context, req *connect.Request[pb.ImportGCGRequest]) (*connect.Response[pb.ImportGCGResponse], error)
- func (gs *OMGWordsService) PatchGameDocument(ctx context.Context, req *connect.Request[pb.PatchDocumentRequest]) (*connect.Response[pb.GameEventResponse], error)
- func (gs *OMGWordsService) ReplaceGameDocument(ctx context.Context, req *connect.Request[pb.ReplaceDocumentRequest]) (*connect.Response[pb.GameEventResponse], error)
- func (gs *OMGWordsService) SendGameEvent(ctx context.Context, req *connect.Request[pb.AnnotatedGameEvent]) (*connect.Response[pb.GameEventResponse], error)
- func (gs *OMGWordsService) SetBroadcastGamePrivacy(ctx context.Context, req *connect.Request[pb.BroadcastGamePrivacy]) (*connect.Response[pb.GameEventResponse], error)
- func (gs *OMGWordsService) SetEventChannel(c chan *entity.EventWrapper)
- func (gs *OMGWordsService) SetRacks(ctx context.Context, req *connect.Request[pb.SetRacksEvent]) (*connect.Response[pb.GameEventResponse], error)
Constants ¶
const GamesLimit = 50
Variables ¶
This section is empty.
Functions ¶
func AnnotatedChannelName ¶
func MergeGameDocuments ¶
func MergeGameDocuments(dst *ipc.GameDocument, src *ipc.GameDocument) error
MergeGameDocuments merges the src document into the dst document. We don't use proto.Merge directly since we want to replace most arrays if they're specified in both documents.
Types ¶
type OMGWordsService ¶
type OMGWordsService struct {
// contains filtered or unexported fields
}
func NewOMGWordsService ¶
func NewOMGWordsService(u user.Store, cfg *config.Config, gs *stores.GameDocumentStore, ms *stores.DBStore) *OMGWordsService
func (*OMGWordsService) CreateBroadcastGame ¶
func (gs *OMGWordsService) CreateBroadcastGame(ctx context.Context, req *connect.Request[pb.CreateBroadcastGameRequest], ) (*connect.Response[pb.CreateBroadcastGameResponse], error)
func (*OMGWordsService) DeleteBroadcastGame ¶
func (gs *OMGWordsService) DeleteBroadcastGame(ctx context.Context, req *connect.Request[pb.DeleteBroadcastGameRequest], ) (*connect.Response[pb.DeleteBroadcastGameResponse], error)
func (*OMGWordsService) GetCGP ¶
func (gs *OMGWordsService) GetCGP(ctx context.Context, req *connect.Request[pb.GetCGPRequest], ) (*connect.Response[pb.CGPResponse], error)
func (*OMGWordsService) GetGameDocument ¶
func (gs *OMGWordsService) GetGameDocument(ctx context.Context, req *connect.Request[pb.GetGameDocumentRequest], ) (*connect.Response[ipc.GameDocument], error)
func (*OMGWordsService) GetGamesForEditor ¶
func (gs *OMGWordsService) GetGamesForEditor(ctx context.Context, req *connect.Request[pb.GetGamesForEditorRequest]) ( *connect.Response[pb.BroadcastGamesResponse], error)
func (*OMGWordsService) GetMyUnfinishedGames ¶
func (gs *OMGWordsService) GetMyUnfinishedGames(ctx context.Context, req *connect.Request[pb.GetMyUnfinishedGamesRequest]) ( *connect.Response[pb.BroadcastGamesResponse], error)
func (*OMGWordsService) GetRecentAnnotatedGames ¶
func (gs *OMGWordsService) GetRecentAnnotatedGames(ctx context.Context, req *connect.Request[pb.GetRecentAnnotatedGamesRequest]) ( *connect.Response[pb.BroadcastGamesResponse], error)
func (*OMGWordsService) ImportGCG ¶
func (gs *OMGWordsService) ImportGCG(ctx context.Context, req *connect.Request[pb.ImportGCGRequest], ) (*connect.Response[pb.ImportGCGResponse], error)
func (*OMGWordsService) PatchGameDocument ¶
func (gs *OMGWordsService) PatchGameDocument(ctx context.Context, req *connect.Request[pb.PatchDocumentRequest], ) (*connect.Response[pb.GameEventResponse], error)
PatchGameDocument merges the requested game document into the existing one. For now, we just use this to update various metadata (like description, player names, etc). Disallow updating game structures directly until the front end can implement GameDocument on its own.
func (*OMGWordsService) ReplaceGameDocument ¶
func (gs *OMGWordsService) ReplaceGameDocument(ctx context.Context, req *connect.Request[pb.ReplaceDocumentRequest], ) (*connect.Response[pb.GameEventResponse], error)
UpdateGameDocument updates a game document for an annotated game. It doesn't really have meaning outside annotated games, as players should instead use an individual event update call.
func (*OMGWordsService) SendGameEvent ¶
func (gs *OMGWordsService) SendGameEvent(ctx context.Context, req *connect.Request[pb.AnnotatedGameEvent]) ( *connect.Response[pb.GameEventResponse], error)
func (*OMGWordsService) SetBroadcastGamePrivacy ¶
func (gs *OMGWordsService) SetBroadcastGamePrivacy(ctx context.Context, req *connect.Request[pb.BroadcastGamePrivacy]) ( *connect.Response[pb.GameEventResponse], error)
func (*OMGWordsService) SetEventChannel ¶
func (gs *OMGWordsService) SetEventChannel(c chan *entity.EventWrapper)
func (*OMGWordsService) SetRacks ¶
func (gs *OMGWordsService) SetRacks(ctx context.Context, req *connect.Request[pb.SetRacksEvent], ) (*connect.Response[pb.GameEventResponse], error)
SetRacks sets the player racks per user. It checks to make sure that the rack can be set before actually setting it.