Documentation
¶
Index ¶
- Constants
- type Impl
- func (impl *Impl) AcceptInvite(ctx context.Context, inviterUID string, inviteeInfo *pto.PlayerInfo, ...) error
- func (impl *Impl) CancelMatch(ctx context.Context, uid string) error
- func (impl *Impl) ChangeRole(ctx context.Context, captainUID, targetUID string, role entry.GroupRole) error
- func (impl *Impl) CreateGroup(ctx context.Context, param *pto.CreateGroup) (entry.Group, error)
- func (impl *Impl) DissolveGroup(ctx context.Context, uid string) error
- func (impl *Impl) EnterGroup(ctx context.Context, info *pto.EnterGroup, groupID int64) error
- func (impl *Impl) ExitGame(ctx context.Context, uid string, roomID int64) error
- func (impl *Impl) ExitGroup(ctx context.Context, uid string) error
- func (impl *Impl) HandleGameResult(result *pto.GameResult) error
- func (impl *Impl) HandleMatchResult(r common.Result)
- func (impl *Impl) Invite(ctx context.Context, inviterUID, inviteeUID string) error
- func (impl *Impl) KickPlayer(ctx context.Context, captainUID, kickedUID string) error
- func (impl *Impl) Ready(ctx context.Context, uid string) error
- func (impl *Impl) RefuseInvite(ctx context.Context, inviterUID, inviteeUID string, groupID int64, ...)
- func (impl *Impl) SetNearbyJoinGroup(_ context.Context, captainUID string, allow bool) error
- func (impl *Impl) SetRecentJoinGroup(_ context.Context, captainUID string, allow bool) error
- func (impl *Impl) SetVoiceState(ctx context.Context, uid string, state entry.PlayerVoiceState) error
- func (impl *Impl) StartMatch(ctx context.Context, captainUID string) error
- func (impl *Impl) Unready(ctx context.Context, uid string) error
- func (impl *Impl) UploadPlayerAttr(ctx context.Context, uid string, attr *pto.UploadPlayerAttr) error
- type Option
Constants ¶
View Source
const ( // TimerOpTypeGroupInvite used to dissolve the group if it not starts game after delay. TimerOpTypeGroupInvite timer.OpType = "match:timer_group_invite" // TimerOpTypeGroupMatch if used to cancel match if the group not matched after delay. TimerOpTypeGroupMatch timer.OpType = "match:timer_group_match" // TimerOpTypeGroupWaitAttr used to wait for players to upload attributes after client clicks `StartMatch`. // If all players upload attributes, the group would start to match. // If timeout. the group would auto start to match. TimerOpTypeGroupWaitAttr timer.OpType = "match:timer_group_wait_attr" // nolint // TimeOpTypeClearRoom used to clear room in some unexpected cases like client do not settle game. // We use this optype to force clear the room info. TimeOpTypeClearRoom timer.OpType = "match:timer_clear_room" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct { Configer config.Configer[config.MatchConfig] MSConfig config.MatchStrategy // contains filtered or unexported fields }
Impl implements a default match service, in most cases, you don't need to implement your own match service.
func NewDefault ¶
func (*Impl) AcceptInvite ¶
func (*Impl) ChangeRole ¶
func (*Impl) CreateGroup ¶
func (*Impl) EnterGroup ¶
func (*Impl) HandleGameResult ¶
func (impl *Impl) HandleGameResult(result *pto.GameResult) error
func (*Impl) HandleMatchResult ¶
func (*Impl) KickPlayer ¶
func (*Impl) RefuseInvite ¶
func (*Impl) SetNearbyJoinGroup ¶
func (*Impl) SetRecentJoinGroup ¶
func (*Impl) SetVoiceState ¶
func (*Impl) StartMatch ¶
func (*Impl) UploadPlayerAttr ¶
type Option ¶
type Option func(*Impl)
func WithMatchStrategyConfiger ¶
func WithMatchStrategyConfiger(c config.MatchStrategy) Option
func WithNowFunc ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.