Browse Source

:whale: 查询人物信息

渔民小镇 1 năm trước cách đây
mục cha
commit
ce13a4b127
21 tập tin đã thay đổi với 256 bổ sung68 xóa
  1. 1 1
      logic/map-logic/src/main/java/com/iohao/mmo/map/action/MapAction.java
  2. 32 0
      logic/person-logic/src/main/java/com/iohao/mmo/hero/action/HeroAction.java
  3. 5 5
      logic/person-logic/src/main/java/com/iohao/mmo/hero/service/HeroService.java
  4. 29 4
      logic/person-logic/src/main/java/com/iohao/mmo/person/action/PersonAction.java
  5. 16 16
      logic/person-logic/src/main/java/com/iohao/mmo/person/entity/BasicProperty.java
  6. 1 1
      logic/person-logic/src/main/java/com/iohao/mmo/person/entity/Hero.java
  7. 2 5
      logic/person-logic/src/main/java/com/iohao/mmo/person/entity/Person.java
  8. 8 3
      logic/person-logic/src/main/java/com/iohao/mmo/person/mapper/PersonMapper.java
  9. 7 7
      logic/person-logic/src/main/java/com/iohao/mmo/person/service/PersonService.java
  10. 19 12
      one-client/src/main/java/com/iohao/mmo/client/CommonClient.java
  11. 4 0
      one-client/src/main/java/com/iohao/mmo/client/OneClient.java
  12. 1 1
      pom.xml
  13. 1 0
      provide/common-provide/src/main/java/com/iohao/mmo/common/provide/cmd/CmdModule.java
  14. 1 0
      provide/login-provide/src/main/java/com/iohao/mmo/login/client/LoginInputCommandRegion.java
  15. 7 10
      provide/map-provide/src/main/java/com/iohao/mmo/map/client/MapInputCommandRegion.java
  16. 1 1
      provide/map-provide/src/main/java/com/iohao/mmo/map/proto/EnterMapMessage.java
  17. 30 0
      provide/person-provide/src/main/java/com/iohao/mmo/hero/cmd/HeroCmd.java
  18. 37 0
      provide/person-provide/src/main/java/com/iohao/mmo/hero/proto/HeroMessage.java
  19. 42 0
      provide/person-provide/src/main/java/com/iohao/mmo/person/client/PersonInputCommandRegion.java
  20. 1 1
      provide/person-provide/src/main/java/com/iohao/mmo/person/cmd/PersonCmd.java
  21. 11 1
      provide/person-provide/src/main/java/com/iohao/mmo/person/proto/PersonMessage.java

+ 1 - 1
logic/map-logic/src/main/java/com/iohao/mmo/map/action/MapAction.java

@@ -99,7 +99,7 @@ public class MapAction {
 
         EnterMapMessage enterMapMessage = new EnterMapMessage();
         Collection<MapPlayer> players = room.listPlayer();
-        enterMapMessage.playerList = MapMapper.ME.convertList(players);
+        enterMapMessage.players = MapMapper.ME.convertList(players);
 
         return enterMapMessage;
     }

+ 32 - 0
logic/person-logic/src/main/java/com/iohao/mmo/hero/action/HeroAction.java

@@ -0,0 +1,32 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.hero.action;
+
+import com.iohao.game.action.skeleton.annotation.ActionController;
+import com.iohao.mmo.hero.cmd.HeroCmd;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-29
+ */
+@Slf4j
+@ActionController(HeroCmd.cmd)
+public class HeroAction {
+}

+ 5 - 5
logic/person-logic/src/main/java/com/iohao/mmo/hero/service/HeroService.java

@@ -18,7 +18,7 @@
  */
 package com.iohao.mmo.hero.service;
 
-import com.iohao.mmo.person.entity.BasicsProperty;
+import com.iohao.mmo.person.entity.BasicProperty;
 import com.iohao.mmo.person.entity.Hero;
 import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.stereotype.Service;
@@ -50,14 +50,14 @@ public class HeroService {
         hero.setId("hero-1");
         hero.setName("阿里克斯");
 
-        BasicsProperty basicProperty = getInitBasicProperty();
-        hero.setBasicsProperty(basicProperty);
+        BasicProperty basicProperty = getInitBasicProperty();
+        hero.setBasicProperty(basicProperty);
 
         mongoTemplate.save(hero);
     }
 
-    private BasicsProperty getInitBasicProperty() {
-        BasicsProperty basicProperty = new BasicsProperty();
+    private BasicProperty getInitBasicProperty() {
+        BasicProperty basicProperty = new BasicProperty();
         basicProperty.setHp(200);
         basicProperty.setMp(200);
         basicProperty.setPhysicsAttack(60);

+ 29 - 4
logic/person-logic/src/main/java/com/iohao/mmo/person/action/PersonAction.java

@@ -22,8 +22,13 @@ import com.iohao.game.action.skeleton.annotation.ActionController;
 import com.iohao.game.action.skeleton.annotation.ActionMethod;
 import com.iohao.game.action.skeleton.core.flow.FlowContext;
 import com.iohao.mmo.person.cmd.PersonCmd;
+import com.iohao.mmo.person.entity.Person;
+import com.iohao.mmo.person.mapper.PersonMapper;
 import com.iohao.mmo.person.proto.PersonMessage;
+import com.iohao.mmo.person.service.PersonService;
+import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
 
 /**
  * 人物相关 action
@@ -32,19 +37,39 @@ import lombok.extern.slf4j.Slf4j;
  * @date 2023-07-23
  */
 @Slf4j
+@Component
 @ActionController(PersonCmd.cmd)
 public class PersonAction {
 
-    public void createPerson() {
+    @Resource
+    PersonService personService;
 
+    /**
+     * 初始化人物信息
+     *
+     * @param flowContext flowContext
+     */
+    @ActionMethod(PersonCmd.initPerson)
+    public void initPerson(FlowContext flowContext) {
+        long userId = flowContext.getUserId();
+        // 初始化人物数据,暂时放这
+        personService.initPerson(userId);
     }
 
+    /**
+     * 获取人物信息
+     *
+     * @param flowContext flowContext
+     * @return 人物信息
+     */
     @ActionMethod(PersonCmd.getPerson)
-    public PersonMessage getPersonMessage(FlowContext flowContext) {
+    public PersonMessage getPerson(FlowContext flowContext) {
         long userId = flowContext.getUserId();
 
-        
+        // 由于没写注册,暂时这样创建人物信息
+        initPerson(flowContext);
 
-        return null;
+        Person person = personService.getPersonById(userId);
+        return PersonMapper.ME.convert(person);
     }
 }

+ 16 - 16
logic/person-logic/src/main/java/com/iohao/mmo/person/entity/BasicsProperty.java → logic/person-logic/src/main/java/com/iohao/mmo/person/entity/BasicProperty.java

@@ -37,7 +37,7 @@ import java.util.Objects;
 @Data
 @Document
 @FieldDefaults(level = AccessLevel.PRIVATE)
-public class BasicsProperty {
+public class BasicProperty {
     @Id
     String id;
     /** 生命值 */
@@ -63,24 +63,24 @@ public class BasicsProperty {
     /** 怒气 */
     int anger;
 
-    public BasicsProperty plus(BasicsProperty basicsProperty) {
+    public BasicProperty plus(BasicProperty basicProperty) {
 
-        if (Objects.isNull(basicsProperty)) {
-            basicsProperty = new BasicsProperty();
+        if (Objects.isNull(basicProperty)) {
+            basicProperty = new BasicProperty();
         }
 
-        BasicsProperty the = new BasicsProperty();
-        the.hp = this.hp + basicsProperty.hp;
-        the.mp = this.mp + basicsProperty.mp;
-        the.physicsAttack = this.physicsAttack + basicsProperty.physicsAttack;
-        the.physicsDefense = this.physicsDefense + basicsProperty.physicsDefense;
-        the.magicAttack = this.magicAttack + basicsProperty.magicAttack;
-        the.magicDefense = this.magicDefense + basicsProperty.magicDefense;
-        the.treatAttack = this.treatAttack + basicsProperty.treatAttack;
-        the.sealAttack = this.sealAttack + basicsProperty.sealAttack;
-        the.sealDefense = this.sealDefense + basicsProperty.sealDefense;
-        the.speed = this.speed + basicsProperty.speed;
-        the.anger = this.anger + basicsProperty.anger;
+        BasicProperty the = new BasicProperty();
+        the.hp = this.hp + basicProperty.hp;
+        the.mp = this.mp + basicProperty.mp;
+        the.physicsAttack = this.physicsAttack + basicProperty.physicsAttack;
+        the.physicsDefense = this.physicsDefense + basicProperty.physicsDefense;
+        the.magicAttack = this.magicAttack + basicProperty.magicAttack;
+        the.magicDefense = this.magicDefense + basicProperty.magicDefense;
+        the.treatAttack = this.treatAttack + basicProperty.treatAttack;
+        the.sealAttack = this.sealAttack + basicProperty.sealAttack;
+        the.sealDefense = this.sealDefense + basicProperty.sealDefense;
+        the.speed = this.speed + basicProperty.speed;
+        the.anger = this.anger + basicProperty.anger;
 
         return the;
     }

+ 1 - 1
logic/person-logic/src/main/java/com/iohao/mmo/person/entity/Hero.java

@@ -37,5 +37,5 @@ public class Hero {
     /** 英雄名 */
     String name;
     /** 基础属性 */
-    BasicsProperty basicsProperty;
+    BasicProperty basicProperty;
 }

+ 2 - 5
logic/person-logic/src/main/java/com/iohao/mmo/person/entity/Person.java

@@ -20,11 +20,8 @@ package com.iohao.mmo.person.entity;
 
 import lombok.AccessLevel;
 import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
 import lombok.experimental.FieldDefaults;
 import org.springframework.data.annotation.Id;
-import org.springframework.data.mongodb.core.mapping.DBRef;
 import org.springframework.data.mongodb.core.mapping.Document;
 import org.springframework.data.mongodb.core.mapping.DocumentReference;
 
@@ -41,10 +38,10 @@ public class Person {
     @Id
     String id;
     /** 基本属性 */
-    BasicsProperty basicProperty;
+    BasicProperty basicProperty;
     /** 英雄列表 */
     @DocumentReference
-    List<Hero> heroes;
+    List<Hero> heroList;
     /** 当前使用的英雄 */
     Hero currentHero;
 }

+ 8 - 3
logic/person-logic/src/main/java/com/iohao/mmo/person/mapper/PersonMapper.java

@@ -18,11 +18,13 @@
  */
 package com.iohao.mmo.person.mapper;
 
-import com.iohao.mmo.person.entity.BasicsProperty;
+import com.iohao.mmo.person.entity.BasicProperty;
 import com.iohao.mmo.person.entity.Person;
 import com.iohao.mmo.person.proto.BasicPropertyMessage;
 import com.iohao.mmo.person.proto.PersonMessage;
 import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.factory.Mappers;
 
 /**
  * @author 渔民小镇
@@ -30,7 +32,10 @@ import org.mapstruct.Mapper;
  */
 @Mapper
 public interface PersonMapper {
-    PersonMessage convertPerson(Person person);
+    PersonMapper ME = Mappers.getMapper(PersonMapper.class);
 
-    BasicPropertyMessage convertBasicProperty(BasicsProperty basicProperty);
+    @Mapping(source = "id", target = "userId")
+    PersonMessage convert(Person person);
+
+    BasicPropertyMessage convert(BasicProperty basicProperty);
 }

+ 7 - 7
logic/person-logic/src/main/java/com/iohao/mmo/person/service/PersonService.java

@@ -19,7 +19,7 @@
 package com.iohao.mmo.person.service;
 
 import com.iohao.mmo.hero.service.HeroService;
-import com.iohao.mmo.person.entity.BasicsProperty;
+import com.iohao.mmo.person.entity.BasicProperty;
 import com.iohao.mmo.person.entity.Hero;
 import com.iohao.mmo.person.entity.Person;
 import org.springframework.data.mongodb.core.MongoTemplate;
@@ -58,18 +58,18 @@ public class PersonService {
 
     private void createPerson(long userId) {
         // 人物基础属性
-        BasicsProperty basicProperty = getInitBasicProperty();
+        BasicProperty basicProperty = getInitBasicProperty();
 
         Hero firstHero = heroService.getFirstHero();
 
-        BasicsProperty plus = basicProperty.plus(firstHero.getBasicsProperty());
+        BasicProperty plus = basicProperty.plus(firstHero.getBasicProperty());
 
-        firstHero.setBasicsProperty(plus);
+        firstHero.setBasicProperty(plus);
 
         Person person = new Person();
         person.setId(String.valueOf(userId));
         person.setBasicProperty(basicProperty);
-        person.setHeroes(List.of(firstHero));
+        person.setHeroList(List.of(firstHero));
         person.setCurrentHero(firstHero);
 
         mongoTemplate.save(person);
@@ -79,8 +79,8 @@ public class PersonService {
         return mongoTemplate.findById(String.valueOf(userId), Person.class);
     }
 
-    private BasicsProperty getInitBasicProperty() {
-        BasicsProperty basicProperty = new BasicsProperty();
+    private BasicProperty getInitBasicProperty() {
+        BasicProperty basicProperty = new BasicProperty();
         basicProperty.setHp(100);
         basicProperty.setMp(100);
         basicProperty.setPhysicsAttack(20);

+ 19 - 12
one-client/src/main/java/com/iohao/mmo/client/CommonClient.java

@@ -24,6 +24,7 @@ import com.iohao.game.external.client.user.ClientUser;
 import com.iohao.game.external.client.user.DefaultClientUser;
 import com.iohao.mmo.login.client.LoginInputCommandRegion;
 import com.iohao.mmo.map.client.MapInputCommandRegion;
+import com.iohao.mmo.person.client.PersonInputCommandRegion;
 
 import java.util.List;
 
@@ -32,18 +33,6 @@ import java.util.List;
  * @date 2023-07-21
  */
 public class CommonClient {
-    private static List<InputCommandRegion> listInputCommandRegion() {
-        LoginInputCommandRegion loginInputCommandRegion = new LoginInputCommandRegion();
-        MapInputCommandRegion mapInputCommandRegion = new MapInputCommandRegion();
-        // 模拟请求数据
-        return List.of(
-                // 登录
-                loginInputCommandRegion
-                // 地图
-                , mapInputCommandRegion
-        );
-    }
-
     static void start(long userId) {
         // 客户端的用户(玩家)
         ClientUser clientUser = new DefaultClientUser();
@@ -57,4 +46,22 @@ public class CommonClient {
                 .setInputCommandRegions(inputCommandRegions)
                 .startup();
     }
+
+    private static List<InputCommandRegion> listInputCommandRegion() {
+        LoginInputCommandRegion loginInputCommandRegion = new LoginInputCommandRegion();
+        MapInputCommandRegion mapInputCommandRegion = new MapInputCommandRegion();
+        PersonInputCommandRegion personInputCommandRegion = new PersonInputCommandRegion();
+
+        // 模拟请求数据
+        return List.of(
+                // 登录
+                loginInputCommandRegion
+                // 地图
+                , mapInputCommandRegion
+                // 人物、英雄
+                , personInputCommandRegion
+        );
+    }
+
+
 }

+ 4 - 0
one-client/src/main/java/com/iohao/mmo/client/OneClient.java

@@ -18,6 +18,7 @@
  */
 package com.iohao.mmo.client;
 
+import com.iohao.game.external.client.kit.ClientUserConfigs;
 import lombok.extern.slf4j.Slf4j;
 
 /**
@@ -29,6 +30,9 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class OneClient {
     public static void main(String[] args) {
+        // 关闭模拟请求相关日志 - 如果想看模拟请求更多的日志,请删除下面这行代码。
+        ClientUserConfigs.closeLog();
+
         // 模拟玩家 1
         long userId = 1;
         CommonClient.start(userId);

+ 1 - 1
pom.xml

@@ -50,7 +50,7 @@
         <encoding>UTF-8</encoding>
 
         <!-- 项目版本 -->
-        <ioGame.version>17.1.48</ioGame.version>
+        <ioGame.version>17.1.49</ioGame.version>
         <spring-boot.version>3.1.2</spring-boot.version>
         <!-- lombok 消除冗长的 Java 代码 https://mvnrepository.com/artifact/org.projectlombok/lombok -->
         <lombok.version>1.18.24</lombok.version>

+ 1 - 0
provide/common-provide/src/main/java/com/iohao/mmo/common/provide/cmd/CmdModule.java

@@ -28,4 +28,5 @@ public interface CmdModule {
     int loginCmd = 1;
     int personCmd = 2;
     int mapCmd = 3;
+    int heroCmd = 4;
 }

+ 1 - 0
provide/login-provide/src/main/java/com/iohao/mmo/login/client/LoginInputCommandRegion.java

@@ -56,6 +56,7 @@ public class LoginInputCommandRegion extends AbstractInputCommandRegion {
             log.info("登录成功 : {}", userInfo);
             clientUser.setUserId(userInfo.id);
             clientUser.setNickname(userInfo.nickname);
+            clientUser.callbackInputCommandRegion();
         }).setDescription("登录").setInputRequestData(inputRequestData);
 
         InternalKit.newTimeout(task -> {

+ 7 - 10
provide/map-provide/src/main/java/com/iohao/mmo/map/client/MapInputCommandRegion.java

@@ -18,7 +18,6 @@
  */
 package com.iohao.mmo.map.client;
 
-import com.iohao.game.common.kit.InternalKit;
 import com.iohao.game.common.kit.attr.AttrOption;
 import com.iohao.game.external.client.AbstractInputCommandRegion;
 import com.iohao.game.external.client.command.InputRequestData;
@@ -29,8 +28,6 @@ import com.iohao.mmo.map.proto.EnterMapReq;
 import com.iohao.mmo.map.proto.LocationMessage;
 import lombok.extern.slf4j.Slf4j;
 
-import java.util.concurrent.TimeUnit;
-
 /**
  * @author 渔民小镇
  * @date 2023-07-27
@@ -44,14 +41,14 @@ public class MapInputCommandRegion extends AbstractInputCommandRegion {
 
         request();
         listen();
+    }
 
-        // N 秒后自动进入地图
-        InternalKit.newTimeout(task -> {
-            // 进入地图,根据地图 id
-            EnterMapReq enterMapReq = new EnterMapReq();
-            enterMapReq.mapId = 1;
-            ofRequestCommand(MapCmd.enterMap).request(enterMapReq);
-        }, 2, TimeUnit.SECONDS);
+    @Override
+    public void loginSuccessCallback() {
+        // 进入地图,根据地图 id
+        EnterMapReq enterMapReq = new EnterMapReq();
+        enterMapReq.mapId = 1;
+        ofRequestCommand(MapCmd.enterMap).request(enterMapReq);
     }
 
     private void request() {

+ 1 - 1
provide/map-provide/src/main/java/com/iohao/mmo/map/proto/EnterMapMessage.java

@@ -38,5 +38,5 @@ public class EnterMapMessage {
     /** 地图 id */
     long mapId;
     /** 地图上的玩家列表 */
-    List<MapPlayerMessage> playerList;
+    List<MapPlayerMessage> players;
 }

+ 30 - 0
provide/person-provide/src/main/java/com/iohao/mmo/hero/cmd/HeroCmd.java

@@ -0,0 +1,30 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.hero.cmd;
+
+import com.iohao.mmo.common.provide.cmd.CmdModule;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-29
+ */
+public interface HeroCmd {
+    int cmd = CmdModule.heroCmd;
+    int listHero = 1;
+}

+ 37 - 0
provide/person-provide/src/main/java/com/iohao/mmo/hero/proto/HeroMessage.java

@@ -0,0 +1,37 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.hero.proto;
+
+import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
+import com.iohao.mmo.person.proto.BasicPropertyMessage;
+import lombok.AccessLevel;
+import lombok.ToString;
+import lombok.experimental.FieldDefaults;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-29
+ */
+@ToString
+@ProtobufClass
+@FieldDefaults(level = AccessLevel.PUBLIC)
+public class HeroMessage {
+    /** 基础属性 */
+    BasicPropertyMessage basicProperty;
+}

+ 42 - 0
provide/person-provide/src/main/java/com/iohao/mmo/person/client/PersonInputCommandRegion.java

@@ -0,0 +1,42 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.person.client;
+
+import com.iohao.game.external.client.AbstractInputCommandRegion;
+import com.iohao.mmo.person.cmd.PersonCmd;
+import com.iohao.mmo.person.proto.PersonMessage;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-29
+ */
+@Slf4j
+public class PersonInputCommandRegion extends AbstractInputCommandRegion {
+    @Override
+    public void initInputCommand() {
+        this.inputCommandCreate.cmd = PersonCmd.cmd;
+
+        ofCommand(PersonCmd.getPerson).callback(PersonMessage.class, result -> {
+            PersonMessage value = result.getValue();
+            log.info("value : {}", value);
+        }).setDescription("得到人物、英雄信息");
+
+    }
+}

+ 1 - 1
provide/person-provide/src/main/java/com/iohao/mmo/person/cmd/PersonCmd.java

@@ -27,5 +27,5 @@ import com.iohao.mmo.common.provide.cmd.CmdModule;
 public interface PersonCmd {
     int cmd = CmdModule.personCmd;
     int getPerson = 1;
-    int createPerson = 2;
+    int initPerson = 2;
 }

+ 11 - 1
provide/person-provide/src/main/java/com/iohao/mmo/person/proto/PersonMessage.java

@@ -19,11 +19,16 @@
 package com.iohao.mmo.person.proto;
 
 import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
+import com.iohao.mmo.hero.proto.HeroMessage;
 import lombok.AccessLevel;
 import lombok.ToString;
 import lombok.experimental.FieldDefaults;
 
+import java.util.List;
+
 /**
+ * 人物信息
+ *
  * @author 渔民小镇
  * @date 2023-07-23
  */
@@ -31,7 +36,12 @@ import lombok.experimental.FieldDefaults;
 @ProtobufClass
 @FieldDefaults(level = AccessLevel.PUBLIC)
 public class PersonMessage {
+    /** 玩家id */
     long userId;
-
+    /** 基本属性 */
     BasicPropertyMessage basicProperty;
+    /** 英雄列表 */
+    List<HeroMessage> heroList;
+    /** 当前使用的英雄 */
+    HeroMessage currentHero;
 }