特权接口调整

This commit is contained in:
meixiongfeng 2022-11-24 16:16:42 +08:00
parent a7e1587a6c
commit defde13dda
4 changed files with 133 additions and 334 deletions

View File

@ -9,7 +9,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 102,
@ -21,7 +22,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 103,
@ -33,7 +35,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 104,
@ -45,7 +48,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 105,
@ -57,7 +61,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 106,
@ -69,7 +74,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 107,
@ -81,7 +87,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 108,
@ -93,7 +100,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 109,
@ -105,7 +113,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 110,
@ -117,7 +126,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 111,
@ -129,7 +139,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 112,
@ -141,7 +152,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 113,
@ -153,7 +165,8 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
},
{
"id": 114,
@ -165,6 +178,7 @@
"LockSlots": [],
"AssistTeam": 0,
"EventList": [],
"playexp": 1000
"playexp": 1000,
"NoMidwayExit": 0
}
]

File diff suppressed because it is too large Load Diff

View File

@ -272,7 +272,7 @@ type (
// 创建一个新的特权卡
CreatePrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode)
// 续费特权卡
RenewPrivilegeCard(session IUserSession, cId string) (res []*pb.UserAssets, code pb.ErrorCode)
RenewPrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode)
// 检查特权
CheckPrivilege(session IUserSession, cId string) (privilege *pb.DBPrivilege)
// 查询玩家当前所有特权 返回特权id

View File

@ -131,13 +131,7 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string
}
// 续费特权
func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string) (res []*pb.UserAssets, code pb.ErrorCode) {
atn := &pb.UserAssets{
A: "vip",
T: "",
N: 1, // 暂时只支持一次续费一次
}
func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string) (code pb.ErrorCode) {
list, err := this.modelPrivilege.getPrivilegeList(session.GetUserId())
if err != nil {
return
@ -146,8 +140,8 @@ func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string)
if v.CId == cId {
conf, err := this.configure.GetPrivilegeCard(cId)
if err != nil {
code = pb.ErrorCode_ConfigNoFound
return nil, code
return pb.ErrorCode_ConfigNoFound
}
if conf.RenewDay >= int32(configure.Now().Unix()-v.ETime)/(24*3600) {
v.ETime += int64(conf.AssertDay) * 24 * 3600
@ -158,18 +152,7 @@ func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string)
if code = this.DispenseRes(session, conf.DisposableReward, true); code != pb.ErrorCode_Success {
break
}
session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list})
atn.T = conf.Id
res = append(res, atn) // 加资源
for _, v := range conf.DisposableReward {
res = append(res, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
} else {
code = pb.ErrorCode_PrivilegeRenewTime
}