diff --git a/modules/pvp/api_activecancel.go b/modules/pvp/api_activecancel.go new file mode 100644 index 000000000..6eb5060fa --- /dev/null +++ b/modules/pvp/api_activecancel.go @@ -0,0 +1,52 @@ +package pvp + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) CancelCheck(session comm.IUserSession, req *pb.PvpActiveCancelReq) (code pb.ErrorCode) { + return +} + +///设置战斗阵型 +func (this *apiComp) Cancel(session comm.IUserSession, req *pb.PvpActiveCancelReq) (code pb.ErrorCode, data proto.Message) { + var ( + battle *BattleItem + ok bool + winside int32 + ) + if code = this.CancelCheck(session, req); code != pb.ErrorCode_Success { + return + } + this.module.lock.RLock() + battle, ok = this.module.battles[req.Battleid] + this.module.lock.RUnlock() + if ok { + if battle.Red.Uid == session.GetUserId() { + winside = 2 + } else { + winside = 1 + } + this.module.PvpFinishPush(&pb.BattleFinishPush{ + Battleid: req.Battleid, + WinSide: winside, + }) + if err := this.module.SendMsgToSession(string(comm.ModulePvp), "cancel", &pb.PvpCancelPush{ + ServicePath: fmt.Sprintf("%s/%s", this.service.GetType(), this.service.GetId()), + Battleid: battle.Id, + }, battle.RedSession, battle.BlueSession); err != nil { + this.module.Errorln(err) + } + } else { + code = pb.ErrorCode_BattleInCmdFailed + return + } + + session.SendMsg(string(this.module.GetType()), "cancel", &pb.PvpActiveCancelResp{Issucc: true}) + return +} diff --git a/pb/pvp_msg.pb.go b/pb/pvp_msg.pb.go index baf8bb24a..f4da18d74 100644 --- a/pb/pvp_msg.pb.go +++ b/pb/pvp_msg.pb.go @@ -355,6 +355,100 @@ func (x *PvpCancelPush) GetBattleid() string { return "" } +type PvpActiveCancelReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Battleid string `protobuf:"bytes,1,opt,name=battleid,proto3" json:"battleid"` //战斗id +} + +func (x *PvpActiveCancelReq) Reset() { + *x = PvpActiveCancelReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pvp_pvp_msg_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvpActiveCancelReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvpActiveCancelReq) ProtoMessage() {} + +func (x *PvpActiveCancelReq) ProtoReflect() protoreflect.Message { + mi := &file_pvp_pvp_msg_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvpActiveCancelReq.ProtoReflect.Descriptor instead. +func (*PvpActiveCancelReq) Descriptor() ([]byte, []int) { + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{6} +} + +func (x *PvpActiveCancelReq) GetBattleid() string { + if x != nil { + return x.Battleid + } + return "" +} + +type PvpActiveCancelResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` +} + +func (x *PvpActiveCancelResp) Reset() { + *x = PvpActiveCancelResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pvp_pvp_msg_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvpActiveCancelResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvpActiveCancelResp) ProtoMessage() {} + +func (x *PvpActiveCancelResp) ProtoReflect() protoreflect.Message { + mi := &file_pvp_pvp_msg_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvpActiveCancelResp.ProtoReflect.Descriptor instead. +func (*PvpActiveCancelResp) Descriptor() ([]byte, []int) { + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{7} +} + +func (x *PvpActiveCancelResp) GetIssucc() bool { + if x != nil { + return x.Issucc + } + return false +} + //布阵 请求 type PvpFormationReq struct { state protoimpl.MessageState @@ -368,7 +462,7 @@ type PvpFormationReq struct { func (x *PvpFormationReq) Reset() { *x = PvpFormationReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[6] + mi := &file_pvp_pvp_msg_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -381,7 +475,7 @@ func (x *PvpFormationReq) String() string { func (*PvpFormationReq) ProtoMessage() {} func (x *PvpFormationReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[6] + mi := &file_pvp_pvp_msg_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -394,7 +488,7 @@ func (x *PvpFormationReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpFormationReq.ProtoReflect.Descriptor instead. func (*PvpFormationReq) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{6} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{8} } func (x *PvpFormationReq) GetBattleid() string { @@ -423,7 +517,7 @@ type PvpFormationResp struct { func (x *PvpFormationResp) Reset() { *x = PvpFormationResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[7] + mi := &file_pvp_pvp_msg_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -436,7 +530,7 @@ func (x *PvpFormationResp) String() string { func (*PvpFormationResp) ProtoMessage() {} func (x *PvpFormationResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[7] + mi := &file_pvp_pvp_msg_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -449,7 +543,7 @@ func (x *PvpFormationResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpFormationResp.ProtoReflect.Descriptor instead. func (*PvpFormationResp) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{7} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{9} } func (x *PvpFormationResp) GetIssucc() bool { @@ -472,7 +566,7 @@ type PvpStartPush struct { func (x *PvpStartPush) Reset() { *x = PvpStartPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[8] + mi := &file_pvp_pvp_msg_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -485,7 +579,7 @@ func (x *PvpStartPush) String() string { func (*PvpStartPush) ProtoMessage() {} func (x *PvpStartPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[8] + mi := &file_pvp_pvp_msg_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -498,7 +592,7 @@ func (x *PvpStartPush) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpStartPush.ProtoReflect.Descriptor instead. func (*PvpStartPush) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{8} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{10} } func (x *PvpStartPush) GetCode() ErrorCode { @@ -528,7 +622,7 @@ type PvpOutCmdPush struct { func (x *PvpOutCmdPush) Reset() { *x = PvpOutCmdPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[9] + mi := &file_pvp_pvp_msg_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -541,7 +635,7 @@ func (x *PvpOutCmdPush) String() string { func (*PvpOutCmdPush) ProtoMessage() {} func (x *PvpOutCmdPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[9] + mi := &file_pvp_pvp_msg_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -554,7 +648,7 @@ func (x *PvpOutCmdPush) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpOutCmdPush.ProtoReflect.Descriptor instead. func (*PvpOutCmdPush) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{9} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{11} } func (x *PvpOutCmdPush) GetBattleid() string { @@ -584,7 +678,7 @@ type PvpInCmdReq struct { func (x *PvpInCmdReq) Reset() { *x = PvpInCmdReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[10] + mi := &file_pvp_pvp_msg_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -597,7 +691,7 @@ func (x *PvpInCmdReq) String() string { func (*PvpInCmdReq) ProtoMessage() {} func (x *PvpInCmdReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[10] + mi := &file_pvp_pvp_msg_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -610,7 +704,7 @@ func (x *PvpInCmdReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpInCmdReq.ProtoReflect.Descriptor instead. func (*PvpInCmdReq) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{10} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{12} } func (x *PvpInCmdReq) GetBattleid() string { @@ -641,7 +735,7 @@ type PvpInCmdResp struct { func (x *PvpInCmdResp) Reset() { *x = PvpInCmdResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[11] + mi := &file_pvp_pvp_msg_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -654,7 +748,7 @@ func (x *PvpInCmdResp) String() string { func (*PvpInCmdResp) ProtoMessage() {} func (x *PvpInCmdResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[11] + mi := &file_pvp_pvp_msg_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -667,7 +761,7 @@ func (x *PvpInCmdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpInCmdResp.ProtoReflect.Descriptor instead. func (*PvpInCmdResp) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{11} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{13} } func (x *PvpInCmdResp) GetCode() ErrorCode { @@ -728,38 +822,44 @@ var file_pvp_pvp_msg_proto_rawDesc = []byte{ 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x5d, 0x0a, 0x0f, 0x50, 0x76, 0x70, 0x46, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, 0x10, 0x50, 0x76, 0x70, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, - 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, - 0x63, 0x63, 0x22, 0x4f, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, - 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x22, 0x49, 0x0a, 0x0d, 0x50, 0x76, 0x70, 0x4f, 0x75, 0x74, 0x43, 0x6d, 0x64, - 0x50, 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, - 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x47, - 0x0a, 0x0b, 0x50, 0x76, 0x70, 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x12, 0x50, 0x76, 0x70, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, - 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x68, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x49, 0x6e, - 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, - 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, - 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x13, 0x50, 0x76, 0x70, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x5d, 0x0a, 0x0f, 0x50, 0x76, 0x70, 0x46, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, 0x10, 0x50, 0x76, 0x70, 0x46, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, + 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, + 0x75, 0x63, 0x63, 0x22, 0x4f, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, + 0x75, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x49, 0x0a, 0x0d, 0x50, 0x76, 0x70, 0x4f, 0x75, 0x74, 0x43, 0x6d, + 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, + 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, + 0x47, 0x0a, 0x0b, 0x50, 0x76, 0x70, 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, + 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x68, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x49, + 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, + 0x6d, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -774,41 +874,43 @@ func file_pvp_pvp_msg_proto_rawDescGZIP() []byte { return file_pvp_pvp_msg_proto_rawDescData } -var file_pvp_pvp_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_pvp_pvp_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_pvp_pvp_msg_proto_goTypes = []interface{}{ - (*PvpListReq)(nil), // 0: PvpListReq - (*PvpListResp)(nil), // 1: PvpListResp - (*PvpIntoReq)(nil), // 2: PvpIntoReq - (*PvpIntoResp)(nil), // 3: PvpIntoResp - (*PvpReadyPush)(nil), // 4: PvpReadyPush - (*PvpCancelPush)(nil), // 5: PvpCancelPush - (*PvpFormationReq)(nil), // 6: PvpFormationReq - (*PvpFormationResp)(nil), // 7: PvpFormationResp - (*PvpStartPush)(nil), // 8: PvpStartPush - (*PvpOutCmdPush)(nil), // 9: PvpOutCmdPush - (*PvpInCmdReq)(nil), // 10: PvpInCmdReq - (*PvpInCmdResp)(nil), // 11: PvpInCmdResp - (*DBPvpBattle)(nil), // 12: DBPvpBattle - (ErrorCode)(0), // 13: ErrorCode - (*BattleStateInfo)(nil), // 14: BattleStateInfo - (*PvpUserInfo)(nil), // 15: PvpUserInfo - (*BattleFormation)(nil), // 16: BattleFormation - (*BattleInfo)(nil), // 17: BattleInfo - (*BattleCmd)(nil), // 18: BattleCmd + (*PvpListReq)(nil), // 0: PvpListReq + (*PvpListResp)(nil), // 1: PvpListResp + (*PvpIntoReq)(nil), // 2: PvpIntoReq + (*PvpIntoResp)(nil), // 3: PvpIntoResp + (*PvpReadyPush)(nil), // 4: PvpReadyPush + (*PvpCancelPush)(nil), // 5: PvpCancelPush + (*PvpActiveCancelReq)(nil), // 6: PvpActiveCancelReq + (*PvpActiveCancelResp)(nil), // 7: PvpActiveCancelResp + (*PvpFormationReq)(nil), // 8: PvpFormationReq + (*PvpFormationResp)(nil), // 9: PvpFormationResp + (*PvpStartPush)(nil), // 10: PvpStartPush + (*PvpOutCmdPush)(nil), // 11: PvpOutCmdPush + (*PvpInCmdReq)(nil), // 12: PvpInCmdReq + (*PvpInCmdResp)(nil), // 13: PvpInCmdResp + (*DBPvpBattle)(nil), // 14: DBPvpBattle + (ErrorCode)(0), // 15: ErrorCode + (*BattleStateInfo)(nil), // 16: BattleStateInfo + (*PvpUserInfo)(nil), // 17: PvpUserInfo + (*BattleFormation)(nil), // 18: BattleFormation + (*BattleInfo)(nil), // 19: BattleInfo + (*BattleCmd)(nil), // 20: BattleCmd } var file_pvp_pvp_msg_proto_depIdxs = []int32{ - 12, // 0: PvpListResp.list:type_name -> DBPvpBattle - 13, // 1: PvpIntoResp.code:type_name -> ErrorCode - 14, // 2: PvpIntoResp.info:type_name -> BattleStateInfo - 15, // 3: PvpReadyPush.red:type_name -> PvpUserInfo - 15, // 4: PvpReadyPush.blue:type_name -> PvpUserInfo - 16, // 5: PvpFormationReq.formation:type_name -> BattleFormation - 13, // 6: PvpStartPush.code:type_name -> ErrorCode - 17, // 7: PvpStartPush.info:type_name -> BattleInfo - 18, // 8: PvpOutCmdPush.cmd:type_name -> BattleCmd - 18, // 9: PvpInCmdReq.cmd:type_name -> BattleCmd - 13, // 10: PvpInCmdResp.code:type_name -> ErrorCode - 18, // 11: PvpInCmdResp.cmd:type_name -> BattleCmd + 14, // 0: PvpListResp.list:type_name -> DBPvpBattle + 15, // 1: PvpIntoResp.code:type_name -> ErrorCode + 16, // 2: PvpIntoResp.info:type_name -> BattleStateInfo + 17, // 3: PvpReadyPush.red:type_name -> PvpUserInfo + 17, // 4: PvpReadyPush.blue:type_name -> PvpUserInfo + 18, // 5: PvpFormationReq.formation:type_name -> BattleFormation + 15, // 6: PvpStartPush.code:type_name -> ErrorCode + 19, // 7: PvpStartPush.info:type_name -> BattleInfo + 20, // 8: PvpOutCmdPush.cmd:type_name -> BattleCmd + 20, // 9: PvpInCmdReq.cmd:type_name -> BattleCmd + 15, // 10: PvpInCmdResp.code:type_name -> ErrorCode + 20, // 11: PvpInCmdResp.cmd:type_name -> BattleCmd 12, // [12:12] is the sub-list for method output_type 12, // [12:12] is the sub-list for method input_type 12, // [12:12] is the sub-list for extension type_name @@ -898,7 +1000,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpFormationReq); i { + switch v := v.(*PvpActiveCancelReq); i { case 0: return &v.state case 1: @@ -910,7 +1012,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpFormationResp); i { + switch v := v.(*PvpActiveCancelResp); i { case 0: return &v.state case 1: @@ -922,7 +1024,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpStartPush); i { + switch v := v.(*PvpFormationReq); i { case 0: return &v.state case 1: @@ -934,7 +1036,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpOutCmdPush); i { + switch v := v.(*PvpFormationResp); i { case 0: return &v.state case 1: @@ -946,7 +1048,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpInCmdReq); i { + switch v := v.(*PvpStartPush); i { case 0: return &v.state case 1: @@ -958,6 +1060,30 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvpOutCmdPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvp_pvp_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvpInCmdReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvp_pvp_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PvpInCmdResp); i { case 0: return &v.state @@ -976,7 +1102,7 @@ func file_pvp_pvp_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pvp_pvp_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 14, NumExtensions: 0, NumServices: 0, },