1
This commit is contained in:
parent
7204cfe4a1
commit
ee1e393288
@ -20,6 +20,11 @@ type player struct {
|
|||||||
heroId string
|
heroId string
|
||||||
headFrame string
|
headFrame string
|
||||||
ping int32
|
ping int32
|
||||||
|
isLeader int32
|
||||||
|
specSkill int32
|
||||||
|
state int32
|
||||||
|
isReady int32
|
||||||
|
permission int32
|
||||||
team common.Team
|
team common.Team
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +130,20 @@ func (this *player) GetTeam() common.Team {
|
|||||||
return this.team
|
return this.team
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) FillMFTeamMember(team_pb *cs.MFTeamMember) {
|
func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
|
||||||
|
member_pb.AccountId = proto.String(this.accountId)
|
||||||
|
member_pb.Name = proto.String(this.name)
|
||||||
|
member_pb.IsLeader = proto.Int32(this.isLeader)
|
||||||
|
member_pb.SpecSkill = proto.Int32(this.specSkill)
|
||||||
|
//hero
|
||||||
|
member_pb.State = proto.Int32(this.state)
|
||||||
|
if this.IsOnline() {
|
||||||
|
member_pb.Online = proto.Int32(1)
|
||||||
|
} else {
|
||||||
|
member_pb.Online = proto.Int32(0)
|
||||||
|
}
|
||||||
|
member_pb.Permission = proto.Int32(this.permission)
|
||||||
|
member_pb.IsReady = proto.Int32(this.isReady)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) {
|
func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) {
|
||||||
|
@ -131,6 +131,7 @@ message MFTeam
|
|||||||
optional string team_uuid = 1; //队伍唯一id
|
optional string team_uuid = 1; //队伍唯一id
|
||||||
repeated MFTeamMember members = 2; //成员信息
|
repeated MFTeamMember members = 2; //成员信息
|
||||||
optional string next_team_uuid = 3; //下一次队伍唯一id
|
optional string next_team_uuid = 3; //下一次队伍唯一id
|
||||||
|
optional int32 map_id = 4; //地图id
|
||||||
}
|
}
|
||||||
|
|
||||||
//登录
|
//登录
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package team
|
package team
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"q5"
|
||||||
"cs"
|
"cs"
|
||||||
"main/common"
|
"main/common"
|
||||||
|
|
||||||
@ -10,9 +11,11 @@ import (
|
|||||||
type team struct {
|
type team struct {
|
||||||
cs.MsgHandlerImpl
|
cs.MsgHandlerImpl
|
||||||
teamUuid string
|
teamUuid string
|
||||||
|
nextTeamUuid string
|
||||||
isCopy bool
|
isCopy bool
|
||||||
zoneId int32
|
zoneId int32
|
||||||
nodeId int32
|
nodeId int32
|
||||||
|
mapId int32
|
||||||
owner common.Player
|
owner common.Player
|
||||||
accountIdHash map[string]common.Player
|
accountIdHash map[string]common.Player
|
||||||
}
|
}
|
||||||
@ -87,6 +90,16 @@ func (this *team) broadcastMsg(msg proto.Message) {
|
|||||||
|
|
||||||
func (this *team) SendUpdateNotify() {
|
func (this *team) SendUpdateNotify() {
|
||||||
notifyMsg := &cs.SMTeamUpdateNotify{}
|
notifyMsg := &cs.SMTeamUpdateNotify{}
|
||||||
|
notifyMsg.TeamInfo = &cs.MFTeam{}
|
||||||
|
notifyMsg.TeamInfo.TeamUuid = proto.String(this.teamUuid)
|
||||||
|
notifyMsg.TeamInfo.NextTeamUuid = proto.String(this.nextTeamUuid)
|
||||||
|
notifyMsg.TeamInfo.MapId = proto.Int32(this.mapId)
|
||||||
|
q5.NewSlice(¬ifyMsg.TeamInfo.Members, 0, 1)
|
||||||
|
for _, m := range this.accountIdHash {
|
||||||
|
m_pb := &cs.MFTeamMember{}
|
||||||
|
q5.AppendSlice(¬ifyMsg.TeamInfo.Members, m_pb)
|
||||||
|
m.FillMFTeamMember(m_pb)
|
||||||
|
}
|
||||||
this.broadcastMsg(notifyMsg)
|
this.broadcastMsg(notifyMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user