上传掠夺代码

This commit is contained in:
liwei1dao 2024-01-26 16:52:34 +08:00
parent fb04fd18a4
commit 50533f693c
10 changed files with 13 additions and 33 deletions

View File

@ -31,7 +31,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PlunderChallen
return // 参数校验失败直接返回
}
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -50,7 +50,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PlunderCha
if errdata = this.ChallengeOverCheck(session, req); errdata != nil {
return // 参数校验失败直接返回
}
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -21,7 +21,7 @@ func (this *apiComp) ClientTag(session comm.IUserSession, req *pb.PlunderClientT
return
}
changeShip = make(map[string]*pb.ShipData)
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -23,7 +23,7 @@ func (this *apiComp) Develop(session comm.IUserSession, req *pb.PlunderDevelopRe
}
update = make(map[string]interface{})
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -50,7 +50,7 @@ func (this *apiComp) PvpChallenge(session comm.IUserSession, req *pb.PlunderPvpC
return
}
changeShip = make(map[string]*pb.ShipData)
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -39,7 +39,7 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder
return
}
changeShip = make(map[string]*pb.ShipData)
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),
@ -102,7 +102,7 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder
})
info = append(info, &pb.PlunderRecordData{
Itype: 2,
Itype: 4,
P1: session.GetUserId(),
P2: land.Ship[req.Oid].Uid,
Cid: land.Ship[req.Oid].Line.Cid,
@ -148,7 +148,7 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder
Atno: atno,
})
info = append(info, &pb.PlunderRecordData{
Itype: 4,
Itype: 2,
P1: session.GetUserId(),
P2: land.Ship[req.Oid].Uid,
Cid: land.Ship[req.Oid].Line.Cid,

View File

@ -39,7 +39,7 @@ func (this *apiComp) Reach(session comm.IUserSession, req *pb.PlunderReachReq) (
return // 参数校验失败直接返回
}
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -19,7 +19,7 @@ func (this *apiComp) Record(session comm.IUserSession, req *pb.PlunderRecordReq)
if errdata = this.RecordCheck(session, req); errdata != nil {
return
}
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -19,7 +19,7 @@ func (this *apiComp) Refresh(session comm.IUserSession, req *pb.PlunderRefreshRe
return
}
if list, err = this.module.modelPlunder.getPlunderData(session.GetUserId()); err != nil {
if list, err = this.module.modelPlunder.getPlunderData(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),

View File

@ -449,8 +449,6 @@ type DBArenaUser struct {
Attack *DBPlayerBattleFormt `protobuf:"bytes,6,opt,name=attack,proto3" json:"attack"` //进攻阵型
Defend *DBPlayerBattleFormt `protobuf:"bytes,8,opt,name=defend,proto3" json:"defend"` //防守阵型
Streak int32 `protobuf:"varint,11,opt,name=streak,proto3" json:"streak"` //连胜
Attackrate int32 `protobuf:"varint,12,opt,name=attackrate,proto3" json:"attackrate"` //进攻胜率
Defendrate int32 `protobuf:"varint,13,opt,name=defendrate,proto3" json:"defendrate"` //防守胜率
Rank int32 `protobuf:"varint,14,opt,name=rank,proto3" json:"rank"` //排名
Buynum int32 `protobuf:"varint,15,opt,name=buynum,proto3" json:"buynum"` //购买次数
Record []*DBArenaBattleRecord `protobuf:"bytes,16,rep,name=record,proto3" json:"record"` //战斗记录
@ -560,20 +558,6 @@ func (x *DBArenaUser) GetStreak() int32 {
return 0
}
func (x *DBArenaUser) GetAttackrate() int32 {
if x != nil {
return x.Attackrate
}
return 0
}
func (x *DBArenaUser) GetDefendrate() int32 {
if x != nil {
return x.Defendrate
}
return 0
}
func (x *DBArenaUser) GetRank() int32 {
if x != nil {
return x.Rank
@ -989,7 +973,7 @@ var file_arena_arena_db_proto_rawDesc = []byte{
0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x28, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22,
0x89, 0x09, 0x0a, 0x0b, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x55, 0x73, 0x65, 0x72, 0x12,
0xc9, 0x08, 0x0a, 0x0b, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x55, 0x73, 0x65, 0x72, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
0x64, 0x12, 0x23, 0x0a, 0x05, 0x75, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
@ -1004,11 +988,7 @@ var file_arena_arena_db_proto_rawDesc = []byte{
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74,
0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x52, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64,
0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6b, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61,
0x63, 0x6b, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x74,
0x74, 0x61, 0x63, 0x6b, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x65,
0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65,
0x66, 0x65, 0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b,
0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b,
0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06,
0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x75,
0x79, 0x6e, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x10,