Documentation ¶
Index ¶
- Constants
- Variables
- func BroadcastSystemMessage(message string)
- func Kick(uid int64) error
- func Recharge(uid, coin int64)
- func Reset(uid int64)
- func SetCardConsume(cfg string)
- func Startup()
- type ClubManager
- type Crypto
- type Desk
- type DeskManager
- func (dm *DeskManager) AfterInit()
- func (dm *DeskManager) ClientInitCompleted(s *session.Session, msg *protocol.ClientInitCompletedRequest) error
- func (dm *DeskManager) CreateDesk(s *session.Session, data *protocol.CreateDeskRequest) error
- func (dm *DeskManager) DingQue(s *session.Session, msg *protocol.DingQue) error
- func (dm *DeskManager) Dissolve(s *session.Session, msg []byte) error
- func (dm *DeskManager) DissolveStatus(s *session.Session, data *protocol.DissolveStatusRequest) error
- func (dm *DeskManager) Exit(s *session.Session, msg *protocol.ExitRequest) error
- func (dm *DeskManager) Join(s *session.Session, data *protocol.JoinDeskRequest) error
- func (dm *DeskManager) OpChoose(s *session.Session, msg *protocol.OpChooseRequest) error
- func (dm *DeskManager) Pause(s *session.Session, _ []byte) error
- func (dm *DeskManager) QiPaiFinished(s *session.Session, msg []byte) error
- func (dm *DeskManager) ReConnect(s *session.Session, req *protocol.ReConnect) error
- func (dm *DeskManager) ReEnter(s *session.Session, msg *protocol.ReEnterDeskRequest) error
- func (dm *DeskManager) ReJoin(s *session.Session, data *protocol.ReJoinDeskRequest) error
- func (dm *DeskManager) Ready(s *session.Session, _ []byte) error
- func (dm *DeskManager) RecordingVoice(s *session.Session, msg *protocol.RecordingVoice) error
- func (dm *DeskManager) Resume(s *session.Session, _ []byte) error
- func (dm *DeskManager) UnCompleteDesk(s *session.Session, _ []byte) error
- func (dm *DeskManager) VoiceMessage(s *session.Session, msg []byte) error
- type Loser
- type Manager
- type Player
- type RechargeInfo
- type ScoreChangeType
Constants ¶
View Source
const ( ResultIllegal = 0 ResultZiMo = 1 ResultHu = 2 ResultPao = 3 ResultPei = 4 )
View Source
const ( ApplyDissolve = "申请解散" AgreeRequest = "同意解散" Offline = "离线" Waiting = "等待中" )
View Source
const ( ModeTrios = 3 // 三人模式 ModeFours = 4 // 四人模式 )
Variables ¶
View Source
var ErrModeCannotQue = errors.New("当前不为4人模式,不能定缺")
Functions ¶
func BroadcastSystemMessage ¶
func BroadcastSystemMessage(message string)
Types ¶
type ClubManager ¶
func (*ClubManager) ApplyClub ¶
func (c *ClubManager) ApplyClub(s *session.Session, payload *protocol.ApplyClubRequest) error
type DeskManager ¶
func NewDeskManager ¶
func NewDeskManager() *DeskManager
func (*DeskManager) AfterInit ¶
func (dm *DeskManager) AfterInit()
func (*DeskManager) ClientInitCompleted ¶
func (dm *DeskManager) ClientInitCompleted(s *session.Session, msg *protocol.ClientInitCompletedRequest) error
func (*DeskManager) CreateDesk ¶
func (dm *DeskManager) CreateDesk(s *session.Session, data *protocol.CreateDeskRequest) error
创建一张桌子
func (*DeskManager) Dissolve ¶
func (dm *DeskManager) Dissolve(s *session.Session, msg []byte) error
有玩家请求解散房间
func (*DeskManager) DissolveStatus ¶
func (dm *DeskManager) DissolveStatus(s *session.Session, data *protocol.DissolveStatusRequest) error
玩家同意或拒绝解散房间请求
func (*DeskManager) Exit ¶
func (dm *DeskManager) Exit(s *session.Session, msg *protocol.ExitRequest) error
Exit 处理玩家退出, 客户端会在房间人没有满的情况下发送DeskManager.Exit消息, 如果人满, 或游戏 开始, 客户端则发送DeskManager.Dissolve申请解散
func (*DeskManager) Join ¶
func (dm *DeskManager) Join(s *session.Session, data *protocol.JoinDeskRequest) error
新join在session的context中尚未有desk的cache
func (*DeskManager) OpChoose ¶
func (dm *DeskManager) OpChoose(s *session.Session, msg *protocol.OpChooseRequest) error
func (*DeskManager) QiPaiFinished ¶
func (dm *DeskManager) QiPaiFinished(s *session.Session, msg []byte) error
理牌结束
func (*DeskManager) ReEnter ¶
func (dm *DeskManager) ReEnter(s *session.Session, msg *protocol.ReEnterDeskRequest) error
应用退出后重新进入房间
func (*DeskManager) ReJoin ¶
func (dm *DeskManager) ReJoin(s *session.Session, data *protocol.ReJoinDeskRequest) error
网络断开后, 如果ReConnect后发现当前正在房间中, 则重新进入, 桌号是之前的桌号
func (*DeskManager) RecordingVoice ¶
func (dm *DeskManager) RecordingVoice(s *session.Session, msg *protocol.RecordingVoice) error
玩家录制完语音
func (*DeskManager) UnCompleteDesk ¶
func (dm *DeskManager) UnCompleteDesk(s *session.Session, _ []byte) error
检查登录玩家关闭应用之前是否正在游戏
func (*DeskManager) VoiceMessage ¶
func (dm *DeskManager) VoiceMessage(s *session.Session, msg []byte) error
玩家语音消息
type RechargeInfo ¶
type ScoreChangeType ¶
type ScoreChangeType byte
const ( ScoreChangeTypeAnGang ScoreChangeType = iota + 1 ScoreChangeTypeBaGang ScoreChangeTypeHu )
func (ScoreChangeType) String ¶
func (s ScoreChangeType) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.