Documentation ¶
Index ¶
- Constants
- Variables
- func DelMatchQueue(OpenID string)
- func DelQuitMatchList(OpenID string)
- func DoingMatch()
- func GetChanLength() int
- func GetMatchPlayer(OpenID string) bool
- func GetMatchQueue(OpenID string) bool
- func Putdata(data *player.PlayerSt)
- func SetMatchQueue(OpenID string)
- func SetQuitMatch(OpenID string)
- func Sort_timer()
- type MatchMoudle
- type PoolMatch
- type RoomMatch
- type RoomST
Constants ¶
View Source
const ( INITMATCH = iota // INITMATCH == 0 Match_1V1 // Match_1V1 == 1 Match_2V2 // Match_2V2 == 2 Match_3V3 // Match_3V3 == 3 )
Variables ¶
View Source
var ( Match_Chan chan *player.PlayerSt MatchData_Chan chan map[string]interface{} Imax int = 0 ChanMax int = 1000 MatchSpeed = time.Millisecond * 500 PlaterMatchSpeed = time.Second * 1 MatchData map[string]interface{} QuitMatchData map[string]string MatchRoomUID int = 1000 TimeOutCount int = 0 ConnMatch *websocket.Conn )
View Source
var MapMatch map[string]*RoomMatch
View Source
var MapPoolMatch1V1 chan map[int]*PoolMatch // key 是游戏ID
View Source
var PoolMax int // 匹配池的大小
View Source
var TempMatch map[string]string
Functions ¶
func DelMatchQueue ¶
func DelMatchQueue(OpenID string)
func DelQuitMatchList ¶
func DelQuitMatchList(OpenID string)
func DoingMatch ¶
func DoingMatch()
func GetChanLength ¶
func GetChanLength() int
func GetMatchPlayer ¶
func GetMatchQueue ¶
func SetMatchQueue ¶
func SetMatchQueue(OpenID string)
func SetQuitMatch ¶
func SetQuitMatch(OpenID string)
func Sort_timer ¶
func Sort_timer()
Types ¶
type MatchMoudle ¶
type PoolMatch ¶
type PoolMatch struct { OpenID string // 玩家的UID加密信息 MatchType string // 1V1 2V2 5V5 等 Connection *websocket.Conn // global服务器只是和gateway 进行链接的数据,可以忽略 MatchTime int // 玩家匹配的耗时 --- conf配置 数据需要 PlayerScore int // 玩家的分数 PlayerLev int // 玩家等级 MatchGame int // 玩家匹配的游戏 }
匹配池
func (*PoolMatch) DestroyMatch ¶
func (this *PoolMatch) DestroyMatch()
func (*PoolMatch) GetMatchResult ¶
根据匹配算法进行返回匹配结果 条件:那款游戏匹配,匹配类型(1V1) 定时器:每个秒就要匹配一次所有数据
func (*PoolMatch) MatchRecord ¶
func (this *PoolMatch) MatchRecord()
获取已经匹配的数量;数量需要记录 1 匹配的结果也是需要的发送给DB服务器,玩家登录后返回的数据自带匹配数据 2 对战记录
func (*PoolMatch) PlayerSendMessage ¶
func (this *PoolMatch) PlayerSendMessage()
发送数据给gateway server 1 这里就是并不需要过多处理
func (*PoolMatch) TimerMatch ¶
func (this *PoolMatch) TimerMatch()
Click to show internal directories.
Click to hide internal directories.