diff --git a/comm/const.go b/comm/const.go index 9689f07e1..700f37864 100644 --- a/comm/const.go +++ b/comm/const.go @@ -154,8 +154,8 @@ const ( TableServerData = "serverdata" // 跨服服务器相关数据 ///竞技场 - TableArena = "arena" - + TableArena = "arena" + TableArenaRank = "arenarank" //排名 // 天赋 TableTalent = "herotalent" ) diff --git a/lego/sys/redis/pipe/zset.go b/lego/sys/redis/pipe/zset.go index 8910c6d90..ce074d6e0 100644 --- a/lego/sys/redis/pipe/zset.go +++ b/lego/sys/redis/pipe/zset.go @@ -7,179 +7,139 @@ import ( /* Redis ZAdd 向有序集合添加一个或多个成员,或者更新已存在成员的分数 */ -func (this *RedisPipe) ZAdd(key string, members ...*redis.Z) (err error) { - this.client.ZAdd(this.ctx, key, members...) - return +func (this *RedisPipe) ZAdd(key string, members ...*redis.Z) *redis.IntCmd { + return this.client.ZAdd(this.ctx, key, members...) } /* Redis Zcard 用于计算集合中元素的数量。 */ -func (this *RedisPipe) ZCard(key string) (result int64, err error) { - result, err = this.client.ZCard(this.ctx, key).Result() - return +func (this *RedisPipe) ZCard(key string) *redis.IntCmd { + return this.client.ZCard(this.ctx, key) } /* Redis ZCount 用于计算集合中指定的范围内的数量 */ -func (this *RedisPipe) ZCount(key string, min string, max string) (result int64, err error) { - result, err = this.client.ZCount(this.ctx, key, min, max).Result() - return +func (this *RedisPipe) ZCount(key string, min string, max string) *redis.IntCmd { + return this.client.ZCount(this.ctx, key, min, max) } /* Redis ZIncrBy 有序集合中对指定成员的分数加上增量 increment */ -func (this *RedisPipe) ZIncrBy(key string, increment float64, member string) (result float64, err error) { - result, err = this.client.ZIncrBy(this.ctx, key, increment, member).Result() - return +func (this *RedisPipe) ZIncrBy(key string, increment float64, member string) *redis.FloatCmd { + return this.client.ZIncrBy(this.ctx, key, increment, member) } /* Redis ZInterStore 计算给定的一个或多个有序集的交集并将结果集存储在新的有序集合 destination 中 */ -func (this *RedisPipe) ZInterStore(destination string, store *redis.ZStore) (result int64, err error) { - result, err = this.client.ZInterStore(this.ctx, destination, store).Result() - return +func (this *RedisPipe) ZInterStore(destination string, store *redis.ZStore) *redis.IntCmd { + return this.client.ZInterStore(this.ctx, destination, store) } /* Redis ZLexCount 在有序集合中计算指定字典区间内成员数量 */ -func (this *RedisPipe) ZLexCount(key string, min string, max string) (result int64, err error) { - result, err = this.client.ZLexCount(this.ctx, key, min, max).Result() - return +func (this *RedisPipe) ZLexCount(key string, min string, max string) *redis.IntCmd { + return this.client.ZLexCount(this.ctx, key, min, max) } /* Redis ZRange 通过索引区间返回有序集合指定区间内的成员 */ -func (this *RedisPipe) ZRange(key string, start int64, stop int64, v interface{}) (err error) { - var _result []string - cmd := this.client.ZRange(this.ctx, key, start, stop) - if _result, err = cmd.Result(); err == nil { - err = this.codec.UnmarshalSlice(_result, v) - } - return +func (this *RedisPipe) ZRange(key string, start int64, stop int64) *redis.StringSliceCmd { + return this.client.ZRange(this.ctx, key, start, stop) } /* Redis ZRangeByLex 通过字典区间返回有序集合的成员 */ -func (this *RedisPipe) ZRangeByLex(key string, opt *redis.ZRangeBy, v interface{}) (err error) { - var _result []string - cmd := this.client.ZRangeByLex(this.ctx, key, opt) - if _result, err = cmd.Result(); err == nil { - err = this.codec.UnmarshalSlice(_result, v) - } - return +func (this *RedisPipe) ZRangeByLex(key string, opt *redis.ZRangeBy) *redis.StringSliceCmd { + return this.client.ZRangeByLex(this.ctx, key, opt) } /* Redis ZRangeByScore 通过分数返回有序集合指定区间内的成员 */ -func (this *RedisPipe) ZRangeByScore(key string, opt *redis.ZRangeBy, v interface{}) (err error) { - var _result []string - cmd := this.client.ZRangeByScore(this.ctx, key, opt) - if _result, err = cmd.Result(); err == nil { - err = this.codec.UnmarshalSlice(_result, v) - } - return +func (this *RedisPipe) ZRangeByScore(key string, opt *redis.ZRangeBy) *redis.StringSliceCmd { + return this.client.ZRangeByScore(this.ctx, key, opt) } /* Redis ZRank 返回有序集合中指定成员的索引 */ -func (this *RedisPipe) ZRank(key string, member string) (result int64, err error) { - result, err = this.client.ZRank(this.ctx, key, member).Result() - return +func (this *RedisPipe) ZRank(key string, member string) *redis.IntCmd { + return this.client.ZRank(this.ctx, key, member) } /* Redis ZRem 移除有序集合中的一个或多个成员 */ -func (this *RedisPipe) ZRem(key string, members ...interface{}) (result int64, err error) { - result, err = this.client.ZRem(this.ctx, key, members...).Result() - return +func (this *RedisPipe) ZRem(key string, members ...interface{}) *redis.IntCmd { + return this.client.ZRem(this.ctx, key, members...) } /* Redis ZRemRangeByLex 移除有序集合中给定的字典区间的所有成员 */ -func (this *RedisPipe) ZRemRangeByLex(key string, min string, max string) (result int64, err error) { - result, err = this.client.ZRemRangeByLex(this.ctx, key, min, max).Result() - return +func (this *RedisPipe) ZRemRangeByLex(key string, min string, max string) *redis.IntCmd { + return this.client.ZRemRangeByLex(this.ctx, key, min, max) } /* Redis ZRemRangeByRank 移除有序集合中给定的排名区间的所有成员 */ -func (this *RedisPipe) ZRemRangeByRank(key string, start int64, stop int64) (result int64, err error) { - result, err = this.client.ZRemRangeByRank(this.ctx, key, start, stop).Result() - return +func (this *RedisPipe) ZRemRangeByRank(key string, start int64, stop int64) *redis.IntCmd { + return this.client.ZRemRangeByRank(this.ctx, key, start, stop) } /* Redis ZRemRangeByScore 移除有序集合中给定的分数区间的所有成员 */ -func (this *RedisPipe) ZRemRangeByScore(key string, min string, max string) (result int64, err error) { - result, err = this.client.ZRemRangeByScore(this.ctx, key, min, max).Result() - return +func (this *RedisPipe) ZRemRangeByScore(key string, min string, max string) *redis.IntCmd { + return this.client.ZRemRangeByScore(this.ctx, key, min, max) } /* Redis ZRevRange 返回有序集中指定区间内的成员,通过索引,分数从高到低 ZREVRANGE */ -func (this *RedisPipe) ZRevRange(key string, start int64, stop int64, v interface{}) (err error) { - var _result []string - cmd := this.client.ZRevRange(this.ctx, key, start, stop) - if _result, err = cmd.Result(); err == nil { - err = this.codec.UnmarshalSlice(_result, v) - } - return +func (this *RedisPipe) ZRevRange(key string, start int64, stop int64) *redis.StringSliceCmd { + return this.client.ZRevRange(this.ctx, key, start, stop) } /* Redis ZRevRangeByScore 返回有序集中指定分数区间内的成员,分数从高到低排序 */ -func (this *RedisPipe) ZRevRangeByScore(key string, opt *redis.ZRangeBy, v interface{}) (err error) { - var _result []string - cmd := this.client.ZRevRangeByScore(this.ctx, key, opt) - if _result, err = cmd.Result(); err == nil { - err = this.codec.UnmarshalSlice(_result, v) - } - return +func (this *RedisPipe) ZRevRangeByScore(key string, opt *redis.ZRangeBy) *redis.StringSliceCmd { + return this.client.ZRevRangeByScore(this.ctx, key, opt) } /* Redis ZRevRank 返回有序集中指定分数区间内的成员,分数从高到低排序 */ -func (this *RedisPipe) ZRevRank(key string, member string) (result int64, err error) { - result, err = this.client.ZRevRank(this.ctx, key, member).Result() - return +func (this *RedisPipe) ZRevRank(key string, member string) *redis.IntCmd { + return this.client.ZRevRank(this.ctx, key, member) } /* Redis ZScore 返回有序集中指定分数区间内的成员,分数从高到低排序 */ -func (this *RedisPipe) ZScore(key string, member string) (result float64, err error) { - result, err = this.client.ZScore(this.ctx, key, member).Result() - return +func (this *RedisPipe) ZScore(key string, member string) *redis.FloatCmd { + return this.client.ZScore(this.ctx, key, member) } /* Redis ZScore 返回有序集中指定分数区间内的成员,分数从高到低排序 ZUNIONSTORE */ -func (this *RedisPipe) ZUnionStore(dest string, store *redis.ZStore) (result int64, err error) { - result, err = this.client.ZUnionStore(this.ctx, dest, store).Result() - return +func (this *RedisPipe) ZUnionStore(dest string, store *redis.ZStore) *redis.IntCmd { + return this.client.ZUnionStore(this.ctx, dest, store) } /* Redis ZScan 迭代有序集合中的元素(包括元素成员和元素分值) */ -func (this *RedisPipe) ZScan(key string, _cursor uint64, match string, count int64) (keys []string, cursor uint64, err error) { - keys, cursor, err = this.client.ZScan(this.ctx, key, _cursor, match, count).Result() - return +func (this *RedisPipe) ZScan(key string, _cursor uint64, match string, count int64) *redis.ScanCmd { + return this.client.ZScan(this.ctx, key, _cursor, match, count) } diff --git a/modules/arena/api_challengereward.go b/modules/arena/api_challengereward.go index 8a6f0d2a3..b581af8e0 100644 --- a/modules/arena/api_challengereward.go +++ b/modules/arena/api_challengereward.go @@ -99,6 +99,26 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha Integral: red.Integral, } } - + this.module.modelArena.integralCompute(red, bule, req.Iswin) + if !req.Isai { + this.module.modelRank.updateArenaRank(red, bule) + info.Integral = red.Integral + info.Rank = red.Rank + rival.Integral = bule.Integral + rival.Rank = bule.Rank + if err = this.module.modelArena.updateArenaUserInfo(info); err != nil { + code = pb.ErrorCode_DBError + } + if err = this.module.modelArena.updateArenaUserInfo(rival); err != nil { + code = pb.ErrorCode_DBError + } + } else { + this.module.modelRank.updateArenaRank(red) + info.Integral = red.Integral + info.Rank = red.Rank + if err = this.module.modelArena.updateArenaUserInfo(info); err != nil { + code = pb.ErrorCode_DBError + } + } return } diff --git a/modules/arena/modelarena.go b/modules/arena/modelarena.go index dae108015..2682a1c77 100644 --- a/modules/arena/modelarena.go +++ b/modules/arena/modelarena.go @@ -93,6 +93,7 @@ func (this *modelArena) updateArenaUserInfo(info *pb.DBArenaUser) (err error) { this.Change(info.Uid, map[string]interface{}{ "integral": info.Integral, "dan": dan, + "rank": info.Rank, "attack": info.Attack, "defend": info.Defend, "streak": info.Streak, @@ -292,5 +293,24 @@ func (this *modelArena) getAI(mformatId int32) (ai *pb.ArenaPlayer, err error) { //积分计算 func (this *modelArena) integralCompute(red, bule *pb.ArenaPlayer, iswin bool) { - + var ( + redactive *cfg.GameArenaActiveRewardData + buleactive *cfg.GameArenaActiveRewardData + err error + ) + if redactive, err = this.module.configure.getActiveRewardById(red.Dan); err != nil { + this.module.Errorln(err) + return + } + if buleactive, err = this.module.configure.getActiveRewardById(bule.Dan); err != nil { + this.module.Errorln(err) + return + } + if iswin { + red.Integral = red.Integral + int32(redactive.KValue*float32(1-1/(1+10^(bule.Integral-red.Integral)/400))) + bule.Integral = bule.Integral * int32(buleactive.KValue*float32(0-1/(1+10^(red.Integral-bule.Integral)/400))) + } else { + red.Integral = red.Integral + int32(redactive.KValue*float32(0-1/(1+10^(bule.Integral-red.Integral)/400))) + bule.Integral = bule.Integral * int32(redactive.KValue*float32(1-1/(1+10^(red.Integral-bule.Integral)/400))) + } } diff --git a/modules/arena/modelrank.go b/modules/arena/modelrank.go new file mode 100644 index 000000000..1f17fc13a --- /dev/null +++ b/modules/arena/modelrank.go @@ -0,0 +1,64 @@ +package arena + +import ( + "context" + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/redis/pipe" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "github.com/go-redis/redis/v8" +) + +///竞技场 数据组件 +type modelRank struct { + modules.MCompModel + module *Arena +} + +//组件初始化接口 +func (this *modelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) { + this.TableName = comm.TableArenaRank + this.MCompModel.Init(service, module, comp, opt) + this.module = module.(*Arena) + + return +} + +//更新排名 +func (this *modelRank) updateArenaRank(users ...*pb.ArenaPlayer) (err error) { + var ( + pipe *pipe.RedisPipe = this.DBModel.Redis.RedisPipe(context.TODO()) + menbers []*redis.Z + cmd *redis.IntCmd + menbersCmd []*redis.IntCmd + rank int64 + ) + menbers = make([]*redis.Z, len(users)) + for i, v := range users { + menbers[i] = &redis.Z{Score: float64(v.Integral), Member: v.Uid} + } + if cmd = pipe.ZAdd(this.TableName, menbers...); err != nil { + this.module.Errorln(err) + } + for i, v := range users { + menbersCmd[i] = pipe.ZRevRank(this.TableName, v.Uid) + } + if _, err = pipe.Exec(); err == nil { + this.module.Errorln(err) + return + } + if _, err = cmd.Result(); err != nil { + this.module.Errorln(err) + return + } + for i, v := range menbersCmd { + if rank, err = v.Result(); err != nil { + this.module.Errorln(err) + return + } + users[i].Rank = int32(rank + 1) + } + return +} diff --git a/modules/arena/module.go b/modules/arena/module.go index d235a8cbe..273985c99 100644 --- a/modules/arena/module.go +++ b/modules/arena/module.go @@ -22,6 +22,7 @@ type Arena struct { api *apiComp configure *configureComp modelArena *modelArena + modelRank *modelRank } //模块名 @@ -32,7 +33,7 @@ func (this *Arena) GetType() core.M_Modules { //模块初始化接口 注册用户创建角色事件 func (this *Arena) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) - + return } @@ -42,4 +43,5 @@ func (this *Arena) OnInstallComp() { this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.modelArena = this.RegisterComp(new(modelArena)).(*modelArena) + this.modelRank = this.RegisterComp(new(modelRank)).(*modelRank) } diff --git a/pb/arena_db.pb.go b/pb/arena_db.pb.go index 056f01f33..56ea059dd 100644 --- a/pb/arena_db.pb.go +++ b/pb/arena_db.pb.go @@ -86,9 +86,10 @@ type ArenaPlayer struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` Dan int32 `protobuf:"varint,3,opt,name=dan,proto3" json:"dan"` //段位 Integral int32 `protobuf:"varint,4,opt,name=Integral,proto3" json:"Integral"` - Defend *DBPlayerBattleFormt `protobuf:"bytes,5,opt,name=defend,proto3" json:"defend"` //防守 - Isai bool `protobuf:"varint,6,opt,name=isai,proto3" json:"isai"` //是否是ai - Mformatid int32 `protobuf:"varint,7,opt,name=mformatid,proto3" json:"mformatid"` // AIId + Rank int32 `protobuf:"varint,5,opt,name=rank,proto3" json:"rank"` //排名 + Defend *DBPlayerBattleFormt `protobuf:"bytes,6,opt,name=defend,proto3" json:"defend"` //防守 + Isai bool `protobuf:"varint,7,opt,name=isai,proto3" json:"isai"` //是否是ai + Mformatid int32 `protobuf:"varint,8,opt,name=mformatid,proto3" json:"mformatid"` // AIId } func (x *ArenaPlayer) Reset() { @@ -151,6 +152,13 @@ func (x *ArenaPlayer) GetIntegral() int32 { return 0 } +func (x *ArenaPlayer) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + func (x *ArenaPlayer) GetDefend() *DBPlayerBattleFormt { if x != nil { return x.Defend @@ -414,55 +422,57 @@ var file_arena_arena_db_proto_rawDesc = []byte{ 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x1d, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x6d, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, - 0x65, 0x72, 0x6f, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x6d, 0x74, 0x22, 0xc1, 0x01, 0x0a, 0x0b, 0x41, + 0x65, 0x72, 0x6f, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x6d, 0x74, 0x22, 0xd5, 0x01, 0x0a, 0x0b, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x2c, - 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 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, 0x12, 0x0a, 0x04, - 0x69, 0x73, 0x61, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x61, 0x69, - 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x64, 0x22, 0xa5, - 0x01, 0x0a, 0x13, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x73, 0x77, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x77, - 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x69, 0x76, 0x61, - 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x69, 0x76, - 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x87, 0x03, 0x0a, 0x0b, 0x44, 0x42, 0x41, 0x72, 0x65, - 0x6e, 0x61, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, - 0x61, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, + 0x6e, 0x6b, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 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, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, - 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 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, 0x08, 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, 0x09, 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, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x65, - 0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, - 0x79, 0x6e, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x75, 0x79, 0x6e, - 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x0d, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74, 0x52, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x61, 0x69, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, + 0x69, 0x73, 0x61, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x69, 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x13, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x42, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, + 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x64, 0x65, 0x66, 0x65, + 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x72, 0x69, 0x76, 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x87, 0x03, 0x0a, 0x0b, 0x44, + 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, + 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x69, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x64, 0x61, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, + 0x18, 0x06, 0x20, 0x01, 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, 0x61, 0x74, + 0x74, 0x61, 0x63, 0x6b, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x18, 0x07, + 0x20, 0x01, 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, 0x08, 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, 0x09, 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, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x64, 0x65, 0x66, 0x65, 0x6e, 0x64, 0x72, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, + 0x6e, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x16, + 0x0a, 0x06, 0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x62, 0x75, 0x79, 0x6e, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x41, 0x72, 0x65, 0x6e, 0x61, + 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 3250decb2..e795d196f 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -201,15 +201,12 @@ const ( ErrorCode_SociatyAdded ErrorCode = 3001 //已在公会里 ErrorCode_SociatyDiamondNoEnough ErrorCode = 3002 //钻石不足 ErrorCode_SociatyApply ErrorCode = 3003 //申请失败 - ErrorCode_SociatyNoRight ErrorCode = 3004 //无权限 - ErrorCode_SociatyNoAdded ErrorCode = 3005 //未加入公会 // arena ErrorCode_ArenaTicketBuyUp ErrorCode = 3101 //票据上限 // talent ErrorCode_TalentRepeatLearn ErrorCode = 3201 // 天赋已学习 ErrorCode_TalentErrData ErrorCode = 3202 /// 天赋不存在 ErrorCode_TalentUnLockerBefore ErrorCode = 3203 //先解锁前置天赋 - ErrorCode_TalentResetState ErrorCode = 3204 //当前天赋已经是重置状态 ) // Enum value maps for ErrorCode. @@ -374,13 +371,10 @@ var ( 3001: "SociatyAdded", 3002: "SociatyDiamondNoEnough", 3003: "SociatyApply", - 3004: "SociatyNoRight", - 3005: "SociatyNoAdded", 3101: "ArenaTicketBuyUp", 3201: "TalentRepeatLearn", 3202: "TalentErrData", 3203: "TalentUnLockerBefore", - 3204: "TalentResetState", } ErrorCode_value = map[string]int32{ "Success": 0, @@ -542,13 +536,10 @@ var ( "SociatyAdded": 3001, "SociatyDiamondNoEnough": 3002, "SociatyApply": 3003, - "SociatyNoRight": 3004, - "SociatyNoAdded": 3005, "ArenaTicketBuyUp": 3101, "TalentRepeatLearn": 3201, "TalentErrData": 3202, "TalentUnLockerBefore": 3203, - "TalentResetState": 3204, } ) @@ -583,7 +574,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xf8, 0x1c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xb7, 0x1c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -804,18 +795,14 @@ var file_errorcode_proto_rawDesc = []byte{ 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x64, 0x64, 0x65, 0x64, 0x10, 0xb9, 0x17, 0x12, 0x1b, 0x0a, 0x16, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xba, 0x17, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6f, - 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x10, 0xbb, 0x17, 0x12, 0x13, 0x0a, - 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x52, 0x69, 0x67, 0x68, 0x74, 0x10, - 0xbc, 0x17, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x41, - 0x64, 0x64, 0x65, 0x64, 0x10, 0xbd, 0x17, 0x12, 0x15, 0x0a, 0x10, 0x41, 0x72, 0x65, 0x6e, 0x61, - 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x55, 0x70, 0x10, 0x9d, 0x18, 0x12, 0x16, - 0x0a, 0x11, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4c, 0x65, - 0x61, 0x72, 0x6e, 0x10, 0x81, 0x19, 0x12, 0x12, 0x0a, 0x0d, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, - 0x45, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10, 0x82, 0x19, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, - 0x6c, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x42, 0x65, 0x66, 0x6f, - 0x72, 0x65, 0x10, 0x83, 0x19, 0x12, 0x15, 0x0a, 0x10, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0x84, 0x19, 0x42, 0x06, 0x5a, 0x04, - 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x10, 0xbb, 0x17, 0x12, 0x15, 0x0a, + 0x10, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x55, + 0x70, 0x10, 0x9d, 0x18, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x70, 0x65, 0x61, 0x74, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x10, 0x81, 0x19, 0x12, 0x12, 0x0a, 0x0d, + 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10, 0x82, 0x19, + 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x4c, 0x6f, 0x63, 0x6b, + 0x65, 0x72, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x10, 0x83, 0x19, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/hero_msg.pb.go b/pb/hero_msg.pb.go index ab0af989c..edb804d7f 100644 --- a/pb/hero_msg.pb.go +++ b/pb/hero_msg.pb.go @@ -2063,7 +2063,7 @@ type HeroTalentResetResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Telnet *DBHeroTalent `protobuf:"bytes,1,opt,name=telnet,proto3" json:"telnet"` + Telnet []*DBHeroTalent `protobuf:"bytes,1,rep,name=telnet,proto3" json:"telnet"` } func (x *HeroTalentResetResp) Reset() { @@ -2098,7 +2098,7 @@ func (*HeroTalentResetResp) Descriptor() ([]byte, []int) { return file_hero_hero_msg_proto_rawDescGZIP(), []int{39} } -func (x *HeroTalentResetResp) GetTelnet() *DBHeroTalent { +func (x *HeroTalentResetResp) GetTelnet() []*DBHeroTalent { if x != nil { return x.Telnet } @@ -2290,7 +2290,7 @@ var file_hero_hero_msg_proto_rawDesc = []byte{ 0x6f, 0x62, 0x6a, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x62, 0x6a, 0x49, 0x64, 0x22, 0x3c, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x65, 0x6c, - 0x6e, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x48, 0x65, + 0x6e, 0x65, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x65, 0x6c, 0x6e, 0x65, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/sys/configure/structs/Game.ArenaActiveRewardData.go b/sys/configure/structs/Game.ArenaActiveRewardData.go index 875bb9781..4984ba7ea 100644 --- a/sys/configure/structs/Game.ArenaActiveRewardData.go +++ b/sys/configure/structs/Game.ArenaActiveRewardData.go @@ -17,6 +17,8 @@ type GameArenaActiveRewardData struct { HumanNum int32 Name string WinReward []*Gameatn + Png string + KValue float32 } const TypeId_GameArenaActiveRewardData = 869812042 @@ -45,6 +47,8 @@ func (_v *GameArenaActiveRewardData)Deserialize(_buf map[string]interface{}) (er } } + { var _ok_ bool; if _v.Png, _ok_ = _buf["png"].(string); !_ok_ { err = errors.New("png error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["k_value"].(float64); !_ok_ { err = errors.New("k_value error"); return }; _v.KValue = float32(_tempNum_) } return }