game

package
v0.0.0-...-c5f9841 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2018 License: MIT Imports: 29 Imported by: 0

Documentation

Index

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)

func Kick

func Kick(uid int64) error

TODO: conc

func Recharge

func Recharge(uid, coin int64)

func Reset

func Reset(uid int64)

func SetCardConsume

func SetCardConsume(cfg string)

SetCardConsume 设置房卡消耗数量

func Startup

func Startup()

Startup 初始化游戏服务器

Types

type ClubManager

type ClubManager struct {
	component.Base
}

func (*ClubManager) ApplyClub

func (c *ClubManager) ApplyClub(s *session.Session, payload *protocol.ApplyClubRequest) error

type Crypto

type Crypto struct {
	// contains filtered or unexported fields
}

type Desk

type Desk struct {
	// contains filtered or unexported fields
}

func NewDesk

func NewDesk(roomNo room.Number, opts *protocol.DeskOptions, clubId int64) *Desk

type DeskManager

type DeskManager struct {
	component.Base
	// contains filtered or unexported fields
}

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) DingQue

func (dm *DeskManager) DingQue(s *session.Session, msg *protocol.DingQue) 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

新join在session的context中尚未有desk的cache

func (*DeskManager) OpChoose

func (dm *DeskManager) OpChoose(s *session.Session, msg *protocol.OpChooseRequest) error

func (*DeskManager) Pause

func (dm *DeskManager) Pause(s *session.Session, _ []byte) error

func (*DeskManager) QiPaiFinished

func (dm *DeskManager) QiPaiFinished(s *session.Session, msg []byte) error

理牌结束

func (*DeskManager) ReConnect

func (dm *DeskManager) ReConnect(s *session.Session, req *protocol.ReConnect) error

网络断开后, 重新连接网络

func (*DeskManager) ReEnter

应用退出后重新进入房间

func (*DeskManager) ReJoin

网络断开后, 如果ReConnect后发现当前正在房间中, 则重新进入, 桌号是之前的桌号

func (*DeskManager) Ready

func (dm *DeskManager) Ready(s *session.Session, _ []byte) error

func (*DeskManager) RecordingVoice

func (dm *DeskManager) RecordingVoice(s *session.Session, msg *protocol.RecordingVoice) error

玩家录制完语音

func (*DeskManager) Resume

func (dm *DeskManager) Resume(s *session.Session, _ []byte) 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 Loser

type Loser struct {
	// contains filtered or unexported fields
}

type Manager

type Manager struct {
	component.Base
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) AfterInit

func (m *Manager) AfterInit()

func (*Manager) CheckOrder

func (m *Manager) CheckOrder(s *session.Session, msg *protocol.CheckOrderReqeust) error

func (*Manager) Login

type Player

type Player struct {
	// contains filtered or unexported fields
}

func (*Player) Uid

func (p *Player) Uid() int64

type RechargeInfo

type RechargeInfo struct {
	Uid  int64 // 用户ID
	Coin int64 // 房卡数量
}

type ScoreChangeType

type ScoreChangeType byte
const (
	ScoreChangeTypeAnGang ScoreChangeType = iota + 1
	ScoreChangeTypeBaGang
	ScoreChangeTypeHu
)

func (ScoreChangeType) String

func (s ScoreChangeType) String() string

Directories

Path Synopsis
rule
https://www.xqbase.com/other/mahjongg_english.htm
https://www.xqbase.com/other/mahjongg_english.htm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL