diff --git a/bin/json/game_kungfu_masterworker.json b/bin/json/game_kungfu_masterworker.json new file mode 100644 index 000000000..a81325512 --- /dev/null +++ b/bin/json/game_kungfu_masterworker.json @@ -0,0 +1,1298 @@ +[ + { + "level": 1, + "star": 1, + "quality": 1, + "quality_text": { + "key": "gourmet_ln1", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln1", + "text": "鹤大师" + }, + "exp": 60, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln1", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ] + }, + { + "level": 2, + "star": 2, + "quality": 1, + "quality_text": { + "key": "gourmet_ln2", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln2", + "text": "悍娇虎" + }, + "exp": 120, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln2", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 2 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 2 + } + ] + }, + { + "level": 3, + "star": 3, + "quality": 1, + "quality_text": { + "key": "gourmet_ln3", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln3", + "text": "浣熊" + }, + "exp": 240, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln3", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 3 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 3 + } + ] + }, + { + "level": 4, + "star": 4, + "quality": 1, + "quality_text": { + "key": "gourmet_ln4", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln4", + "text": "乌龟大师" + }, + "exp": 480, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln4", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 4 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 4 + } + ] + }, + { + "level": 5, + "star": 5, + "quality": 1, + "quality_text": { + "key": "gourmet_ln5", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln5", + "text": "鹤大师" + }, + "exp": 1020, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln5", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 5 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 5 + } + ] + }, + { + "level": 6, + "star": 6, + "quality": 1, + "quality_text": { + "key": "gourmet_ln6", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln6", + "text": "悍娇虎" + }, + "exp": 1080, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln6", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 6 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 6 + } + ] + }, + { + "level": 7, + "star": 7, + "quality": 1, + "quality_text": { + "key": "gourmet_ln7", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln7", + "text": "浣熊" + }, + "exp": 1200, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln7", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 7 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 7 + } + ] + }, + { + "level": 8, + "star": 8, + "quality": 1, + "quality_text": { + "key": "gourmet_ln8", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln8", + "text": "乌龟大师" + }, + "exp": 1440, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln8", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 8 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 8 + } + ] + }, + { + "level": 9, + "star": 9, + "quality": 1, + "quality_text": { + "key": "gourmet_ln9", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln9", + "text": "鹤大师" + }, + "exp": 1980, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln9", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 9 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 9 + } + ] + }, + { + "level": 10, + "star": 10, + "quality": 1, + "quality_text": { + "key": "gourmet_ln10", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln10", + "text": "悍娇虎" + }, + "exp": 2040, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln10", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 10 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 10 + } + ] + }, + { + "level": 11, + "star": 11, + "quality": 1, + "quality_text": { + "key": "gourmet_ln11", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln11", + "text": "浣熊" + }, + "exp": 2160, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln11", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 11 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 11 + } + ] + }, + { + "level": 12, + "star": 12, + "quality": 1, + "quality_text": { + "key": "gourmet_ln12", + "text": "优秀" + }, + "color": "", + "levelname": { + "key": "gourmet_ln12", + "text": "乌龟大师" + }, + "exp": 2400, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln12", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 12 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 12 + } + ] + }, + { + "level": 13, + "star": 1, + "quality": 2, + "quality_text": { + "key": "gourmet_ln13", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln13", + "text": "鹤大师" + }, + "exp": 2940, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln13", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 13 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 13 + } + ] + }, + { + "level": 14, + "star": 2, + "quality": 2, + "quality_text": { + "key": "gourmet_ln14", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln14", + "text": "悍娇虎" + }, + "exp": 3000, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln14", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 14 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 14 + } + ] + }, + { + "level": 15, + "star": 3, + "quality": 2, + "quality_text": { + "key": "gourmet_ln15", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln15", + "text": "浣熊" + }, + "exp": 3120, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln15", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 15 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 15 + } + ] + }, + { + "level": 16, + "star": 4, + "quality": 2, + "quality_text": { + "key": "gourmet_ln16", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln16", + "text": "乌龟大师" + }, + "exp": 3360, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln16", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 16 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 16 + } + ] + }, + { + "level": 17, + "star": 5, + "quality": 2, + "quality_text": { + "key": "gourmet_ln17", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln17", + "text": "鹤大师" + }, + "exp": 3900, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln17", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 17 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 17 + } + ] + }, + { + "level": 18, + "star": 6, + "quality": 2, + "quality_text": { + "key": "gourmet_ln18", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln18", + "text": "悍娇虎" + }, + "exp": 3960, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln18", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 18 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 18 + } + ] + }, + { + "level": 19, + "star": 7, + "quality": 2, + "quality_text": { + "key": "gourmet_ln19", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln19", + "text": "浣熊" + }, + "exp": 4080, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln19", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 19 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 19 + } + ] + }, + { + "level": 20, + "star": 8, + "quality": 2, + "quality_text": { + "key": "gourmet_ln20", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln20", + "text": "乌龟大师" + }, + "exp": 4320, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln20", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 20 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 20 + } + ] + }, + { + "level": 21, + "star": 9, + "quality": 2, + "quality_text": { + "key": "gourmet_ln21", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln21", + "text": "鹤大师" + }, + "exp": 4860, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln21", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 21 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 21 + } + ] + }, + { + "level": 22, + "star": 10, + "quality": 2, + "quality_text": { + "key": "gourmet_ln22", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln22", + "text": "悍娇虎" + }, + "exp": 4920, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln22", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 22 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 22 + } + ] + }, + { + "level": 23, + "star": 11, + "quality": 2, + "quality_text": { + "key": "gourmet_ln23", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln23", + "text": "浣熊" + }, + "exp": 5040, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln23", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 23 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 23 + } + ] + }, + { + "level": 24, + "star": 12, + "quality": 2, + "quality_text": { + "key": "gourmet_ln24", + "text": "精英" + }, + "color": "", + "levelname": { + "key": "gourmet_ln24", + "text": "乌龟大师" + }, + "exp": 5280, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln24", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 24 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 24 + } + ] + }, + { + "level": 25, + "star": 1, + "quality": 3, + "quality_text": { + "key": "gourmet_ln25", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln25", + "text": "鹤大师" + }, + "exp": 5820, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln25", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 25 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 25 + } + ] + }, + { + "level": 26, + "star": 2, + "quality": 3, + "quality_text": { + "key": "gourmet_ln26", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln26", + "text": "悍娇虎" + }, + "exp": 5880, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln26", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 26 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 26 + } + ] + }, + { + "level": 27, + "star": 3, + "quality": 3, + "quality_text": { + "key": "gourmet_ln27", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln27", + "text": "浣熊" + }, + "exp": 6000, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln27", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 27 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 27 + } + ] + }, + { + "level": 28, + "star": 4, + "quality": 3, + "quality_text": { + "key": "gourmet_ln28", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln28", + "text": "乌龟大师" + }, + "exp": 6240, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln28", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 28 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 28 + } + ] + }, + { + "level": 29, + "star": 5, + "quality": 3, + "quality_text": { + "key": "gourmet_ln29", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln29", + "text": "鹤大师" + }, + "exp": 6780, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln29", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 29 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 29 + } + ] + }, + { + "level": 30, + "star": 6, + "quality": 3, + "quality_text": { + "key": "gourmet_ln30", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln30", + "text": "悍娇虎" + }, + "exp": 6840, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln30", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 30 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 30 + } + ] + }, + { + "level": 31, + "star": 7, + "quality": 3, + "quality_text": { + "key": "gourmet_ln31", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln31", + "text": "浣熊" + }, + "exp": 6960, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln31", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 31 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 31 + } + ] + }, + { + "level": 32, + "star": 8, + "quality": 3, + "quality_text": { + "key": "gourmet_ln32", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln32", + "text": "乌龟大师" + }, + "exp": 7200, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln32", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 32 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 32 + } + ] + }, + { + "level": 33, + "star": 9, + "quality": 3, + "quality_text": { + "key": "gourmet_ln33", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln33", + "text": "鹤大师" + }, + "exp": 7740, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln33", + "text": "教习效率+50%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 33 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 33 + } + ] + }, + { + "level": 34, + "star": 10, + "quality": 3, + "quality_text": { + "key": "gourmet_ln34", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln34", + "text": "悍娇虎" + }, + "exp": 7800, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln34", + "text": "教习效率+51%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 34 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 34 + } + ] + }, + { + "level": 35, + "star": 11, + "quality": 3, + "quality_text": { + "key": "gourmet_ln35", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln35", + "text": "浣熊" + }, + "exp": 7920, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln35", + "text": "教习效率+52%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 35 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 35 + } + ] + }, + { + "level": 36, + "star": 12, + "quality": 3, + "quality_text": { + "key": "gourmet_ln36", + "text": "大师" + }, + "color": "", + "levelname": { + "key": "gourmet_ln36", + "text": "乌龟大师" + }, + "exp": 8160, + "model": 35001, + "ornament": "", + "affix": { + "key": "gourmet_ln36", + "text": "教习效率+53%" + }, + "needtime": 500, + "level_deplete": [ + { + "a": "item", + "t": "10002", + "n": 36 + } + ], + "deplete": [ + { + "a": "item", + "t": "10002", + "n": 36 + } + ] + } +] \ No newline at end of file diff --git a/bin/json/game_kungfu_unlock.json b/bin/json/game_kungfu_unlock.json new file mode 100644 index 000000000..effd6453a --- /dev/null +++ b/bin/json/game_kungfu_unlock.json @@ -0,0 +1,62 @@ +[ + { + "id": 1, + "type": 1001, + "area": 1, + "consume": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ] + }, + { + "id": 2, + "type": 1001, + "area": 2, + "consume": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ] + }, + { + "id": 3, + "type": 1001, + "area": 3, + "consume": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ] + }, + { + "id": 4, + "type": 1001, + "area": 4, + "consume": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ] + }, + { + "id": 5, + "type": 1002, + "area": 5, + "consume": [ + { + "a": "item", + "t": "10002", + "n": 1 + } + ] + } +] \ No newline at end of file diff --git a/modules/martialhall/api.go b/modules/martialhall/api.go index b1e582e6f..dce4464ff 100644 --- a/modules/martialhall/api.go +++ b/modules/martialhall/api.go @@ -12,13 +12,13 @@ API type apiComp struct { modules.MCompGate service core.IService - module *Chat + module *Martialhall } //组件初始化接口 func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.MCompGate.Init(service, module, comp, options) - this.module = module.(*Chat) + this.module = module.(*Martialhall) this.service = service return } diff --git a/modules/martialhall/api_info.go b/modules/martialhall/api_info.go new file mode 100644 index 000000000..25a4a8609 --- /dev/null +++ b/modules/martialhall/api_info.go @@ -0,0 +1,40 @@ +package martialhall + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.MartialhallInfoReq) (code pb.ErrorCode) { + + return +} + +///练功请求 +func (this *apiComp) Info(session comm.IUserSession, req *pb.MartialhallInfoReq) (code pb.ErrorCode, data proto.Message) { + var ( + err error + mart *pb.DBMartialhall + mdata *cfg.Gamekungfu_masterworkerData + ) + if mart, err = this.module.modelMartialhall.queryUserMartialhall(session.GetUserId()); err != nil { + code = pb.ErrorCode_DBError + return + } + if mdata, err = this.module.configure.getMasterworker(mart.Lv); err != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + check(mart.Pillar1, mdata) + check(mart.Pillar2, mdata) + check(mart.Pillar3, mdata) + check(mart.Pillar4, mdata) + check(mart.Pillar5, mdata) + this.module.modelMartialhall.Add(session.GetUserId(), mart) + session.SendMsg(string(this.module.GetType()), "info", &pb.MartialhallInfoResp{Info: mart}) + return +} diff --git a/modules/martialhall/api_practice.go b/modules/martialhall/api_practice.go index c494cb932..cd6dda87a 100644 --- a/modules/martialhall/api_practice.go +++ b/modules/martialhall/api_practice.go @@ -3,6 +3,8 @@ package martialhall import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "time" "google.golang.org/protobuf/proto" ) @@ -15,6 +17,67 @@ func (this *apiComp) PracticeCheck(session comm.IUserSession, req *pb.Martialhal ///练功请求 func (this *apiComp) Practice(session comm.IUserSession, req *pb.MartialhallPracticeReq) (code pb.ErrorCode, data proto.Message) { + var ( + err error + mart *pb.DBMartialhall + pillar *pb.DBPillar + mdata *cfg.Gamekungfu_masterworkerData + filed string + ) + if mart, err = this.module.modelMartialhall.queryUserMartialhall(session.GetUserId()); err != nil { + code = pb.ErrorCode_DBError + } + if mdata, err = this.module.configure.getMasterworker(mart.Lv); err != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + switch req.Pillar { + case 1: + pillar = mart.Pillar1 + filed = "pillar1" + break + case 2: + pillar = mart.Pillar2 + filed = "pillar2" + break + case 3: + pillar = mart.Pillar3 + filed = "pillar3" + break + case 4: + pillar = mart.Pillar4 + filed = "pillar4" + break + case 5: + pillar = mart.Pillar5 + filed = "pillar5" + break + } + if pillar == nil || !pillar.Isunlock { + code = pb.ErrorCode_MartialhallNotUnlocked + return + } + if pillar.State != pb.PillarState_NoUse { + code = pb.ErrorCode_MartialhallInUse + return + } + //此处校验hero信息 + //... + + //... + + if code = this.module.ConsumeRes(session, mdata.Deplete, true); code != pb.ErrorCode_Success { + return + } + pillar.State = pb.PillarState_Useing + pillar.Hero = req.Hero + pillar.Start = time.Now().Unix() + pillar.Lastbill = time.Now().Unix() + pillar.Reward = 0 + this.module.modelMartialhall.Change(session.GetUserId(), map[string]interface{}{ + filed: pillar, + }) + session.SendMsg(string(this.module.GetType()), "rractice", &pb.MartialhallPracticeResp{Pillar: req.Pillar, Hero: req.Hero, Issucc: true}) return } diff --git a/modules/martialhall/api_receive.go b/modules/martialhall/api_receive.go new file mode 100644 index 000000000..aa46e8c79 --- /dev/null +++ b/modules/martialhall/api_receive.go @@ -0,0 +1,75 @@ +package martialhall + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.MartialhallReceiveReq) (code pb.ErrorCode) { + + return +} + +///练功请求 +func (this *apiComp) Receive(session comm.IUserSession, req *pb.MartialhallReceiveReq) (code pb.ErrorCode, data proto.Message) { + var ( + err error + mart *pb.DBMartialhall + pillar *pb.DBPillar + mdata *cfg.Gamekungfu_masterworkerData + filed string + ) + if mart, err = this.module.modelMartialhall.queryUserMartialhall(session.GetUserId()); err != nil { + code = pb.ErrorCode_DBError + return + } + if mdata, err = this.module.configure.getMasterworker(mart.Lv); err != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + switch req.Pillar { + case 1: + pillar = mart.Pillar1 + filed = "pillar1" + break + case 2: + pillar = mart.Pillar2 + filed = "pillar2" + break + case 3: + pillar = mart.Pillar3 + filed = "pillar3" + break + case 4: + pillar = mart.Pillar4 + filed = "pillar4" + break + case 5: + pillar = mart.Pillar5 + filed = "pillar5" + break + } + if pillar == nil || !pillar.Isunlock { + code = pb.ErrorCode_MartialhallNotUnlocked + return + } + check(pillar, mdata) + if pillar.State != pb.PillarState_Receive { + code = pb.ErrorCode_MartialhallInUse + return + } + //此处发放英雄经验增长 + //... + + //... + + this.module.modelMartialhall.Change(session.GetUserId(), map[string]interface{}{ + filed: pillar, + }) + session.SendMsg(string(this.module.GetType()), "info", &pb.MartialhallReceiveResp{}) + return +} diff --git a/modules/martialhall/api_upgrade.go b/modules/martialhall/api_upgrade.go new file mode 100644 index 000000000..d3671d940 --- /dev/null +++ b/modules/martialhall/api_upgrade.go @@ -0,0 +1,44 @@ +package martialhall + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) UpgradeCheck(session comm.IUserSession, req *pb.MartialhallUpgradeReq) (code pb.ErrorCode) { + + return +} + +///练功请求 +func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.MartialhallUpgradeReq) (code pb.ErrorCode, data proto.Message) { + var ( + err error + mart *pb.DBMartialhall + mdata *cfg.Gamekungfu_masterworkerData + ) + if mart, err = this.module.modelMartialhall.queryUserMartialhall(session.GetUserId()); err != nil { + code = pb.ErrorCode_DBError + return + } + if mdata, err = this.module.configure.getMasterworker(mart.Lv); err != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + if code = this.module.ConsumeRes(session, mdata.LevelDeplete, true); code != pb.ErrorCode_Success { + return + } + mart.Lv++ + settlement(mart.Pillar1, mdata) + settlement(mart.Pillar2, mdata) + settlement(mart.Pillar3, mdata) + settlement(mart.Pillar4, mdata) + settlement(mart.Pillar5, mdata) + this.module.modelMartialhall.Add(session.GetUserId(), mart) + session.SendMsg(string(this.module.GetType()), "upgrade", &pb.MartialhallUpgradeResp{Info: mart}) + return +} diff --git a/modules/martialhall/configure.go b/modules/martialhall/configure.go index 4d398e554..306e65cdf 100644 --- a/modules/martialhall/configure.go +++ b/modules/martialhall/configure.go @@ -1,23 +1,46 @@ package martialhall import ( + "fmt" "go_dreamfactory/modules" + cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/lego/core" ) const ( - game_equipment = "game_equipment.json" + game_kungfu_unlock = "game_kungfu_unlock.json" + game_kungfu_masterworker = "game_kungfu_masterworker.json" ) ///配置组件 type configureComp struct { modules.MCompConfigure + module *Martialhall } //组件初始化接口 func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.MCompConfigure.Init(service, module, comp, options) - + this.LoadConfigure(game_kungfu_unlock, cfg.NewGamekungfu_unlock) + this.LoadConfigure(game_kungfu_masterworker, cfg.NewGamekungfu_masterworker) + return +} + +func (this *configureComp) getMasterworker(lv int32) (result *cfg.Gamekungfu_masterworkerData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(game_kungfu_masterworker); err != nil { + this.module.Errorln(err) + return + } else { + if result, ok = v.(*cfg.Gamekungfu_masterworker).GetDataMap()[lv]; !ok { + err = fmt.Errorf("not found:%s ", lv) + this.module.Errorln(err) + return + } + } return } diff --git a/modules/martialhall/core.go b/modules/martialhall/core.go new file mode 100644 index 000000000..e48aa07b0 --- /dev/null +++ b/modules/martialhall/core.go @@ -0,0 +1,32 @@ +package martialhall + +import ( + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "time" +) + +//结算 +func settlement(pillar *pb.DBPillar, mdata *cfg.Gamekungfu_masterworkerData) { + if pillar == nil || pillar.State != pb.PillarState_Useing { + return + } + pillar.Reward += int32(time.Unix(pillar.End, 0).Sub(time.Unix(pillar.Lastbill, 0)).Minutes() * float64(mdata.Exp)) + pillar.Lastbill = time.Now().Unix() + if time.Now().After(time.Unix(pillar.End, 0)) { + pillar.State = pb.PillarState_Receive + } +} + +//结算 +func check(pillar *pb.DBPillar, mdata *cfg.Gamekungfu_masterworkerData) { + if pillar == nil || pillar.State != pb.PillarState_Useing { + return + } + //达到修炼时间 + if time.Now().After(time.Unix(pillar.End, 0)) { + pillar.Reward += int32(time.Unix(pillar.End, 0).Sub(time.Unix(pillar.Lastbill, 0)).Minutes() * float64(mdata.Exp)) + pillar.Lastbill = time.Now().Unix() + pillar.State = pb.PillarState_Receive + } +} diff --git a/modules/martialhall/modelMartialhall.go b/modules/martialhall/modelMartialhall.go index ca1aea5e3..59c56a340 100644 --- a/modules/martialhall/modelMartialhall.go +++ b/modules/martialhall/modelMartialhall.go @@ -3,6 +3,7 @@ package martialhall import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/mgo" "go_dreamfactory/modules" "go_dreamfactory/pb" @@ -13,12 +14,14 @@ import ( ///论坛 数据组件 type modelMartialhall struct { modules.MCompModel + module *Martialhall } //组件初始化接口 func (this *modelMartialhall) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) { this.TableName = comm.TableMartialhall this.MCompModel.Init(service, module, comp, opt) + this.module = module.(*Martialhall) //创建uid索引 this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, @@ -27,7 +30,11 @@ func (this *modelMartialhall) Init(service core.IService, module core.IModule, c } ///询用户的练功房信息 -func (this *modelMartialhall) queryUserMartialhall(uid string) (result *pb.DBMartialhall) { - +func (this *modelMartialhall) queryUserMartialhall(uid string) (result *pb.DBMartialhall, err error) { + result = &pb.DBMartialhall{} + if err = this.Get(uid, result); err != nil && err != mgo.MongodbNil { + this.module.Errorln(err) + } + err = nil return } diff --git a/modules/martialhall/module.go b/modules/martialhall/module.go index 374ad177c..15481148c 100644 --- a/modules/martialhall/module.go +++ b/modules/martialhall/module.go @@ -13,37 +13,39 @@ import ( 开发:李伟 */ func NewModule() core.IModule { - m := new(Chat) + m := new(Martialhall) return m } -type Chat struct { +type Martialhall struct { modules.ModuleBase - service base.IRPCXService //rpc服务对象 通过这个对象可以发布服务和调用其他服务的接口 - api_comp *apiComp - configure *configureComp + service base.IRPCXService //rpc服务对象 通过这个对象可以发布服务和调用其他服务的接口 + api_comp *apiComp + configure *configureComp + modelMartialhall *modelMartialhall } //模块名 -func (this *Chat) GetType() core.M_Modules { +func (this *Martialhall) GetType() core.M_Modules { return comm.ModuleChat } //模块初始化接口 注册用户创建角色事件 -func (this *Chat) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { +func (this *Martialhall) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.service = service.(base.IRPCXService) return } -func (this *Chat) Start() (err error) { +func (this *Martialhall) Start() (err error) { err = this.ModuleBase.Start() return } //装备组件 -func (this *Chat) OnInstallComp() { +func (this *Martialhall) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) + this.modelMartialhall = this.RegisterComp(new(modelMartialhall)).(*modelMartialhall) } diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 3854e5c90..128bca228 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -138,120 +138,127 @@ const ( // mail ErrorCode_MailErr ErrorCode = 1800 // 邮件不存在 // pagoda - ErrorCode_PagodaNotFound ErrorCode = 1900 // 找不到塔数据 - ErrorCode_PagodaLevlErr ErrorCode = 19001 // 挑战关卡数据不匹配 + ErrorCode_PagodaNotFound ErrorCode = 1900 // 找不到塔数据 + ErrorCode_PagodaLevlErr ErrorCode = 1901 // 挑战关卡数据不匹配 + //martialhall + ErrorCode_MartialhallNotUnlocked ErrorCode = 2000 //木桩未解锁 + ErrorCode_MartialhallInUse ErrorCode = 2001 //有使用 + ErrorCode_MartialhallNoReceive ErrorCode = 2002 //未达到领取状态 ) // Enum value maps for ErrorCode. var ( ErrorCode_name = map[int32]string{ - 0: "Success", - 10: "NoFindService", - 11: "NoFindServiceHandleFunc", - 12: "RpcFuncExecutionError", - 13: "CacheReadError", - 14: "SqlExecutionError", - 15: "ReqParameterError", - 16: "SignError", - 17: "InsufficientPermissions", - 18: "NoLogin", - 19: "UserSessionNobeing", - 20: "StateInvalid", - 21: "DBError", - 22: "SystemError", - 23: "DecodeError", - 24: "TimestampTimeout", - 25: "PbError", - 26: "AgentUidEmpty", - 100: "Exception", - 101: "Unknown", - 102: "ResNoEnough", - 103: "ConfigurationException", - 104: "ConfigNoFound", - 1000: "SecKeyInvalid", - 1001: "SecKey", - 1002: "BindUser", - 1003: "GoldNoEnough", - 1004: "DiamondNoEnough", - 1005: "RoleCreated", - 1006: "UserNickNameExist", - 1007: "VeriCodeNoValid", - 1008: "VeriCodeExpired", - 1009: "UserResetData", - 1010: "UserModiNameCount", - 1011: "UserNickNameEmpty", - 1012: "UserExpandNull", - 1100: "FriendNotSelf", - 1101: "FriendSelfMax", - 1102: "FriendTargetMax", - 1103: "FriendSelfNoData", - 1104: "FriendTargetNoData", - 1105: "FriendYet", - 1106: "FriendApplyYet", - 1107: "FriendSelfBlackYet", - 1108: "FriendTargetBlackYet", - 1109: "FriendApplyError", - 1110: "FriendBlackMax", - 1111: "FriendSearchNameEmpty", - 1112: "FriendZaned", - 1113: "FriendZanreceived", - 1114: "FriendZanSelf", - 1115: "FriendPointLimit", - 1200: "ItemsNoEnough", - 1201: "ItemsNoFoundGird", - 1202: "ItemsGridNumUpper", - 1203: "ItemsGirdAmountUpper", - 1204: "ItemsUseNotSupported", - 1300: "HeroNoExist", - 1301: "HeroNoEnough", - 1302: "HeroMaxLv", - 1303: "HeroInitCreat", - 1304: "HeroColorErr", - 1305: "HeroSkillUpErr", - 1306: "HeroMaxResonate", - 1307: "HeroNoResonate", - 1308: "HeroNotNeedResonate", - 1309: "HeroNoEnergy", - 1310: "HeroCreate", - 1311: "HeroEquipUpdate", - 1312: "HeroMaxAwaken", - 1313: "HeroIsLock", - 1314: "HeroMaxCount", - 1315: "HeroCostTypeErr", - 1316: "HeroStarErr", - 1317: "HeroTypeErr", - 1318: "HeroExpTypeErr", - 1319: "HeroAddMaxExp", - 1320: "HeroStarLvErr", - 1321: "HeroMaxStarLv", - 1322: "DrawCardTypeNotFound", - 1323: "HeroMaxSkillLv", - 1400: "EquipmentOnFoundEquipment", - 1401: "EquipmentLvlimitReached", - 1402: "EquipmentIsWorn", - 1500: "MainlineNotFindChapter", - 1501: "MainlineIDFailed", - 1502: "MainlineNotFound", - 1503: "MainlinePreNotFound", - 1504: "MainlineRepeatReward", - 1505: "MainlineCompleteReward", - 1600: "TaskInit", - 1601: "TaskReset", - 1602: "TaskHandle", - 1603: "TaskReceived", - 1604: "TaskActiveInit", - 1605: "TaskActiveNofound", - 1606: "TaskActiveNoenough", - 1607: "TaskNoFinished", - 1608: "TaskFinished", - 1609: "TaskTagEmpty", - 1610: "TaskIdEmpty", - 1611: "TaskNotFound", - 1700: "ShopGoodsIsSoldOut", - 1701: "ShopNoSurplusRefreshNum", - 1800: "MailErr", - 1900: "PagodaNotFound", - 19001: "PagodaLevlErr", + 0: "Success", + 10: "NoFindService", + 11: "NoFindServiceHandleFunc", + 12: "RpcFuncExecutionError", + 13: "CacheReadError", + 14: "SqlExecutionError", + 15: "ReqParameterError", + 16: "SignError", + 17: "InsufficientPermissions", + 18: "NoLogin", + 19: "UserSessionNobeing", + 20: "StateInvalid", + 21: "DBError", + 22: "SystemError", + 23: "DecodeError", + 24: "TimestampTimeout", + 25: "PbError", + 26: "AgentUidEmpty", + 100: "Exception", + 101: "Unknown", + 102: "ResNoEnough", + 103: "ConfigurationException", + 104: "ConfigNoFound", + 1000: "SecKeyInvalid", + 1001: "SecKey", + 1002: "BindUser", + 1003: "GoldNoEnough", + 1004: "DiamondNoEnough", + 1005: "RoleCreated", + 1006: "UserNickNameExist", + 1007: "VeriCodeNoValid", + 1008: "VeriCodeExpired", + 1009: "UserResetData", + 1010: "UserModiNameCount", + 1011: "UserNickNameEmpty", + 1012: "UserExpandNull", + 1100: "FriendNotSelf", + 1101: "FriendSelfMax", + 1102: "FriendTargetMax", + 1103: "FriendSelfNoData", + 1104: "FriendTargetNoData", + 1105: "FriendYet", + 1106: "FriendApplyYet", + 1107: "FriendSelfBlackYet", + 1108: "FriendTargetBlackYet", + 1109: "FriendApplyError", + 1110: "FriendBlackMax", + 1111: "FriendSearchNameEmpty", + 1112: "FriendZaned", + 1113: "FriendZanreceived", + 1114: "FriendZanSelf", + 1115: "FriendPointLimit", + 1200: "ItemsNoEnough", + 1201: "ItemsNoFoundGird", + 1202: "ItemsGridNumUpper", + 1203: "ItemsGirdAmountUpper", + 1204: "ItemsUseNotSupported", + 1300: "HeroNoExist", + 1301: "HeroNoEnough", + 1302: "HeroMaxLv", + 1303: "HeroInitCreat", + 1304: "HeroColorErr", + 1305: "HeroSkillUpErr", + 1306: "HeroMaxResonate", + 1307: "HeroNoResonate", + 1308: "HeroNotNeedResonate", + 1309: "HeroNoEnergy", + 1310: "HeroCreate", + 1311: "HeroEquipUpdate", + 1312: "HeroMaxAwaken", + 1313: "HeroIsLock", + 1314: "HeroMaxCount", + 1315: "HeroCostTypeErr", + 1316: "HeroStarErr", + 1317: "HeroTypeErr", + 1318: "HeroExpTypeErr", + 1319: "HeroAddMaxExp", + 1320: "HeroStarLvErr", + 1321: "HeroMaxStarLv", + 1322: "DrawCardTypeNotFound", + 1323: "HeroMaxSkillLv", + 1400: "EquipmentOnFoundEquipment", + 1401: "EquipmentLvlimitReached", + 1402: "EquipmentIsWorn", + 1500: "MainlineNotFindChapter", + 1501: "MainlineIDFailed", + 1502: "MainlineNotFound", + 1503: "MainlinePreNotFound", + 1504: "MainlineRepeatReward", + 1505: "MainlineCompleteReward", + 1600: "TaskInit", + 1601: "TaskReset", + 1602: "TaskHandle", + 1603: "TaskReceived", + 1604: "TaskActiveInit", + 1605: "TaskActiveNofound", + 1606: "TaskActiveNoenough", + 1607: "TaskNoFinished", + 1608: "TaskFinished", + 1609: "TaskTagEmpty", + 1610: "TaskIdEmpty", + 1611: "TaskNotFound", + 1700: "ShopGoodsIsSoldOut", + 1701: "ShopNoSurplusRefreshNum", + 1800: "MailErr", + 1900: "PagodaNotFound", + 1901: "PagodaLevlErr", + 2000: "MartialhallNotUnlocked", + 2001: "MartialhallInUse", + 2002: "MartialhallNoReceive", } ErrorCode_value = map[string]int32{ "Success": 0, @@ -360,7 +367,10 @@ var ( "ShopNoSurplusRefreshNum": 1701, "MailErr": 1800, "PagodaNotFound": 1900, - "PagodaLevlErr": 19001, + "PagodaLevlErr": 1901, + "MartialhallNotUnlocked": 2000, + "MartialhallInUse": 2001, + "MartialhallNoReceive": 2002, } ) @@ -395,7 +405,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, 0xda, 0x11, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xa8, 0x12, 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, @@ -535,9 +545,14 @@ var file_errorcode_proto_rawDesc = []byte{ 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, 0x12, 0x13, 0x0a, 0x0e, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4e, 0x6f, - 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xec, 0x0e, 0x12, 0x13, 0x0a, 0x0d, 0x50, 0x61, 0x67, - 0x6f, 0x64, 0x61, 0x4c, 0x65, 0x76, 0x6c, 0x45, 0x72, 0x72, 0x10, 0xb9, 0x94, 0x01, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xec, 0x0e, 0x12, 0x12, 0x0a, 0x0d, 0x50, 0x61, 0x67, + 0x6f, 0x64, 0x61, 0x4c, 0x65, 0x76, 0x6c, 0x45, 0x72, 0x72, 0x10, 0xed, 0x0e, 0x12, 0x1b, 0x0a, + 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x4e, 0x6f, 0x74, 0x55, + 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xd0, 0x0f, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x55, 0x73, 0x65, 0x10, 0xd1, + 0x0f, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, + 0x4e, 0x6f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0xd2, 0x0f, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/martialhall_db.pb.go b/pb/martialhall_db.pb.go index 4be91c188..e9962fed4 100644 --- a/pb/martialhall_db.pb.go +++ b/pb/martialhall_db.pb.go @@ -20,15 +20,68 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type PillarState int32 + +const ( + PillarState_NoUse PillarState = 0 //未使用 + PillarState_Useing PillarState = 1 //使用中 + PillarState_Receive PillarState = 2 //待领取 +) + +// Enum value maps for PillarState. +var ( + PillarState_name = map[int32]string{ + 0: "NoUse", + 1: "Useing", + 2: "Receive", + } + PillarState_value = map[string]int32{ + "NoUse": 0, + "Useing": 1, + "Receive": 2, + } +) + +func (x PillarState) Enum() *PillarState { + p := new(PillarState) + *p = x + return p +} + +func (x PillarState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PillarState) Descriptor() protoreflect.EnumDescriptor { + return file_martialhall_martialhall_db_proto_enumTypes[0].Descriptor() +} + +func (PillarState) Type() protoreflect.EnumType { + return &file_martialhall_martialhall_db_proto_enumTypes[0] +} + +func (x PillarState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PillarState.Descriptor instead. +func (PillarState) EnumDescriptor() ([]byte, []int) { + return file_martialhall_martialhall_db_proto_rawDescGZIP(), []int{0} +} + ///练功柱子 type DBPillar struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Isunlock bool `protobuf:"varint,1,opt,name=isunlock,proto3" json:"isunlock"` //是否解锁 - Currhero string `protobuf:"bytes,2,opt,name=currhero,proto3" json:"currhero"` //当前练功英雄 - Reward []*UserAssets `protobuf:"bytes,3,rep,name=reward,proto3" json:"reward"` //奖励 + Isunlock bool `protobuf:"varint,1,opt,name=isunlock,proto3" json:"isunlock"` //是否解锁 + State PillarState `protobuf:"varint,2,opt,name=state,proto3,enum=PillarState" json:"state"` //状态 + Hero string `protobuf:"bytes,3,opt,name=hero,proto3" json:"hero"` //当前练功英雄 + Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start"` //开始时间 + End int64 `protobuf:"varint,5,opt,name=end,proto3" json:"end"` //结束时间 + Lastbill int64 `protobuf:"varint,6,opt,name=lastbill,proto3" json:"lastbill"` //上次结账时间 + Reward int32 `protobuf:"varint,7,opt,name=reward,proto3" json:"reward"` //奖励 } func (x *DBPillar) Reset() { @@ -70,18 +123,46 @@ func (x *DBPillar) GetIsunlock() bool { return false } -func (x *DBPillar) GetCurrhero() string { +func (x *DBPillar) GetState() PillarState { if x != nil { - return x.Currhero + return x.State + } + return PillarState_NoUse +} + +func (x *DBPillar) GetHero() string { + if x != nil { + return x.Hero } return "" } -func (x *DBPillar) GetReward() []*UserAssets { +func (x *DBPillar) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DBPillar) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *DBPillar) GetLastbill() int64 { + if x != nil { + return x.Lastbill + } + return 0 +} + +func (x *DBPillar) GetReward() int32 { if x != nil { return x.Reward } - return nil + return 0 } //练功房 @@ -193,31 +274,38 @@ var File_martialhall_martialhall_db_proto protoreflect.FileDescriptor var file_martialhall_martialhall_db_proto_rawDesc = []byte{ 0x0a, 0x20, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x2f, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x67, - 0x0a, 0x08, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, - 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, - 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x68, 0x65, - 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x68, 0x65, - 0x72, 0x6f, 0x12, 0x23, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, - 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, 0xfa, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x61, - 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, - 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x23, 0x0a, 0x07, 0x70, - 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, - 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x31, - 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, - 0x6c, 0x6c, 0x61, 0x72, 0x32, 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x33, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, - 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x33, 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, - 0x6c, 0x6c, 0x61, 0x72, 0x34, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, - 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x34, 0x12, - 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x35, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, - 0x6c, 0x61, 0x72, 0x35, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x22, 0xba, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x69, 0x73, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x22, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x50, 0x69, 0x6c, + 0x6c, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, + 0x65, 0x72, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, + 0x61, 0x73, 0x74, 0x62, 0x69, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, + 0x61, 0x73, 0x74, 0x62, 0x69, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, + 0xfa, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, + 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x6c, 0x76, 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x31, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, + 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x31, 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, + 0x61, 0x72, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, + 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x32, 0x12, 0x23, 0x0a, + 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, + 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, + 0x72, 0x33, 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x34, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x52, 0x07, + 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x34, 0x12, 0x23, 0x0a, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, + 0x72, 0x35, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x69, 0x6c, + 0x6c, 0x61, 0x72, 0x52, 0x07, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x35, 0x2a, 0x31, 0x0a, 0x0b, + 0x50, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x4e, + 0x6f, 0x55, 0x73, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x69, 0x6e, 0x67, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0x02, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -232,19 +320,20 @@ func file_martialhall_martialhall_db_proto_rawDescGZIP() []byte { return file_martialhall_martialhall_db_proto_rawDescData } +var file_martialhall_martialhall_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_martialhall_martialhall_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_martialhall_martialhall_db_proto_goTypes = []interface{}{ - (*DBPillar)(nil), // 0: DBPillar - (*DBMartialhall)(nil), // 1: DBMartialhall - (*UserAssets)(nil), // 2: UserAssets + (PillarState)(0), // 0: PillarState + (*DBPillar)(nil), // 1: DBPillar + (*DBMartialhall)(nil), // 2: DBMartialhall } var file_martialhall_martialhall_db_proto_depIdxs = []int32{ - 2, // 0: DBPillar.reward:type_name -> UserAssets - 0, // 1: DBMartialhall.pillar1:type_name -> DBPillar - 0, // 2: DBMartialhall.pillar2:type_name -> DBPillar - 0, // 3: DBMartialhall.pillar3:type_name -> DBPillar - 0, // 4: DBMartialhall.pillar4:type_name -> DBPillar - 0, // 5: DBMartialhall.pillar5:type_name -> DBPillar + 0, // 0: DBPillar.state:type_name -> PillarState + 1, // 1: DBMartialhall.pillar1:type_name -> DBPillar + 1, // 2: DBMartialhall.pillar2:type_name -> DBPillar + 1, // 3: DBMartialhall.pillar3:type_name -> DBPillar + 1, // 4: DBMartialhall.pillar4:type_name -> DBPillar + 1, // 5: DBMartialhall.pillar5:type_name -> DBPillar 6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name @@ -257,7 +346,6 @@ func file_martialhall_martialhall_db_proto_init() { if File_martialhall_martialhall_db_proto != nil { return } - file_comm_proto_init() if !protoimpl.UnsafeEnabled { file_martialhall_martialhall_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBPillar); i { @@ -289,13 +377,14 @@ func file_martialhall_martialhall_db_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_martialhall_martialhall_db_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_martialhall_martialhall_db_proto_goTypes, DependencyIndexes: file_martialhall_martialhall_db_proto_depIdxs, + EnumInfos: file_martialhall_martialhall_db_proto_enumTypes, MessageInfos: file_martialhall_martialhall_db_proto_msgTypes, }.Build() File_martialhall_martialhall_db_proto = out.File diff --git a/pb/martialhall_msg.pb.go b/pb/martialhall_msg.pb.go index 20d137b71..932fc1c52 100644 --- a/pb/martialhall_msg.pb.go +++ b/pb/martialhall_msg.pb.go @@ -20,19 +20,107 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +///信息请求 +type MartialhallInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MartialhallInfoReq) Reset() { + *x = MartialhallInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_martialhall_martialhall_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MartialhallInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MartialhallInfoReq) ProtoMessage() {} + +func (x *MartialhallInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_martialhall_martialhall_msg_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MartialhallInfoReq.ProtoReflect.Descriptor instead. +func (*MartialhallInfoReq) Descriptor() ([]byte, []int) { + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{0} +} + +///信息请求 回应 +type MartialhallInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Info *DBMartialhall `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` +} + +func (x *MartialhallInfoResp) Reset() { + *x = MartialhallInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_martialhall_martialhall_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MartialhallInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MartialhallInfoResp) ProtoMessage() {} + +func (x *MartialhallInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_martialhall_martialhall_msg_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MartialhallInfoResp.ProtoReflect.Descriptor instead. +func (*MartialhallInfoResp) Descriptor() ([]byte, []int) { + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *MartialhallInfoResp) GetInfo() *DBMartialhall { + if x != nil { + return x.Info + } + return nil +} + ///练功请求 type MartialhallPracticeReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Pillar int32 `protobuf:"varint,1,opt,name=pillar,proto3" json:"pillar"` //柱子 + Pillar int32 `protobuf:"varint,1,opt,name=pillar,proto3" json:"pillar"` //柱子 + Hero string `protobuf:"bytes,2,opt,name=hero,proto3" json:"hero"` //英雄 } func (x *MartialhallPracticeReq) Reset() { *x = MartialhallPracticeReq{} if protoimpl.UnsafeEnabled { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[0] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +133,7 @@ func (x *MartialhallPracticeReq) String() string { func (*MartialhallPracticeReq) ProtoMessage() {} func (x *MartialhallPracticeReq) ProtoReflect() protoreflect.Message { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[0] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -58,7 +146,7 @@ func (x *MartialhallPracticeReq) ProtoReflect() protoreflect.Message { // Deprecated: Use MartialhallPracticeReq.ProtoReflect.Descriptor instead. func (*MartialhallPracticeReq) Descriptor() ([]byte, []int) { - return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{0} + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{2} } func (x *MartialhallPracticeReq) GetPillar() int32 { @@ -68,17 +156,28 @@ func (x *MartialhallPracticeReq) GetPillar() int32 { return 0 } +func (x *MartialhallPracticeReq) GetHero() string { + if x != nil { + return x.Hero + } + return "" +} + ///练功请求 回应 type MartialhallPracticeResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Pillar int32 `protobuf:"varint,1,opt,name=pillar,proto3" json:"pillar"` //柱子 + Hero string `protobuf:"bytes,2,opt,name=hero,proto3" json:"hero"` //英雄 + Issucc bool `protobuf:"varint,3,opt,name=issucc,proto3" json:"issucc"` //是否成功 } func (x *MartialhallPracticeResp) Reset() { *x = MartialhallPracticeResp{} if protoimpl.UnsafeEnabled { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[1] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -91,7 +190,7 @@ func (x *MartialhallPracticeResp) String() string { func (*MartialhallPracticeResp) ProtoMessage() {} func (x *MartialhallPracticeResp) ProtoReflect() protoreflect.Message { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[1] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -104,7 +203,28 @@ func (x *MartialhallPracticeResp) ProtoReflect() protoreflect.Message { // Deprecated: Use MartialhallPracticeResp.ProtoReflect.Descriptor instead. func (*MartialhallPracticeResp) Descriptor() ([]byte, []int) { - return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{1} + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *MartialhallPracticeResp) GetPillar() int32 { + if x != nil { + return x.Pillar + } + return 0 +} + +func (x *MartialhallPracticeResp) GetHero() string { + if x != nil { + return x.Hero + } + return "" +} + +func (x *MartialhallPracticeResp) GetIssucc() bool { + if x != nil { + return x.Issucc + } + return false } ///领取 请求 @@ -119,7 +239,7 @@ type MartialhallReceiveReq struct { func (x *MartialhallReceiveReq) Reset() { *x = MartialhallReceiveReq{} if protoimpl.UnsafeEnabled { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[2] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -132,7 +252,7 @@ func (x *MartialhallReceiveReq) String() string { func (*MartialhallReceiveReq) ProtoMessage() {} func (x *MartialhallReceiveReq) ProtoReflect() protoreflect.Message { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[2] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -145,7 +265,7 @@ func (x *MartialhallReceiveReq) ProtoReflect() protoreflect.Message { // Deprecated: Use MartialhallReceiveReq.ProtoReflect.Descriptor instead. func (*MartialhallReceiveReq) Descriptor() ([]byte, []int) { - return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{2} + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{4} } func (x *MartialhallReceiveReq) GetPillar() int32 { @@ -165,7 +285,7 @@ type MartialhallReceiveResp struct { func (x *MartialhallReceiveResp) Reset() { *x = MartialhallReceiveResp{} if protoimpl.UnsafeEnabled { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[3] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -178,7 +298,7 @@ func (x *MartialhallReceiveResp) String() string { func (*MartialhallReceiveResp) ProtoMessage() {} func (x *MartialhallReceiveResp) ProtoReflect() protoreflect.Message { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[3] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -191,7 +311,7 @@ func (x *MartialhallReceiveResp) ProtoReflect() protoreflect.Message { // Deprecated: Use MartialhallReceiveResp.ProtoReflect.Descriptor instead. func (*MartialhallReceiveResp) Descriptor() ([]byte, []int) { - return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{3} + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{5} } ///升级 请求 @@ -204,7 +324,7 @@ type MartialhallUpgradeReq struct { func (x *MartialhallUpgradeReq) Reset() { *x = MartialhallUpgradeReq{} if protoimpl.UnsafeEnabled { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[4] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -217,7 +337,7 @@ func (x *MartialhallUpgradeReq) String() string { func (*MartialhallUpgradeReq) ProtoMessage() {} func (x *MartialhallUpgradeReq) ProtoReflect() protoreflect.Message { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[4] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -230,7 +350,7 @@ func (x *MartialhallUpgradeReq) ProtoReflect() protoreflect.Message { // Deprecated: Use MartialhallUpgradeReq.ProtoReflect.Descriptor instead. func (*MartialhallUpgradeReq) Descriptor() ([]byte, []int) { - return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{4} + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{6} } ///升级 请求回应 @@ -238,12 +358,14 @@ type MartialhallUpgradeResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Info *DBMartialhall `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` } func (x *MartialhallUpgradeResp) Reset() { *x = MartialhallUpgradeResp{} if protoimpl.UnsafeEnabled { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[5] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -256,7 +378,7 @@ func (x *MartialhallUpgradeResp) String() string { func (*MartialhallUpgradeResp) ProtoMessage() {} func (x *MartialhallUpgradeResp) ProtoReflect() protoreflect.Message { - mi := &file_martialhall_martialhall_msg_proto_msgTypes[5] + mi := &file_martialhall_martialhall_msg_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -269,7 +391,14 @@ func (x *MartialhallUpgradeResp) ProtoReflect() protoreflect.Message { // Deprecated: Use MartialhallUpgradeResp.ProtoReflect.Descriptor instead. func (*MartialhallUpgradeResp) Descriptor() ([]byte, []int) { - return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{5} + return file_martialhall_martialhall_msg_proto_rawDescGZIP(), []int{7} +} + +func (x *MartialhallUpgradeResp) GetInfo() *DBMartialhall { + if x != nil { + return x.Info + } + return nil } var File_martialhall_martialhall_msg_proto protoreflect.FileDescriptor @@ -277,20 +406,35 @@ var File_martialhall_martialhall_msg_proto protoreflect.FileDescriptor var file_martialhall_martialhall_msg_proto_rawDesc = []byte{ 0x0a, 0x21, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x2f, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, - 0x6c, 0x6c, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, - 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, - 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, - 0x68, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x2f, 0x0a, 0x15, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6c, - 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, - 0x72, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x17, 0x0a, 0x15, 0x4d, - 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, - 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, + 0x2f, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x62, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, + 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, 0x39, 0x0a, 0x13, 0x4d, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, + 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x44, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x22, 0x5d, 0x0a, 0x17, + 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x50, 0x72, 0x61, 0x63, 0x74, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, + 0x65, 0x72, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x2f, 0x0a, 0x15, 0x4d, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x22, 0x18, 0x0a, 0x16, + 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, + 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x22, + 0x3c, 0x0a, 0x16, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x55, 0x70, + 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x72, 0x74, + 0x69, 0x61, 0x6c, 0x68, 0x61, 0x6c, 0x6c, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -305,21 +449,26 @@ func file_martialhall_martialhall_msg_proto_rawDescGZIP() []byte { return file_martialhall_martialhall_msg_proto_rawDescData } -var file_martialhall_martialhall_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_martialhall_martialhall_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_martialhall_martialhall_msg_proto_goTypes = []interface{}{ - (*MartialhallPracticeReq)(nil), // 0: MartialhallPracticeReq - (*MartialhallPracticeResp)(nil), // 1: MartialhallPracticeResp - (*MartialhallReceiveReq)(nil), // 2: MartialhallReceiveReq - (*MartialhallReceiveResp)(nil), // 3: MartialhallReceiveResp - (*MartialhallUpgradeReq)(nil), // 4: MartialhallUpgradeReq - (*MartialhallUpgradeResp)(nil), // 5: MartialhallUpgradeResp + (*MartialhallInfoReq)(nil), // 0: MartialhallInfoReq + (*MartialhallInfoResp)(nil), // 1: MartialhallInfoResp + (*MartialhallPracticeReq)(nil), // 2: MartialhallPracticeReq + (*MartialhallPracticeResp)(nil), // 3: MartialhallPracticeResp + (*MartialhallReceiveReq)(nil), // 4: MartialhallReceiveReq + (*MartialhallReceiveResp)(nil), // 5: MartialhallReceiveResp + (*MartialhallUpgradeReq)(nil), // 6: MartialhallUpgradeReq + (*MartialhallUpgradeResp)(nil), // 7: MartialhallUpgradeResp + (*DBMartialhall)(nil), // 8: DBMartialhall } var file_martialhall_martialhall_msg_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 8, // 0: MartialhallInfoResp.info:type_name -> DBMartialhall + 8, // 1: MartialhallUpgradeResp.info:type_name -> DBMartialhall + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_martialhall_martialhall_msg_proto_init() } @@ -327,9 +476,10 @@ func file_martialhall_martialhall_msg_proto_init() { if File_martialhall_martialhall_msg_proto != nil { return } + file_martialhall_martialhall_db_proto_init() if !protoimpl.UnsafeEnabled { file_martialhall_martialhall_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MartialhallPracticeReq); i { + switch v := v.(*MartialhallInfoReq); i { case 0: return &v.state case 1: @@ -341,7 +491,7 @@ func file_martialhall_martialhall_msg_proto_init() { } } file_martialhall_martialhall_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MartialhallPracticeResp); i { + switch v := v.(*MartialhallInfoResp); i { case 0: return &v.state case 1: @@ -353,7 +503,7 @@ func file_martialhall_martialhall_msg_proto_init() { } } file_martialhall_martialhall_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MartialhallReceiveReq); i { + switch v := v.(*MartialhallPracticeReq); i { case 0: return &v.state case 1: @@ -365,7 +515,7 @@ func file_martialhall_martialhall_msg_proto_init() { } } file_martialhall_martialhall_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MartialhallReceiveResp); i { + switch v := v.(*MartialhallPracticeResp); i { case 0: return &v.state case 1: @@ -377,7 +527,7 @@ func file_martialhall_martialhall_msg_proto_init() { } } file_martialhall_martialhall_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MartialhallUpgradeReq); i { + switch v := v.(*MartialhallReceiveReq); i { case 0: return &v.state case 1: @@ -389,6 +539,30 @@ func file_martialhall_martialhall_msg_proto_init() { } } file_martialhall_martialhall_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MartialhallReceiveResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_martialhall_martialhall_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MartialhallUpgradeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_martialhall_martialhall_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MartialhallUpgradeResp); i { case 0: return &v.state @@ -407,7 +581,7 @@ func file_martialhall_martialhall_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_martialhall_martialhall_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/game.kungfu_masterworker.go b/sys/configure/structs/game.kungfu_masterworker.go new file mode 100644 index 000000000..618f622e8 --- /dev/null +++ b/sys/configure/structs/game.kungfu_masterworker.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type Gamekungfu_masterworker struct { + _dataMap map[int32]*Gamekungfu_masterworkerData + _dataList []*Gamekungfu_masterworkerData +} + +func NewGamekungfu_masterworker(_buf []map[string]interface{}) (*Gamekungfu_masterworker, error) { + _dataList := make([]*Gamekungfu_masterworkerData, 0, len(_buf)) + dataMap := make(map[int32]*Gamekungfu_masterworkerData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGamekungfu_masterworkerData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Level] = _v + } + } + return &Gamekungfu_masterworker{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Gamekungfu_masterworker) GetDataMap() map[int32]*Gamekungfu_masterworkerData { + return table._dataMap +} + +func (table *Gamekungfu_masterworker) GetDataList() []*Gamekungfu_masterworkerData { + return table._dataList +} + +func (table *Gamekungfu_masterworker) Get(key int32) *Gamekungfu_masterworkerData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.kungfu_masterworkerData.go b/sys/configure/structs/game.kungfu_masterworkerData.go new file mode 100644 index 000000000..69b92d496 --- /dev/null +++ b/sys/configure/structs/game.kungfu_masterworkerData.go @@ -0,0 +1,85 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type Gamekungfu_masterworkerData struct { + Level int32 + Star int32 + Quality int32 + QualityText string + Color string + Levelname string + Exp int32 + Model int32 + Ornament string + Affix string + Needtime int32 + LevelDeplete []*Gameatn + Deplete []*Gameatn +} + +const TypeId_Gamekungfu_masterworkerData = -2026478053 + +func (*Gamekungfu_masterworkerData) GetTypeId() int32 { + return -2026478053 +} + +func (_v *Gamekungfu_masterworkerData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["level"].(float64); !_ok_ { err = errors.New("level error"); return }; _v.Level = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["quality"].(float64); !_ok_ { err = errors.New("quality error"); return }; _v.Quality = int32(_tempNum_) } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["quality_text"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.QualityText error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.QualityText, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } + { var _ok_ bool; if _v.Color, _ok_ = _buf["color"].(string); !_ok_ { err = errors.New("color error"); return } } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["levelname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Levelname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Levelname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["exp"].(float64); !_ok_ { err = errors.New("exp error"); return }; _v.Exp = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["model"].(float64); !_ok_ { err = errors.New("model error"); return }; _v.Model = int32(_tempNum_) } + { var _ok_ bool; if _v.Ornament, _ok_ = _buf["ornament"].(string); !_ok_ { err = errors.New("ornament error"); return } } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["affix"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Affix error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Affix, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["needtime"].(float64); !_ok_ { err = errors.New("needtime error"); return }; _v.Needtime = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["level_deplete"].([]interface{}); !_ok_ { err = errors.New("level_deplete error"); return } + + _v.LevelDeplete = make([]*Gameatn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Gameatn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } + _v.LevelDeplete = append(_v.LevelDeplete, _list_v_) + } + } + + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["deplete"].([]interface{}); !_ok_ { err = errors.New("deplete error"); return } + + _v.Deplete = make([]*Gameatn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Gameatn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } + _v.Deplete = append(_v.Deplete, _list_v_) + } + } + + return +} + +func DeserializeGamekungfu_masterworkerData(_buf map[string]interface{}) (*Gamekungfu_masterworkerData, error) { + v := &Gamekungfu_masterworkerData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/game.kungfu_unlock.go b/sys/configure/structs/game.kungfu_unlock.go new file mode 100644 index 000000000..b6ca3e5c0 --- /dev/null +++ b/sys/configure/structs/game.kungfu_unlock.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type Gamekungfu_unlock struct { + _dataMap map[int32]*Gamekungfu_unlockData + _dataList []*Gamekungfu_unlockData +} + +func NewGamekungfu_unlock(_buf []map[string]interface{}) (*Gamekungfu_unlock, error) { + _dataList := make([]*Gamekungfu_unlockData, 0, len(_buf)) + dataMap := make(map[int32]*Gamekungfu_unlockData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGamekungfu_unlockData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &Gamekungfu_unlock{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Gamekungfu_unlock) GetDataMap() map[int32]*Gamekungfu_unlockData { + return table._dataMap +} + +func (table *Gamekungfu_unlock) GetDataList() []*Gamekungfu_unlockData { + return table._dataList +} + +func (table *Gamekungfu_unlock) Get(key int32) *Gamekungfu_unlockData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.kungfu_unlockData.go b/sys/configure/structs/game.kungfu_unlockData.go new file mode 100644 index 000000000..c0d90cda5 --- /dev/null +++ b/sys/configure/structs/game.kungfu_unlockData.go @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" + +type Gamekungfu_unlockData struct { + Id int32 + Type int32 + Area int32 + Consume []*Gameatn +} + +const TypeId_Gamekungfu_unlockData = -515174465 + +func (*Gamekungfu_unlockData) GetTypeId() int32 { + return -515174465 +} + +func (_v *Gamekungfu_unlockData)Deserialize(_buf map[string]interface{}) (err error) { + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["area"].(float64); !_ok_ { err = errors.New("area error"); return }; _v.Area = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["consume"].([]interface{}); !_ok_ { err = errors.New("consume error"); return } + + _v.Consume = make([]*Gameatn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Gameatn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } + _v.Consume = append(_v.Consume, _list_v_) + } + } + + return +} + +func DeserializeGamekungfu_unlockData(_buf map[string]interface{}) (*Gamekungfu_unlockData, error) { + v := &Gamekungfu_unlockData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +}