1
This commit is contained in:
parent
a77d6917c4
commit
4d819e6e3c
@ -31,7 +31,7 @@ func (this *player) GetSessionId() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) IsOnline() bool {
|
func (this *player) IsOnline() bool {
|
||||||
return true
|
return this.socket.IsValid()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) SendMsg(rspMsg proto.Message) {
|
func (this *player) SendMsg(rspMsg proto.Message) {
|
||||||
|
@ -348,6 +348,7 @@ func (this *team) genStartGameInfo() {
|
|||||||
SpecSkill int32 `json:"spec_skill"`
|
SpecSkill int32 `json:"spec_skill"`
|
||||||
HeroUniId string `json:"hero_uniid"`
|
HeroUniId string `json:"hero_uniid"`
|
||||||
IsAndroid int32 `json:"is_android"`
|
IsAndroid int32 `json:"is_android"`
|
||||||
|
RobotId int32 `json:"robot_id"`
|
||||||
} `json:"members"`
|
} `json:"members"`
|
||||||
} `json:"team_list"`
|
} `json:"team_list"`
|
||||||
ObList []struct {
|
ObList []struct {
|
||||||
@ -401,7 +402,7 @@ func (this *team) genStartGameInfo() {
|
|||||||
}
|
}
|
||||||
if this.IsMobaMode() {
|
if this.IsMobaMode() {
|
||||||
robotIdx := 0
|
robotIdx := 0
|
||||||
for i := len(ele.Members); i <= 4; i++ {
|
for i := len(ele.Members); i < 4; i++ {
|
||||||
ele2 := q5.NewSliceElement(&ele.Members)
|
ele2 := q5.NewSliceElement(&ele.Members)
|
||||||
robot := t.robotList[robotIdx]
|
robot := t.robotList[robotIdx]
|
||||||
robotIdx++
|
robotIdx++
|
||||||
@ -409,24 +410,54 @@ func (this *team) genStartGameInfo() {
|
|||||||
ele2.SpecSkill = robot.specSkill
|
ele2.SpecSkill = robot.specSkill
|
||||||
ele2.HeroUniId = ""
|
ele2.HeroUniId = ""
|
||||||
ele2.IsAndroid = 1
|
ele2.IsAndroid = 1
|
||||||
|
ele2.RobotId = robot.meta.GetId()
|
||||||
|
}
|
||||||
|
if len(teamList) < 2 {
|
||||||
|
ele := q5.NewSliceElement(&startInfo.TeamList)
|
||||||
|
ele.TeamUuid = t.GetTeamUuid() + "@"
|
||||||
|
for i := 0; i < 4; i++ {
|
||||||
|
ele2 := q5.NewSliceElement(&ele.Members)
|
||||||
|
robot := t.robotList[robotIdx]
|
||||||
|
robotIdx++
|
||||||
|
ele2.AccountId = robot.GetAccountId()
|
||||||
|
ele2.SpecSkill = robot.specSkill
|
||||||
|
ele2.HeroUniId = ""
|
||||||
|
ele2.IsAndroid = 1
|
||||||
|
ele2.RobotId = robot.meta.GetId()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
ele := *q5.NewSliceElement(&this.stateNotifyMsg.TeamList)
|
ele := q5.NewSliceElement(&this.stateNotifyMsg.TeamList)
|
||||||
ele.TeamUuid = proto.String(t.GetTeamUuid())
|
*ele = &cs.MFTeam{}
|
||||||
|
(*ele).TeamUuid = proto.String(t.GetTeamUuid())
|
||||||
for _, m := range t.memberIdHash {
|
for _, m := range t.memberIdHash {
|
||||||
m_pb := q5.NewSliceElement(&ele.Members)
|
m_pb := q5.NewSliceElement(&(*ele).Members)
|
||||||
|
*m_pb = &cs.MFTeamMember{}
|
||||||
m.FillMFTeamMember(*m_pb)
|
m.FillMFTeamMember(*m_pb)
|
||||||
}
|
}
|
||||||
if this.IsMobaMode() {
|
if this.IsMobaMode() {
|
||||||
robotIdx := 0
|
robotIdx := 0
|
||||||
for i := len(ele.Members); i <= 4; i++ {
|
for i := len((*ele).Members); i < 4; i++ {
|
||||||
robot := t.robotList[robotIdx]
|
robot := t.robotList[robotIdx]
|
||||||
robotIdx++
|
robotIdx++
|
||||||
m_pb := q5.NewSliceElement(&ele.Members)
|
m_pb := q5.NewSliceElement(&(*ele).Members)
|
||||||
|
*m_pb = &cs.MFTeamMember{}
|
||||||
robot.FillMFTeamMember(*m_pb)
|
robot.FillMFTeamMember(*m_pb)
|
||||||
}
|
}
|
||||||
|
if len(teamList) < 2 {
|
||||||
|
ele := q5.NewSliceElement(&this.stateNotifyMsg.TeamList)
|
||||||
|
*ele = &cs.MFTeam{}
|
||||||
|
(*ele).TeamUuid = proto.String(t.GetTeamUuid())
|
||||||
|
for i := 0; i < 4; i++ {
|
||||||
|
robot := t.robotList[robotIdx]
|
||||||
|
robotIdx++
|
||||||
|
m_pb := q5.NewSliceElement(&(*ele).Members)
|
||||||
|
*m_pb = &cs.MFTeamMember{}
|
||||||
|
robot.FillMFTeamMember(*m_pb)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,5 +548,24 @@ func newTeam() *team {
|
|||||||
t.stateNotifyMsg.JoinMsg = &cs.MFJoinMsg{}
|
t.stateNotifyMsg.JoinMsg = &cs.MFJoinMsg{}
|
||||||
t.memberIdHash = map[string]common.Player{}
|
t.memberIdHash = map[string]common.Player{}
|
||||||
t.robotList = []*robot{}
|
t.robotList = []*robot{}
|
||||||
|
{
|
||||||
|
cb := func (meta *mt.Robot) bool {
|
||||||
|
for _, ele := range(t.robotList) {
|
||||||
|
if meta == ele.meta {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
for i := 0; i < 8; i++ {
|
||||||
|
robotMeta := mt.Table.Robot.RandElementExclude(cb)
|
||||||
|
if robotMeta != nil {
|
||||||
|
robot := new(robot)
|
||||||
|
robot.meta = robotMeta
|
||||||
|
robot.specSkill = 0
|
||||||
|
q5.AppendSlice(&t.robotList, robot)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
2
third_party/f5
vendored
2
third_party/f5
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 5fe4ba1d1fd4b3e3d9ad6d4a77c2594e8f4df6c2
|
Subproject commit b934782a3863f2687e720e007981a58b70087077
|
Loading…
x
Reference in New Issue
Block a user