29 lines
740 B
Go
29 lines
740 B
Go
package pvp
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) InCmdCheck(session comm.IUserSession, req *pb.PvpInCmdReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
///设置战斗阵型
|
|
func (this *apiComp) InCmd(session comm.IUserSession, req *pb.PvpInCmdReq) (code pb.ErrorCode, data proto.Message) {
|
|
if code = this.InCmdCheck(session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
if code = this.module.battle.InCmdBattle(&pb.BattleInCmdReq{
|
|
Battleid: req.Battleid,
|
|
In: req.Cmd,
|
|
}); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "incmd", &pb.PvpInCmdResp{Battleid: req.Battleid, Cmd: req.Cmd})
|
|
return
|
|
}
|