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