From d04eb6b8a061258ec2f2fb2a3978ffae2109b8c7 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 27 Jul 2022 20:30:47 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=90=8C=E6=AD=A5item=20=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_item.json | 258 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 237 insertions(+), 21 deletions(-) diff --git a/bin/json/game_item.json b/bin/json/game_item.json index 6773baf2e..4147429db 100644 --- a/bin/json/game_item.json +++ b/bin/json/game_item.json @@ -57,8 +57,8 @@ "isani": 0, "star": 0, "race": 0, - "img": "wp_icon_0001", - "ico": "wp_icon_0001", + "img": "wp_icon_10002", + "ico": "wp_icon_10002", "intr": { "key": "itemdesc_10002", "text": "一块测试功能的石头,他可能是某个不能使用的活动道具" @@ -288,13 +288,13 @@ ] }, { - "id": "1", + "id": "10009", "name": { - "key": "itemname_1", - "text": "宝箱自选" + "key": "itemname_10009", + "text": "被封印的魔法书" }, - "usetype": 4, - "color": 4, + "usetype": 2, + "color": 6, "bagtype": 1, "index": 9, "special_type": 0, @@ -309,11 +309,11 @@ "isani": 0, "star": 0, "race": 0, - "img": "wp_icon_0001", - "ico": "wp_icon_0001", + "img": "wp_icon_10009", + "ico": "wp_icon_10009", "intr": { - "key": "itemdesc_1", - "text": "可以在以下道具中选择任选1个" + "key": "itemdesc_10009", + "text": "这本魔法书被强大的魔法封印了,通过第9999关后可以开启" }, "sale": [ { @@ -324,13 +324,13 @@ ] }, { - "id": "2", + "id": "10010", "name": { - "key": "itemname_2", - "text": "金币" + "key": "itemname_10010", + "text": "古代硬币" }, - "usetype": 4, - "color": 3, + "usetype": 2, + "color": 5, "bagtype": 1, "index": 10, "special_type": 0, @@ -340,16 +340,232 @@ "synthetize_num": 0, "access": 0, "use_skip": 0, - "upper_limit": 99999999, + "upper_limit": 999, "uselv": 0, "isani": 0, "star": 0, "race": 0, - "img": "wp_icon_0002", - "ico": "wp_icon_0002", + "img": "wp_icon_10010", + "ico": "wp_icon_10010", "intr": { - "key": "itemdesc_2", - "text": "货币" + "key": "itemdesc_10010", + "text": "似乎是某个失落文明的货币,暂时只有纪念意义" + }, + "sale": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] + }, + { + "id": "10011", + "name": { + "key": "itemname_10011", + "text": "坏掉的钟表" + }, + "usetype": 2, + "color": 3, + "bagtype": 1, + "index": 11, + "special_type": 0, + "time": 0, + "effects": "", + "box_id": 0, + "synthetize_num": 0, + "access": 0, + "use_skip": 0, + "upper_limit": 999, + "uselv": 0, + "isani": 0, + "star": 0, + "race": 0, + "img": "wp_icon_10011", + "ico": "wp_icon_10011", + "intr": { + "key": "itemdesc_10011", + "text": "表针一动不动,也许有人可以修好它。" + }, + "sale": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] + }, + { + "id": "10012", + "name": { + "key": "itemname_10012", + "text": "木材" + }, + "usetype": 2, + "color": 2, + "bagtype": 1, + "index": 12, + "special_type": 0, + "time": 0, + "effects": "", + "box_id": 0, + "synthetize_num": 0, + "access": 0, + "use_skip": 0, + "upper_limit": 999, + "uselv": 0, + "isani": 0, + "star": 0, + "race": 0, + "img": "wp_icon_10012", + "ico": "wp_icon_10012", + "intr": { + "key": "itemdesc_10012", + "text": "精致的木材,散发着淡淡的香气" + }, + "sale": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] + }, + { + "id": "10013", + "name": { + "key": "itemname_10013", + "text": "四叶草" + }, + "usetype": 2, + "color": 4, + "bagtype": 1, + "index": 13, + "special_type": 0, + "time": 0, + "effects": "", + "box_id": 0, + "synthetize_num": 0, + "access": 0, + "use_skip": 0, + "upper_limit": 999, + "uselv": 0, + "isani": 0, + "star": 0, + "race": 0, + "img": "wp_icon_10013", + "ico": "wp_icon_10013", + "intr": { + "key": "itemdesc_10013", + "text": "把它放在背包里会带来好运" + }, + "sale": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] + }, + { + "id": "10014", + "name": { + "key": "itemname_10014", + "text": "冒险家勋章" + }, + "usetype": 2, + "color": 6, + "bagtype": 1, + "index": 14, + "special_type": 0, + "time": 0, + "effects": "", + "box_id": 0, + "synthetize_num": 0, + "access": 0, + "use_skip": 0, + "upper_limit": 999, + "uselv": 0, + "isani": 0, + "star": 0, + "race": 0, + "img": "wp_icon_10014", + "ico": "wp_icon_10014", + "intr": { + "key": "itemdesc_10014", + "text": "你登录了游戏就是冒险家,就会获得这个勋章" + }, + "sale": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] + }, + { + "id": "10015", + "name": { + "key": "itemname_10015", + "text": "猫猫护身符" + }, + "usetype": 2, + "color": 5, + "bagtype": 1, + "index": 15, + "special_type": 0, + "time": 0, + "effects": "", + "box_id": 0, + "synthetize_num": 0, + "access": 0, + "use_skip": 0, + "upper_limit": 999, + "uselv": 0, + "isani": 0, + "star": 0, + "race": 0, + "img": "wp_icon_10015", + "ico": "wp_icon_10015", + "intr": { + "key": "itemdesc_10015", + "text": "比幸运草更幸运" + }, + "sale": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] + }, + { + "id": "10016", + "name": { + "key": "itemname_10016", + "text": "人造钻石" + }, + "usetype": 2, + "color": 3, + "bagtype": 1, + "index": 16, + "special_type": 0, + "time": 0, + "effects": "", + "box_id": 0, + "synthetize_num": 0, + "access": 0, + "use_skip": 0, + "upper_limit": 999, + "uselv": 0, + "isani": 0, + "star": 0, + "race": 0, + "img": "wp_icon_10016", + "ico": "wp_icon_10016", + "intr": { + "key": "itemdesc_10016", + "text": "钻石是人造的,所以不能用来买商城的商品" }, "sale": [ { From 9e3ade03ed5e323a39c95d6cdd78ffd1fbecc917 Mon Sep 17 00:00:00 2001 From: zhaocy Date: Thu, 28 Jul 2022 09:35:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E6=B4=BB=E8=B7=83=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/task/module.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/task/module.go b/modules/task/module.go index f0604f81c..328c5971f 100644 --- a/modules/task/module.go +++ b/modules/task/module.go @@ -63,8 +63,22 @@ func (this *ModuleTask) CleanTask(session comm.IUserSession) { this.modelTaskActive.BatchDelLists(session.GetUserId()) } +// 重置玩家活跃度 +func (this *ModuleTask) resetActive(uid string, taskTag comm.TaskTag) { + update := make(map[string]interface{}) + if taskTag == comm.TASK_DAILY { + update["activeday"] = 0 + } else if taskTag == comm.TASK_WEEKLY { + update["activeweek"] = 0 + } + if len(update) > 0 { + this.ModuleUser.ChanageUserExpand(uid, update) + } +} + //重置任务 func (this *ModuleTask) ResetTask(uid string, taskTag comm.TaskTag) { + this.resetActive(uid, taskTag) this.modelTask.clearTask(uid, taskTag) this.modelTaskActive.clearTask(uid, taskTag) this.InitTaskAll(uid) From 47a28e75895e37f39b56cf5ad5226082450e0c86 Mon Sep 17 00:00:00 2001 From: zhaocy Date: Thu, 28 Jul 2022 11:58:26 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=BB=86=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 26 +++-- pb/errorcode.pb.go | 236 +++++++++++++++++++++------------------ 2 files changed, 141 insertions(+), 121 deletions(-) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 4400e4d5d..1aefd90bc 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -75,15 +75,15 @@ locp: go this.Close() break locp } else { - err = this.secAuth(msg) + var code pb.ErrorCode + code, err = this.secAuth(msg) if err == nil { if err := this.messageDistribution(msg); err != nil { go this.Close() break locp } } else { - this.gateway.Errorf("agent:%s uId:%s 秘钥无效 err:%v", this.sessionId, this.uId, err) - data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode_SecKeyInvalid, Message: err.Error()}) + data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: code, Message: err.Error()}) if err = this.WriteMsg(&pb.UserMessage{ MainType: comm.MainTypeNotify, SubType: comm.SubTypeErrorNotify, @@ -125,27 +125,29 @@ locp: } //安全认证 所有协议 -func (this *Agent) secAuth(msg *pb.UserMessage) error { +func (this *Agent) secAuth(msg *pb.UserMessage) (code pb.ErrorCode, err error) { if !utils.ValidSecretKey(msg.Sec) { //验证失败 - return fmt.Errorf("key invalid") + log.Errorf("%v", msg.Sec) + return pb.ErrorCode_SignError, fmt.Errorf("key invalid") } return this.decodeUserData(msg) } //解码 -func (this *Agent) decodeUserData(msg *pb.UserMessage) error { +func (this *Agent) decodeUserData(msg *pb.UserMessage) (code pb.ErrorCode, err error) { base64Str := msg.Sec dec, err := base64.StdEncoding.DecodeString(base64Str[35:]) if err != nil { log.Errorf("base64 decode err %v", err) - return nil + return pb.ErrorCode_DecodeError, nil } now := time.Now().Unix() jsonRet := gjson.Parse(string(dec)) timestamp := jsonRet.Get("timestamp").Int() //秘钥30秒失效 if now-time.Unix(timestamp, 0).Unix() > 30 { - return fmt.Errorf("sec key expire") + log.Errorf("last timestamp:%v more than 30s", timestamp) + return pb.ErrorCode_TimestampTimeout, fmt.Errorf("sec key expire") } //只有login的时候才需要设置Data @@ -158,15 +160,17 @@ func (this *Agent) decodeUserData(msg *pb.UserMessage) error { } ad, err := anypb.New(req) if err != nil { - return err + log.Errorf("decodeUserData pb err:%v", err) + return pb.ErrorCode_PbError, err } msg.Data = ad } else { if msg.MainType != string(comm.ModuleNotify) && this.UserId() == "" { - return fmt.Errorf("no login") + log.Errorf("[%v.%v] Agent UId empty", msg.MainType, msg.SubType) + return pb.ErrorCode_AgentUidEmpty, fmt.Errorf("no login") } } - return nil + return pb.ErrorCode_Success, nil } func (this *Agent) SessionId() string { diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 11dfa05e1..747b65968 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -30,13 +30,17 @@ const ( ErrorCode_CacheReadError ErrorCode = 13 //缓存读取失败 ErrorCode_SqlExecutionError ErrorCode = 14 //数据库执行错误 ErrorCode_ReqParameterError ErrorCode = 15 //请求参数错误 - ErrorCode_SignError ErrorCode = 16 //签名错误 + ErrorCode_SignError ErrorCode = 16 //签名串错误 ErrorCode_InsufficientPermissions ErrorCode = 17 //权限不足 ErrorCode_NoLogin ErrorCode = 18 //未登录 ErrorCode_UserSessionNobeing ErrorCode = 19 //用户不存在 ErrorCode_StateInvalid ErrorCode = 20 //无效状态 ErrorCode_DBError ErrorCode = 21 //数据库操作失败 ErrorCode_SystemError ErrorCode = 22 //通用错误 + ErrorCode_DecodeError ErrorCode = 23 //加密串解码错误 + ErrorCode_TimestampTimeout ErrorCode = 24 //加密串时间戳超时 + ErrorCode_PbError ErrorCode = 25 // pb错误 + ErrorCode_AgentUidEmpty ErrorCode = 26 // AgentUid空 ErrorCode_Exception ErrorCode = 100 //程序执行异常 ErrorCode_Unknown ErrorCode = 101 //未知错误 ErrorCode_ResNoEnough ErrorCode = 102 //资源不足 @@ -144,6 +148,10 @@ var ( 20: "StateInvalid", 21: "DBError", 22: "SystemError", + 23: "DecodeError", + 24: "TimestampTimeout", + 25: "PbError", + 26: "AgentUidEmpty", 100: "Exception", 101: "Unknown", 102: "ResNoEnough", @@ -239,6 +247,10 @@ var ( "StateInvalid": 20, "DBError": 21, "SystemError": 22, + "DecodeError": 23, + "TimestampTimeout": 24, + "PbError": 25, + "AgentUidEmpty": 26, "Exception": 100, "Unknown": 101, "ResNoEnough": 102, @@ -352,7 +364,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, 0xc1, 0x0f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0x88, 0x10, 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, @@ -370,114 +382,118 @@ var file_errorcode_proto_rawDesc = []byte{ 0x6e, 0x4e, 0x6f, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x10, 0x13, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0x14, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x42, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x15, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x16, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, - 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, - 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x4e, 0x6f, 0x45, - 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x66, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x10, 0x67, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4e, 0x6f, 0x46, - 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x68, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, - 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x0b, 0x0a, 0x06, 0x53, 0x65, - 0x63, 0x4b, 0x65, 0x79, 0x10, 0xe9, 0x07, 0x12, 0x0d, 0x0a, 0x08, 0x42, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x10, 0xea, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, - 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xeb, 0x07, 0x12, 0x14, 0x0a, 0x0f, 0x44, 0x69, 0x61, - 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xec, 0x07, 0x12, - 0x10, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x10, 0xed, - 0x07, 0x12, 0x16, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, - 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xee, 0x07, 0x12, 0x14, 0x0a, 0x0f, 0x56, 0x65, 0x72, - 0x69, 0x43, 0x6f, 0x64, 0x65, 0x4e, 0x6f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x10, 0xef, 0x07, 0x12, - 0x14, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x64, 0x10, 0xf0, 0x07, 0x12, 0x12, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x10, 0xf1, 0x07, 0x12, 0x16, 0x0a, 0x11, 0x55, 0x73, 0x65, - 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x4e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xf2, - 0x07, 0x12, 0x16, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, - 0x65, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xf3, 0x07, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, 0x66, 0x10, 0xcc, 0x08, 0x12, 0x12, 0x0a, - 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4d, 0x61, 0x78, 0x10, 0xcd, - 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x4d, 0x61, 0x78, 0x10, 0xce, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xcf, 0x08, 0x12, 0x17, - 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x6f, - 0x44, 0x61, 0x74, 0x61, 0x10, 0xd0, 0x08, 0x12, 0x0e, 0x0a, 0x09, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x59, 0x65, 0x74, 0x10, 0xd1, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x65, 0x74, 0x10, 0xd2, 0x08, 0x12, 0x17, 0x0a, 0x12, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, - 0x65, 0x74, 0x10, 0xd3, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd4, 0x08, - 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd5, 0x08, 0x12, 0x13, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x10, 0xd6, 0x08, 0x12, 0x1a, 0x0a, 0x15, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xd7, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, - 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, - 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, - 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, - 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, - 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, - 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, - 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, - 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, - 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, - 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, - 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, - 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, - 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9a, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, - 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, - 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, - 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, - 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x10, 0x9d, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, - 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x9e, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, - 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, - 0x0a, 0x12, 0x12, 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, 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, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, - 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa6, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, - 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78, 0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, - 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, - 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, - 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, - 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 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, 0x1b, 0x0a, - 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, - 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, - 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, - 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, - 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, - 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, - 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, - 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 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, - 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, - 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, - 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, - 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, - 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, - 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, 0x10, - 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, 0x0c, - 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, - 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, - 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, - 0x72, 0x72, 0x10, 0x88, 0x0e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x16, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x65, + 0x63, 0x6f, 0x64, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x17, 0x12, 0x14, 0x0a, 0x10, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x10, + 0x18, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x62, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x19, 0x12, 0x11, + 0x0a, 0x0d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x55, 0x69, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, + 0x1a, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x64, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x65, 0x12, 0x0f, 0x0a, + 0x0b, 0x52, 0x65, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x66, 0x12, 0x1a, + 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x67, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x68, 0x12, 0x12, 0x0a, + 0x0d, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0xe8, + 0x07, 0x12, 0x0b, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x4b, 0x65, 0x79, 0x10, 0xe9, 0x07, 0x12, 0x0d, + 0x0a, 0x08, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x10, 0xea, 0x07, 0x12, 0x11, 0x0a, + 0x0c, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xeb, 0x07, + 0x12, 0x14, 0x0a, 0x0f, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, + 0x75, 0x67, 0x68, 0x10, 0xec, 0x07, 0x12, 0x10, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x10, 0xed, 0x07, 0x12, 0x16, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xee, 0x07, + 0x12, 0x14, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, 0x4e, 0x6f, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x10, 0xef, 0x07, 0x12, 0x14, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, + 0x64, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x10, 0xf0, 0x07, 0x12, 0x12, 0x0a, 0x0d, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x10, 0xf1, 0x07, + 0x12, 0x16, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x4e, 0x61, 0x6d, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xf2, 0x07, 0x12, 0x16, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xf3, 0x07, + 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x53, 0x65, 0x6c, + 0x66, 0x10, 0xcc, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, + 0x6c, 0x66, 0x4d, 0x61, 0x78, 0x10, 0xcd, 0x08, 0x12, 0x14, 0x0a, 0x0f, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x10, 0xce, 0x08, 0x12, 0x15, + 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x4e, 0x6f, 0x44, 0x61, + 0x74, 0x61, 0x10, 0xcf, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xd0, 0x08, 0x12, 0x0e, + 0x0a, 0x09, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x59, 0x65, 0x74, 0x10, 0xd1, 0x08, 0x12, 0x13, + 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x59, 0x65, 0x74, + 0x10, 0xd2, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x6c, + 0x66, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd3, 0x08, 0x12, 0x19, 0x0a, 0x14, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x6c, 0x61, 0x63, + 0x6b, 0x59, 0x65, 0x74, 0x10, 0xd4, 0x08, 0x12, 0x15, 0x0a, 0x10, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xd5, 0x08, 0x12, 0x13, + 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x4d, 0x61, 0x78, + 0x10, 0xd6, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xd7, 0x08, 0x12, + 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, + 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, + 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, + 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x19, 0x0a, + 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, + 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, + 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, + 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, + 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, + 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, + 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, + 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9a, 0x0a, 0x12, + 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, + 0x65, 0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x74, 0x4e, + 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c, 0x0a, 0x12, 0x11, + 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x10, 0x9d, + 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, + 0x9e, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, 0x0a, 0x12, 0x12, 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, 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, 0x13, 0x0a, 0x0e, 0x48, 0x65, + 0x72, 0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa6, 0x0a, 0x12, + 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78, 0x45, 0x78, 0x70, + 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x4c, + 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, + 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0a, 0x14, 0x44, + 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, + 0x75, 0x6e, 0x64, 0x10, 0xaa, 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, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, + 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, + 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, + 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, + 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, + 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, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, + 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, + 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, + 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, + 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, + 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, + 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, + 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, + 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, + 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, + 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10, 0x88, 0x0e, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 8cee759b62e86041d8342d490d4c5d26125697e0 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 28 Jul 2022 14:30:14 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 1aefd90bc..7fdbc165c 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -83,6 +83,7 @@ locp: break locp } } else { + this.gateway.Errorf("agent:%s uId:%s 密钥无效 err:%v", this.sessionId, this.uId, err) data, _ := anypb.New(&pb.NotifyErrorNotifyPush{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: code, Message: err.Error()}) if err = this.WriteMsg(&pb.UserMessage{ MainType: comm.MainTypeNotify, From dd21220b46ae47048fd4850972d6200a5758f891 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 28 Jul 2022 15:00:50 +0800 Subject: [PATCH 5/5] =?UTF-8?q?hp=E5=B1=9E=E6=80=A7=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E7=8E=A9=E5=AE=B6=E5=A4=96=E5=9B=B4?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/chat/api_chanagechannel.go | 2 +- modules/chat/api_crosschannel.go | 2 +- modules/chat/api_spangetlist.go | 2 +- modules/chat/api_spansend.go | 2 +- modules/chat/modelChat.go | 2 +- modules/comp_model.go | 57 +++++++++++------------------- modules/hero/model_hero.go | 23 +++--------- modules/notify/api_getlist.go | 4 +-- modules/user/api_create.go | 2 +- modules/user/api_figure.go | 4 +-- modules/user/api_gettujian.go | 2 +- modules/user/api_modifyname.go | 4 +-- modules/user/model_expand.go | 49 +++++++++++++++++++++++++ modules/user/model_record.go | 2 +- modules/user/model_setting.go | 4 +-- modules/user/model_user.go | 2 +- modules/user/module.go | 7 ++-- 17 files changed, 95 insertions(+), 75 deletions(-) create mode 100644 modules/user/model_expand.go diff --git a/modules/chat/api_chanagechannel.go b/modules/chat/api_chanagechannel.go index caf874f78..fcedbec7c 100644 --- a/modules/chat/api_chanagechannel.go +++ b/modules/chat/api_chanagechannel.go @@ -28,7 +28,7 @@ func (this *apiComp) ChanageChannel(session comm.IUserSession, req *pb.ChatChana code = pb.ErrorCode_DBError return } - this.module.modelChat.ChanageUserExpand(session.GetUserId(), map[string]interface{}{ + this.module.ModuleUser.ChanageUserExpand(session.GetUserId(), map[string]interface{}{ "chatchannel": req.ChannelId, }) } diff --git a/modules/chat/api_crosschannel.go b/modules/chat/api_crosschannel.go index dd8992a40..a32ce3a47 100644 --- a/modules/chat/api_crosschannel.go +++ b/modules/chat/api_crosschannel.go @@ -23,7 +23,7 @@ func (this *apiComp) CrossChannel(session comm.IUserSession, req *pb.ChatCrossCh code = pb.ErrorCode_DBError return } - this.module.modelChat.ChanageUserExpand(session.GetUserId(), map[string]interface{}{ + this.module.ModuleUser.ChanageUserExpand(session.GetUserId(), map[string]interface{}{ "chatchannel": channel, }) session.SendMsg(string(this.module.GetType()), "crosschannel", &pb.ChatCrossChannelResp{ChannelId: channel}) diff --git a/modules/chat/api_spangetlist.go b/modules/chat/api_spangetlist.go index 670f33217..b01a9850a 100644 --- a/modules/chat/api_spangetlist.go +++ b/modules/chat/api_spangetlist.go @@ -21,7 +21,7 @@ func (this *apiComp) SpanGetList(session comm.IUserSession, req *pb.ChatSpanGetL list []*pb.DBChat group int32 ) - if result, err = this.module.modelChat.GetUserExpand(session.GetUserId()); err != nil { + if result, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { this.module.Errorf("err:%v", err) return } diff --git a/modules/chat/api_spansend.go b/modules/chat/api_spansend.go index 8b0f262b0..658140716 100644 --- a/modules/chat/api_spansend.go +++ b/modules/chat/api_spansend.go @@ -26,7 +26,7 @@ func (this *apiComp) SpanSend(session comm.IUserSession, req *pb.ChatSpanSendReq group int32 max_chat int32 ) - if userexpand, err = this.module.modelChat.GetUserExpand(session.GetUserId()); err != nil { + if userexpand, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { code = pb.ErrorCode_DBError return } diff --git a/modules/chat/modelChat.go b/modules/chat/modelChat.go index fa4669230..1f04e44c4 100644 --- a/modules/chat/modelChat.go +++ b/modules/chat/modelChat.go @@ -220,7 +220,7 @@ func (this *modelChatComp) RemoveCrossChannelMember(session comm.IUserSession) ( var ( result *pb.DBUserExpand ) - if result, err = this.GetUserExpand(session.GetUserId()); err != nil { + if result, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { this.module.Errorf("err:%v", err) return } diff --git a/modules/comp_model.go b/modules/comp_model.go index edaa3836a..31d3a9aad 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -517,43 +517,17 @@ func (this *MCompModel) DelListlds(uid string, ids ...string) (err error) { } // 清除玩家英雄缓存信息 -func (this *MCompModel) ClearnHeroCache(uid string, ids ...string) (err error) { - listkey := this.ukey(uid) - for _, v := range ids { - key := this.ukeylist(uid, v) - if err = this.Redis.Delete(key); err != nil { - return - } - } - err = this.Redis.HDel(listkey, ids...) - return -} - -//获取用户通过扩展表 -func (this *MCompModel) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { - result = &pb.DBUserExpand{} - key := fmt.Sprintf("userexpand:%s", uid) - if err = this.Redis.HGetAll(key, result); err != nil { - return - } - if err == redis.RedisNil { - if err = this.DB.FindOne(core.SqlTable("userexpand"), bson.M{"uid": uid}).Decode(result); err != nil { - return - } - err = this.Redis.HMSet(key, result) - } - return -} - -//修改用户扩展数据 -func (this *MCompModel) ChanageUserExpand(uid string, value map[string]interface{}) (err error) { - key := fmt.Sprintf("userexpand:%s", uid) - if err = this.Redis.HMSet(key, value); err != nil && err != redis.RedisNil { - return - } - err = this.UpdateModelLogs("userexpand", uid, bson.M{"uid": uid}, value) - return -} +// func (this *MCompModel) ClearnHeroCache(uid string, ids ...string) (err error) { +// listkey := this.ukey(uid) +// for _, v := range ids { +// key := this.ukeylist(uid, v) +// if err = this.Redis.Delete(key); err != nil { +// return +// } +// } +// err = this.Redis.HDel(listkey, ids...) +// return +// } //批量读取列表数据 func (this *MCompModel) Batchgetlists(key string) (result []map[string]string, err error) { @@ -722,3 +696,12 @@ func (this *MCompModel) ChangeUserRecord(uid string, value map[string]interface{ err = this.UpdateModelLogs("userrecord", uid, bson.M{"uid": uid}, value) return } + +// 删除玩家缓存信息 +func (this *MCompModel) CleanUserRecord(uid string) (err error) { + err = this.Redis.Delete(this.ukey(uid)) + if err != nil { + return err + } + return +} diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 1ea8d811e..87d663809 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -112,7 +112,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int hero = this.initHero(uid, heroCfgId) if hero != nil { // 添加图鉴 - if result, err1 := this.GetUserExpand(uid); err1 == nil { + if result, err1 := this.moduleHero.ModuleUser.GetUserExpand(uid); err1 == nil { sz := make(map[string]bool, 0) for k := range result.GetTujian() { sz[k] = true @@ -122,7 +122,8 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int initUpdate := map[string]interface{}{ "tujian": sz, } - this.ChanageUserExpand(uid, initUpdate) + + this.moduleHero.ModuleUser.ChanageUserExpand(uid, initUpdate) } } hero.SameCount = count @@ -401,26 +402,10 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) { if lvGrow == nil { return } - resonConfig, err := this.moduleHero.configure.GetHeroResonanceConfig(hero.HeroID) - if err != nil { - return - } - - // 计算玩家共鸣属性 - property := make(map[string]int32, 0) - for keyType, value := range hero.Energy { - if keyType == 1 { - property[comm.Hp] += int32(math.Floor((1.0 + float64(resonConfig.Hppro*value)/1000) * float64(hero.Property[comm.Hp]))) - } else if keyType == 2 { - property[comm.Atk] += int32(math.Floor((1.0 + float64(resonConfig.Atkpro*value)/1000) * float64(hero.Property[comm.Atk]))) - } else if keyType == 3 { - property[comm.Def] += int32(math.Floor((1.0 + float64(resonConfig.Defpro*value)/1000) * float64(hero.Property[comm.Def]))) - } - } curHp := hero.Property[comm.Hp] exprHp := fmt.Sprintf("%v + %v * %v/1000 + %v * %v/1000", - (curHp + lvGrow.Hp), heroLvCfg.Hp, lvGrow.Hpgrow, heroStarCfg.Hp, stargrowCfg) + (curHp + lvGrow.Hp), heroLvCfg.Hp, lvGrow.Hpgrow, heroStarCfg.Hp, stargrowCfg.StarupHp) hp, _ := mengine.ParseAndExec(exprHp) curAtk := hero.Property[comm.Atk] diff --git a/modules/notify/api_getlist.go b/modules/notify/api_getlist.go index 13e5dcf96..2de69e2c2 100644 --- a/modules/notify/api_getlist.go +++ b/modules/notify/api_getlist.go @@ -26,7 +26,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.NotifyGetListReq return } if session.GetUserId() != "" { - if userexpand, err = this.module.modelNotify.GetUserExpand(session.GetUserId()); err != nil { + if userexpand, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil { code = pb.ErrorCode_DBError return } @@ -34,7 +34,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.NotifyGetListReq userexpand = &pb.DBUserExpand{} } //修改最后公告读取时间 - this.module.modelNotify.ChanageUserExpand(session.GetUserId(), map[string]interface{}{ + this.module.ModuleUser.ChanageUserExpand(session.GetUserId(), map[string]interface{}{ "lastreadnotiftime": time.Now().Unix(), }) session.SendMsg(string(this.module.GetType()), "getlist", &pb.NotifyGetListResp{LastReadTime: userexpand.Lastreadnotiftime, SysNotify: notify}) diff --git a/modules/user/api_create.go b/modules/user/api_create.go index 006000127..8eeea05ab 100644 --- a/modules/user/api_create.go +++ b/modules/user/api_create.go @@ -62,7 +62,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c initUpdate := map[string]interface{}{ "modifynameCount": 1, //修改名称1次 } - if err := this.module.modelUser.ChanageUserExpand(session.GetUserId(), initUpdate); err != nil { + if err := this.module.modelExpand.ChanageUserExpand(session.GetUserId(), initUpdate); err != nil { code = pb.ErrorCode_DBError return } diff --git a/modules/user/api_figure.go b/modules/user/api_figure.go index 6eb72fc5a..4f21c8b56 100644 --- a/modules/user/api_figure.go +++ b/modules/user/api_figure.go @@ -23,7 +23,7 @@ func (this *apiComp) Figure(session comm.IUserSession, req *pb.UserFigureReq) (c return } - expand, err := this.module.modelUser.GetUserExpand(session.GetUserId()) + expand, err := this.module.modelExpand.GetUserExpand(session.GetUserId()) if err != nil { code = pb.ErrorCode_DBError return @@ -82,7 +82,7 @@ func (this *apiComp) Figure(session comm.IUserSession, req *pb.UserFigureReq) (c update = utils.StructToMap(curFigure) - this.module.modelUser.ChanageUserExpand(session.GetUserId(), update) + this.module.modelExpand.ChanageUserExpand(session.GetUserId(), update) } if err := session.SendMsg(string(this.module.GetType()), UserSubTypeFigure, rsp); err != nil { diff --git a/modules/user/api_gettujian.go b/modules/user/api_gettujian.go index 9e48d3bc6..58cc1ce7f 100644 --- a/modules/user/api_gettujian.go +++ b/modules/user/api_gettujian.go @@ -17,7 +17,7 @@ func (this *apiComp) GetTujian(session comm.IUserSession, req *pb.UserGetTujianR } rsp := &pb.UserGetTujianResp{} - if result, err := this.module.modelUser.GetUserExpand(session.GetUserId()); err != nil { + if result, err := this.module.modelExpand.GetUserExpand(session.GetUserId()); err != nil { this.module.Errorf("err:%v", err) return } else { diff --git a/modules/user/api_modifyname.go b/modules/user/api_modifyname.go index e7332fe5b..79b7bf133 100644 --- a/modules/user/api_modifyname.go +++ b/modules/user/api_modifyname.go @@ -28,7 +28,7 @@ func (this *apiComp) Modifyname(session comm.IUserSession, req *pb.UserModifynam return } - expand, err := this.module.modelUser.GetUserExpand(session.GetUserId()) + expand, err := this.module.modelExpand.GetUserExpand(session.GetUserId()) if err != nil { code = pb.ErrorCode_DBError return @@ -52,7 +52,7 @@ func (this *apiComp) Modifyname(session comm.IUserSession, req *pb.UserModifynam mc := map[string]interface{}{ "modifynameCount": expand.ModifynameCount - 1, } - if err := this.module.modelUser.ChanageUserExpand(session.GetUserId(), mc); err != nil { + if err := this.module.modelExpand.ChanageUserExpand(session.GetUserId(), mc); err != nil { code = pb.ErrorCode_DBError return } diff --git a/modules/user/model_expand.go b/modules/user/model_expand.go new file mode 100644 index 000000000..f6b9d586a --- /dev/null +++ b/modules/user/model_expand.go @@ -0,0 +1,49 @@ +package user + +import ( + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/modules" + "go_dreamfactory/pb" +) + +// 记录一些扩展数据 +type ModelExpand struct { + modules.MCompModel + moduleUser *User +} + +func (this *ModelExpand) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompModel.Init(service, module, comp, options) + this.TableName = "userexpand" + this.moduleUser = module.(*User) + return +} + +//获取用户 +func (this *ModelExpand) getUserSession(uid string) (cuser *pb.CacheUser) { + cuser = &pb.CacheUser{} + if err := this.Get(uid, cuser); err != nil { + log.Errorf("GetUserSession err:%v", err) + return + } + return +} + +//获取用户通过扩展表 +func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { + result = &pb.DBUserExpand{} + if err = this.moduleUser.modelExpand.Get(uid, result); err != nil { + return + } + return result, err +} + +//修改用户扩展数据 +func (this *ModelExpand) ChanageUserExpand(uid string, value map[string]interface{}) (err error) { + if len(value) == 0 { + return nil + } + return this.moduleUser.modelExpand.Change(uid, value) + +} diff --git a/modules/user/model_record.go b/modules/user/model_record.go index 19e136141..55cca24cb 100644 --- a/modules/user/model_record.go +++ b/modules/user/model_record.go @@ -7,7 +7,7 @@ import ( "go_dreamfactory/pb" ) -// 记录一些扩展数据 +// 记录一些扩展数据 图鉴 改名次数等 type ModelRecord struct { modules.MCompModel } diff --git a/modules/user/model_setting.go b/modules/user/model_setting.go index 4dcb7a05a..051129027 100644 --- a/modules/user/model_setting.go +++ b/modules/user/model_setting.go @@ -63,7 +63,7 @@ func (this *ModelSetting) UpdateSetting(uid string, data map[string]interface{}) //校验时间和初始次数 func (this *ModelSetting) checkInitCount(uid string) bool { - ue, err := this.moduleUser.modelSetting.GetUserExpand(uid) + ue, err := this.moduleUser.modelExpand.GetUserExpand(uid) if err != nil { return false } @@ -80,7 +80,7 @@ func (this *ModelSetting) checkInitCount(uid string) bool { } ue.InitdataCount++ } else { - + } } diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 31dacf38f..ae23c592a 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -152,7 +152,7 @@ func (this *ModelUser) InitFigure(uid string) { update := map[string]interface{}{ "preinstall": figureMap, } - this.ChanageUserExpand(uid, update) + this.moduleUser.modelExpand.ChanageUserExpand(uid, update) } // change exp diff --git a/modules/user/module.go b/modules/user/module.go index 6cc7559a3..78031ce79 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -21,6 +21,7 @@ type User struct { modelUser *ModelUser modelSession *ModelSession modelSetting *ModelSetting + modelExpand *ModelExpand configure *modules.MCompConfigure } @@ -46,6 +47,7 @@ func (this *User) OnInstallComp() { this.modelUser = this.RegisterComp(new(ModelUser)).(*ModelUser) this.modelSession = this.RegisterComp(new(ModelSession)).(*ModelSession) this.modelSetting = this.RegisterComp(new(ModelSetting)).(*ModelSetting) + this.modelExpand = this.RegisterComp(new(ModelExpand)).(*ModelExpand) } //获取用户数据 @@ -70,6 +72,7 @@ func (this *User) GetUserSession(uid string) *pb.CacheUser { func (this *User) CleanSession(session comm.IUserSession) { this.modelSession.Del(session.GetUserId(), modules.SetDBMgoLog(false)) this.modelUser.Del(session.GetUserId(), modules.SetDBMgoLog(false)) + //this.modelExpand.Del(session.GetUserId(), modules.SetDBMgoLog(false)) // 暂时不清 } //查询用户属性值 例如 金币 经验 @@ -170,9 +173,9 @@ func (this *User) EventUserChanged(session comm.IUserSession) { } func (this *User) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { - return this.modelUser.GetUserExpand(uid) + return this.modelExpand.GetUserExpand(uid) } func (this *User) ChanageUserExpand(uid string, value map[string]interface{}) error { - return this.modelUser.ChanageUserExpand(uid, value) + return this.modelExpand.ChanageUserExpand(uid, value) }