From a2273fa1d168e62c7956b05f97011d17fabd4f43 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 15 Jul 2022 16:03:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96redis=20=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E8=AF=BB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lego/sys/redis/cluster/hash.go | 10 ++- lego/sys/redis/core/core.go | 14 ++++ lego/sys/redis/redis.go | 4 - lego/sys/redis/single/hash.go | 10 ++- lego/sys/redis/sys_test.go | 45 ++++++++++- modules/comp_model.go | 131 +++++++++++++++++++++++++++------ modules/items/modelitems.go | 14 ---- modules/items/module_test.go | 2 +- 8 files changed, 182 insertions(+), 48 deletions(-) diff --git a/lego/sys/redis/cluster/hash.go b/lego/sys/redis/cluster/hash.go index 06a3d81cd..bcddaf0b6 100644 --- a/lego/sys/redis/cluster/hash.go +++ b/lego/sys/redis/cluster/hash.go @@ -1,6 +1,8 @@ package cluster import ( + "go_dreamfactory/lego/sys/redis/core" + "github.com/go-redis/redis/v8" ) @@ -178,8 +180,12 @@ Redis Hset 命令用于为哈希表中的字段赋值 */ func (this *Redis) HSet(key string, field string, value interface{}) (err error) { var resultvalue []byte - if resultvalue, err = this.codec.Marshal(value); err == nil { - err = this.client.Do(this.client.Context(), "HSET", key, field, resultvalue).Err() + if !core.IsBaseType(value) { + if resultvalue, err = this.codec.Marshal(value); err == nil { + err = this.client.Do(this.client.Context(), "HSET", key, field, resultvalue).Err() + } + } else { + err = this.client.Do(this.client.Context(), "HSET", key, field, value).Err() } return } diff --git a/lego/sys/redis/core/core.go b/lego/sys/redis/core/core.go index d99eb3f1c..b85fcacd6 100644 --- a/lego/sys/redis/core/core.go +++ b/lego/sys/redis/core/core.go @@ -1,5 +1,10 @@ package core +import ( + "encoding" + "time" +) + type ( ICodec interface { Marshal(v interface{}) ([]byte, error) @@ -10,3 +15,12 @@ type ( UnmarshalSlice(data []string, val interface{}) (err error) } ) + +func IsBaseType(v interface{}) bool { + switch v.(type) { + case nil, string, []byte, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64, bool, time.Time, time.Duration, encoding.BinaryMarshaler: + return true + default: + return false + } +} diff --git a/lego/sys/redis/redis.go b/lego/sys/redis/redis.go index f8c76025e..510a35540 100644 --- a/lego/sys/redis/redis.go +++ b/lego/sys/redis/redis.go @@ -370,10 +370,6 @@ func (this *Redis) ScriptExists(ctx context.Context, hashes ...string) *redis.Bo return this.client.ScriptExists(ctx, hashes...) } -// func (this *Redis) ScriptLoad(ctx context.Context, script string) *redis.StringCmd { -// return this.client.ScriptLoad(ctx, script) -// } - //Codec--------------------------------------------------------------------------------------------------------------------------------------- func (this *Redis) Marshal(v interface{}) ([]byte, error) { if this.options.Codec != nil { diff --git a/lego/sys/redis/single/hash.go b/lego/sys/redis/single/hash.go index 4319984c8..d27ec1968 100644 --- a/lego/sys/redis/single/hash.go +++ b/lego/sys/redis/single/hash.go @@ -1,6 +1,8 @@ package single import ( + "go_dreamfactory/lego/sys/redis/core" + "github.com/go-redis/redis/v8" ) @@ -168,8 +170,12 @@ Redis Hset 命令用于为哈希表中的字段赋值 */ func (this *Redis) HSet(key string, field string, value interface{}) (err error) { var resultvalue []byte - if resultvalue, err = this.codec.Marshal(value); err == nil { - err = this.client.Do(this.client.Context(), "HSET", key, field, resultvalue).Err() + if !core.IsBaseType(value) { + if resultvalue, err = this.codec.Marshal(value); err == nil { + err = this.client.Do(this.client.Context(), "HSET", key, field, resultvalue).Err() + } + } else { + err = this.client.Do(this.client.Context(), "HSET", key, field, value).Err() } return } diff --git a/lego/sys/redis/sys_test.go b/lego/sys/redis/sys_test.go index c045617ff..6fd3b299b 100644 --- a/lego/sys/redis/sys_test.go +++ b/lego/sys/redis/sys_test.go @@ -122,7 +122,7 @@ func Test_Redis_Encoder_Hash(t *testing.T) { } //测试redis lua 脚本 -func Test_Redis_Lua(t *testing.T) { +func Test_Redis_Lua_HGETALL(t *testing.T) { script := redis.NewScript(` local key = tostring(KEYS[1]) local keys = redis.call("HGETALL", key) @@ -144,6 +144,47 @@ func Test_Redis_Lua(t *testing.T) { if result, err := ret.Result(); err != nil { fmt.Printf("Execute Redis err: %v", err.Error()) } else { - fmt.Printf("userid: %v", result) + temp1 := result.([]interface{}) + data := make([]map[string]string, len(temp1)) + for i, v := range temp1 { + temp2 := v.([]interface{}) + data[i] = make(map[string]string) + for n := 0; n < len(temp2); n += 2 { + data[i][temp2[n].(string)] = temp2[n+1].(string) + } + } + fmt.Printf("data: %v", data) + } +} + +//测试redis lua 脚本 +func Test_Redis_Lua_HSETALL(t *testing.T) { + script := redis.NewScript(` + local n = 1 + local key = "" + for i, v in ipairs(KEYS) do + key = v + local argv = {} + for i=n,#ARGV,1 do + n = n+1 + if ARGV[i] == "#end" then + redis.call("HMSet", key,unpack(argv)) + break + else + table.insert(argv, ARGV[i]) + end + end + end + return "OK" +`) + sha, err := script.Result() + if err != nil { + fmt.Println(err) + } + ret := redis.EvalSha(redis.Context(), sha, []string{"test_HMSet", "test_HMSet_1"}, "a", "1", "b", "2", "#end", "a1", "11", "b", "21", "#end") + if result, err := ret.Result(); err != nil { + fmt.Printf("Execute Redis err: %v", err.Error()) + } else { + fmt.Printf("data: %v", result) } } diff --git a/modules/comp_model.go b/modules/comp_model.go index 4432c4ea7..a4f2010cd 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -24,15 +24,51 @@ import ( "go.mongodb.org/mongo-driver/mongo" ) +//Redis 自定义脚本 批量读取列表数据 +var LusScriptgetList = ` +local key = tostring(KEYS[1]) +local keys = redis.call("HGETALL", key) +local data = {} +local n = 1 +for i, v in ipairs(keys) do + if i%2 == 0 then + data[n] = redis.call("HGETALL", v) + n = n+1 + end +end +return data +` + +//Redis 自定义脚本 批量写入列表数据 +var LusScriptsetList = ` +local n = 1 +for i, v in ipairs(KEYS) do + local key = v + local argv = {} + for i=n,#ARGV,1 do + n = n+1 + if ARGV[i] == "#end" then + redis.call("HMSet", key,unpack(argv)) + break + else + table.insert(argv, ARGV[i]) + end + end +end +return "OK" +` + /* 基础组件 缓存组件 读写缓存数据 DB组件也封装进来 */ type MCompModel struct { cbase.ModuleCompBase - Redis redis.ISys - DB mgo.ISys - TableName string //redis key前缀 + Redis redis.ISys + DB mgo.ISys + TableName string //redis key前缀 + getListSha1 string //getList LusScript 的shal值 + setListSha1 string //getList LusScript 的shal值 } const ( @@ -48,6 +84,12 @@ func (this *MCompModel) Init(service core.IService, module core.IModule, comp co } func (this *MCompModel) Start() (err error) { err = this.ModuleCompBase.Start() + if this.getListSha1, err = this.Redis.NewScript(LusScriptgetList).Result(); err != nil { + return + } + if this.setListSha1, err = this.Redis.NewScript(LusScriptsetList).Result(); err != nil { + return + } return } @@ -170,7 +212,7 @@ func (this *MCompModel) AddLists(uid string, data interface{}, attrs ...*cache.O lists[i] = valuedata } - if err = this.Redis.HMSet(this.ukey(uid), listskeys); err != nil { + if err = this.Redis.HMSetForMap(this.ukey(uid), listskeys); err != nil { return } if ret := cache.OperationAttrs(attrs).Find(cache.ATTR_EXPIRE).Unwrap_Or(nil); ret != nil { @@ -334,7 +376,9 @@ func (this *MCompModel) GetList(uid string, data interface{}) (err error) { n int ok bool keys map[string]string - cdata map[string]string + cdata []map[string]string + wdata map[string]map[string]string + tempdata map[string]string c *mongo.Cursor ) keys = make(map[string]string) @@ -361,21 +405,16 @@ func (this *MCompModel) GetList(uid string, data interface{}) (err error) { return } sliceelemType = sliceelemType.(*reflect2.UnsafePtrType).Elem() - err = this.Redis.HGetAll(this.ukey(uid), &keys) - if err == nil { - n = 0 - for _, v := range keys { - if cdata, err = this.Redis.HGetAllToMapString(v); err != nil { - return - } + if cdata, err = this.batchgetlists(this.ukey(uid)); err == nil { + for _, v := range cdata { sliceType.UnsafeGrow(dptr, n+1) elemPtr = sliceType.UnsafeGetIndex(dptr, n) if *((*unsafe.Pointer)(elemPtr)) == nil { newPtr := sliceelemType.UnsafeNew() - decoder.DecodeForMapJson(newPtr, cdata) + decoder.DecodeForMapJson(newPtr, v) *((*unsafe.Pointer)(elemPtr)) = newPtr } else { - decoder.DecodeForMapJson(*((*unsafe.Pointer)(elemPtr)), cdata) + decoder.DecodeForMapJson(*((*unsafe.Pointer)(elemPtr)), v) } n++ } @@ -390,6 +429,7 @@ func (this *MCompModel) GetList(uid string, data interface{}) (err error) { return } n = 0 + wdata = make(map[string]map[string]string) for c.Next(context.Background()) { _id := c.Current.Lookup("_id").StringValue() sliceType.UnsafeGrow(dptr, n+1) @@ -399,23 +439,20 @@ func (this *MCompModel) GetList(uid string, data interface{}) (err error) { *((*unsafe.Pointer)(elemPtr)) = newPtr } elem := sliceType.GetIndex(data, n) - n++ if err = c.Decode(elem); err != nil { return } - if cdata, err = encoder.EncodeToMapJson(*((*unsafe.Pointer)(elemPtr))); err != nil { + if tempdata, err = encoder.EncodeToMapJson(*((*unsafe.Pointer)(elemPtr))); err != nil { return } key := this.ukeylist(uid, _id) - if err = this.Redis.HMSetForMap(key, cdata); err != nil { - return - } + wdata[key] = tempdata keys[_id] = key + n++ } - if len(keys) > 0 { - if err = this.Redis.HMSet(this.ukey(uid), keys); err != nil { - return - } + if len(wdata) > 0 { + wdata[this.ukey(uid)] = keys + err = this.batchsetlists(wdata) } } } @@ -481,6 +518,54 @@ func (this *MCompModel) GetUserExpand(uid string) (result *pb.DBUserExpand, err return } +//批量读取列表数据 +func (this *MCompModel) batchgetlists(key string) (result []map[string]string, err error) { + var data interface{} + ret := this.Redis.EvalSha(this.Redis.Context(), this.getListSha1, []string{key}) + if data, err = ret.Result(); err != nil { + fmt.Printf("Execute batchgetlists err: %v", err.Error()) + } else { + temp1 := data.([]interface{}) + result = make([]map[string]string, len(temp1)) + for i, v := range temp1 { + temp2 := v.([]interface{}) + result[i] = make(map[string]string) + for n := 0; n < len(temp2); n += 2 { + result[i][temp2[n].(string)] = temp2[n+1].(string) + } + } + if len(result) == 0 { + err = redis.RedisNil + return + } + } + return +} + +//批量写入数据 +func (this *MCompModel) batchsetlists(data map[string]map[string]string) (err error) { + var ( + n int + keys []string + values []interface{} + ) + keys = make([]string, len(data)) + values = make([]interface{}, len(data)) + + for k, v := range data { + keys[n] = k + for k1, v1 := range v { + values = append(values, k1, v1) + } + values = append(values, "#end") + } + ret := this.Redis.EvalSha(this.Redis.Context(), this.getListSha1, keys, values...) + if _, err := ret.Result(); err != nil { + fmt.Printf("Execute batchsetlists err: %v", err.Error()) + } + return +} + //日志操作可选项 func (this *MCompModel) logOpt(uid string, data interface{}, attrs ...*cache.OperationAttr) error { ret := cache.OperationAttrs(attrs).Find(cache.ATTR_MGOLOG).Unwrap_Or(nil) diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index 9970daa8b..609f3ceec 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -304,20 +304,6 @@ func (this *ModelItemsComp) pack_addItemToUserPack(uid string, items []*pb.DB_Us return } if leftnum > 0 { //还没有放完 寻找空的格子填充 - for _, v := range items { - if leftnum <= int64(conf.Maxnum) { - v.ItemId = itemId - v.Amount = uint32(leftnum) - leftnum = 0 - update = append(update, v) - break - } else { - leftnum -= int64(conf.Maxnum) - v.ItemId = itemId - v.Amount = uint32(conf.Maxnum) - update = append(update, v) - } - } index := int32(len(items)) for leftnum > 0 { //需要补充格子 if leftnum <= int64(conf.Maxnum) { diff --git a/modules/items/module_test.go b/modules/items/module_test.go index 15e1fe472..9ce8b44e8 100644 --- a/modules/items/module_test.go +++ b/modules/items/module_test.go @@ -85,7 +85,7 @@ func TestMain(m *testing.M) { func Test_Modules(t *testing.T) { data, _ := ptypes.MarshalAny(&pb.ItemsGetlistReq{IType: 9}) reply := &pb.RPCMessageReply{} - s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{UserId: "0_62cd5952f72cc4bdc2d85f6b", MainType: "items", SubType: "getlist", Message: data}, reply) + s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{UserId: "0_62c259916d8cf3e4e06311a8", MainType: "items", SubType: "getlist", Message: data}, reply) log.Debugf("reply:%v", reply) } From 12b8a7943257310d708bcc9fa9827d86ad31ae56 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 15 Jul 2022 16:14:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0redis=20=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E8=AF=BB=E5=86=99=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/comp_model.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/comp_model.go b/modules/comp_model.go index a4f2010cd..27a8f3618 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -550,7 +550,7 @@ func (this *MCompModel) batchsetlists(data map[string]map[string]string) (err er values []interface{} ) keys = make([]string, len(data)) - values = make([]interface{}, len(data)) + values = make([]interface{}, 0) for k, v := range data { keys[n] = k @@ -558,8 +558,9 @@ func (this *MCompModel) batchsetlists(data map[string]map[string]string) (err er values = append(values, k1, v1) } values = append(values, "#end") + n++ } - ret := this.Redis.EvalSha(this.Redis.Context(), this.getListSha1, keys, values...) + ret := this.Redis.EvalSha(this.Redis.Context(), this.setListSha1, keys, values...) if _, err := ret.Result(); err != nil { fmt.Printf("Execute batchsetlists err: %v", err.Error()) } From fe034ea284cce2e122d3870cd800b7e7087f75d6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 15 Jul 2022 16:41:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_starUp.go | 2 +- modules/hero/api_strengthen.go | 6 ++++- pb/errorcode.pb.go | 49 +++++++++++++++++++++------------- pb/proto/errorcode.proto | 2 ++ 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/modules/hero/api_starUp.go b/modules/hero/api_starUp.go index 5dccd63db..2c83b23e5 100644 --- a/modules/hero/api_starUp.go +++ b/modules/hero/api_starUp.go @@ -75,7 +75,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } } if target == nil { - code = pb.ErrorCode_HeroNoExist + code = pb.ErrorCode_HeroStarErr //升星条件不满足 return } // 优先校验数量对不对 diff --git a/modules/hero/api_strengthen.go b/modules/hero/api_strengthen.go index 2158b1103..25a930b88 100644 --- a/modules/hero/api_strengthen.go +++ b/modules/hero/api_strengthen.go @@ -38,7 +38,11 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren if code != pb.ErrorCode_Success { return } - + // 只有英雄卡才能升级 + if _hero.CardType != comm.CardTypeHero { + code = pb.ErrorCode_HeroTypeErr + return + } _expHero, code = this.module.GetHero(session.GetUserId(), req.ExpCardID) // 校验需要消耗经验卡牌的对象是否存在 if code != pb.ErrorCode_Success { return diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 1810a18bd..bdcb6694a 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -84,6 +84,9 @@ const ( ErrorCode_HeroMaxAwaken ErrorCode = 1312 // 达到最大觉醒等级 ErrorCode_HeroIsLock ErrorCode = 1313 // 英雄被锁定不能被消耗 ErrorCode_HeroMaxCount ErrorCode = 1314 // 英雄达到最大数量 + ErrorCode_HeroCostTypeErr ErrorCode = 1315 // 消耗英雄参数不匹配 + ErrorCode_HeroStarErr ErrorCode = 1316 // 不满足升星条件 + ErrorCode_HeroTypeErr ErrorCode = 1317 // 升级英雄类型不对 // equipment ErrorCode_EquipmentOnFoundEquipment ErrorCode = 1400 // 未找到武器 ErrorCode_EquipmentLvlimitReached ErrorCode = 1401 // 武器等级已达上限 @@ -160,6 +163,9 @@ var ( 1312: "HeroMaxAwaken", 1313: "HeroIsLock", 1314: "HeroMaxCount", + 1315: "HeroCostTypeErr", + 1316: "HeroStarErr", + 1317: "HeroTypeErr", 1400: "EquipmentOnFoundEquipment", 1401: "EquipmentLvlimitReached", 1500: "StoryNotFindChapter", @@ -230,6 +236,9 @@ var ( "HeroMaxAwaken": 1312, "HeroIsLock": 1313, "HeroMaxCount": 1314, + "HeroCostTypeErr": 1315, + "HeroStarErr": 1316, + "HeroTypeErr": 1317, "EquipmentOnFoundEquipment": 1400, "EquipmentLvlimitReached": 1401, "StoryNotFindChapter": 1500, @@ -275,7 +284,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, 0x87, 0x0b, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xc1, 0x0b, 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, @@ -348,23 +357,27 @@ var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x10, 0xa0, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0xa1, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x10, 0xa2, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, - 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, - 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, - 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, - 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x6f, 0x74, - 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x12, - 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, - 0xdd, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, - 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, - 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, - 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc6, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, - 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, - 0xc4, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc5, 0x0c, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x6e, 0x74, 0x10, 0xa2, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, + 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa3, 0x0a, 0x12, 0x10, 0x0a, 0x0b, + 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, + 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa5, 0x0a, + 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, + 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, + 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x18, + 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, + 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, + 0x79, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x0d, 0x0a, 0x08, + 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, + 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, + 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, + 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, + 0x74, 0x10, 0xc6, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc4, 0x0c, 0x12, 0x17, 0x0a, 0x12, + 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, + 0x67, 0x68, 0x10, 0xc5, 0x0c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto index a0f0941e2..c0e74f04d 100644 --- a/pb/proto/errorcode.proto +++ b/pb/proto/errorcode.proto @@ -68,6 +68,8 @@ enum ErrorCode { HeroIsLock = 1313; // 英雄被锁定不能被消耗 HeroMaxCount = 1314; // 英雄达到最大数量 HeroCostTypeErr = 1315; // 消耗英雄参数不匹配 + HeroStarErr = 1316; // 不满足升星条件 + HeroTypeErr = 1317; // 升级英雄类型不对 // equipment EquipmentOnFoundEquipment = 1400; // 未找到武器