1
This commit is contained in:
parent
9ab84b3090
commit
7eae5b48ec
@ -120,6 +120,9 @@ type PlayerMgr interface {
|
||||
GetPlayerBySocket(f5.WspCliConn) Player
|
||||
}
|
||||
|
||||
type MatchMgr interface {
|
||||
}
|
||||
|
||||
type WspListener interface {
|
||||
ProcessSSMMsg(*ss.SsNetMsgHandler, *f5.MsgHdr)
|
||||
SendProxyMsg(net.Conn, uint16, proto.Message)
|
||||
|
@ -38,5 +38,6 @@ const (
|
||||
HTTP_LISTENER_MODULE_IDX
|
||||
PLAYER_MGR_MODULE_IDX
|
||||
TEAM_MGR_MODULE_IDX
|
||||
MATCH_MGR_MODULE_IDX
|
||||
MAX_MODULE_IDX
|
||||
)
|
||||
|
@ -13,12 +13,14 @@ var initOrders = []int32 {
|
||||
constant.HTTP_LISTENER_MODULE_IDX,
|
||||
constant.PLAYER_MGR_MODULE_IDX,
|
||||
constant.TEAM_MGR_MODULE_IDX,
|
||||
constant.MATCH_MGR_MODULE_IDX,
|
||||
constant.WSPLISTENER_MODULE_IDX,
|
||||
}
|
||||
|
||||
var app common.App
|
||||
var playerMgr common.PlayerMgr
|
||||
var teamMgr common.TeamMgr
|
||||
var matchMgr common.MatchMgr
|
||||
var wspListener common.WspListener
|
||||
|
||||
func GetPlayerMgr() common.PlayerMgr {
|
||||
@ -65,6 +67,10 @@ func RegModule(idx int32, m q5.Module) {
|
||||
{
|
||||
teamMgr = m.(common.TeamMgr)
|
||||
}
|
||||
case constant.MATCH_MGR_MODULE_IDX:
|
||||
{
|
||||
matchMgr = m.(common.MatchMgr)
|
||||
}
|
||||
default:
|
||||
{
|
||||
panic("unknow module")
|
||||
|
@ -6,7 +6,9 @@ import (
|
||||
)
|
||||
|
||||
var _teamMgr = new(teamMgr)
|
||||
var _matchMgr = new(matchMgr)
|
||||
|
||||
func init() {
|
||||
global.RegModule(constant.TEAM_MGR_MODULE_IDX, _teamMgr)
|
||||
global.RegModule(constant.MATCH_MGR_MODULE_IDX, _matchMgr)
|
||||
}
|
||||
|
25
server/matchserver/team/matchmgr.go
Normal file
25
server/matchserver/team/matchmgr.go
Normal file
@ -0,0 +1,25 @@
|
||||
package team
|
||||
|
||||
import (
|
||||
/*
|
||||
"q5"
|
||||
"f5"
|
||||
"cs"
|
||||
"main/common"
|
||||
"mt"*/
|
||||
)
|
||||
|
||||
type matchMgr struct {
|
||||
teamUuidHash map[string]*team
|
||||
}
|
||||
|
||||
func (this *matchMgr) Init() {
|
||||
this.teamUuidHash = make(map[string]*team)
|
||||
}
|
||||
|
||||
func (this *matchMgr) UnInit() {
|
||||
}
|
||||
|
||||
func (this *matchMgr) addMatchingTeam(team *team) {
|
||||
|
||||
}
|
@ -135,7 +135,7 @@ func (this *team) StartGame() {
|
||||
if !this.IsLock() && this.CanStartGame(this.owner) {
|
||||
if this.IsMobaMode() {
|
||||
this.state = constant.TEAM_STATE_MATCHING
|
||||
_teamMgr.addMatchingTeam(this)
|
||||
_matchMgr.addMatchingTeam(this)
|
||||
this.SendStateNotify()
|
||||
} else {
|
||||
this.state = constant.TEAM_STATE_STARTED
|
||||
|
@ -12,7 +12,6 @@ type teamMgr struct {
|
||||
cs.MsgHandlerImpl
|
||||
curIdx int64
|
||||
teamUuidHash map[string]*team
|
||||
matchingHash map[string]*team
|
||||
}
|
||||
|
||||
func (this *teamMgr) Init() {
|
||||
@ -66,7 +65,3 @@ func (this *teamMgr) OnEnterNewUser(hum common.Player) {
|
||||
func (this *teamMgr) removeTeam(teamUuid string) {
|
||||
delete(this.teamUuidHash, teamUuid)
|
||||
}
|
||||
|
||||
func (this *teamMgr) addMatchingTeam(team *team) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user