24 | *
25 | * @author 渔民小镇
26 | * @date 2022-01-30
27 | */
28 | package com.iohao.game.collect.tank.mapstruct;
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-analyse-data/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-analyse-data
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | the-eventbus-common-data
20 | ${project.parent.version}
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-broker/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-broker
14 |
15 |
16 |
17 | com.iohao.example
18 | the-eventbus-common-data
19 | ${project.parent.version}
20 |
21 |
22 |
23 | com.iohao.game
24 | bolt-broker-server
25 | ${ioGame.version}
26 |
27 |
28 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-client
14 |
15 |
16 |
17 | com.iohao.example
18 | the-eventbus-common-data
19 | ${project.parent.version}
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-common-data
14 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/EmailCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common;
20 |
21 | /**
22 | * @author 渔民小镇
23 | * @date 2023-12-24
24 | */
25 | public interface EmailCmd {
26 | int cmd = 2;
27 | int fireEventMethod = 2;
28 | int fireEventOrder = 3;
29 | }
30 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/TheBusLogin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common;
20 |
21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
22 | import lombok.AccessLevel;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2023-12-24
29 | */
30 | @ToString
31 | @ProtobufClass
32 | @FieldDefaults(level = AccessLevel.PUBLIC)
33 | public class TheBusLogin {
34 | String jwt;
35 | }
36 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/UserCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common;
20 |
21 | /**
22 | * @author 渔民小镇
23 | * @date 2023-12-24
24 | */
25 | public interface UserCmd {
26 | int cmd = 1;
27 | int login = 0;
28 | int fireEvent = 1;
29 | int fireEventEmpty = 2;
30 | int fireAnyMail = 3;
31 | int fireSyncMail = 4;
32 | }
33 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/event/EmailMethodEventMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common.event;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2024-01-11
28 | */
29 | @Data
30 | public class EmailMethodEventMessage implements Serializable {
31 | final long userId;
32 |
33 | public EmailMethodEventMessage(long userId) {
34 | this.userId = userId;
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/event/EmailOrderEventMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common.event;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 |
25 | /**
26 | * 演示 order
27 | * @author 渔民小镇
28 | * @date 2024-01-11
29 | */
30 | @Data
31 | public class EmailOrderEventMessage implements Serializable {
32 | final long userId;
33 |
34 | public EmailOrderEventMessage(long userId) {
35 | this.userId = userId;
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/event/EmailSimpleEventMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common.event;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2024-01-11
28 | */
29 | @Data
30 | public class EmailSimpleEventMessage implements Serializable {
31 | final long userId;
32 |
33 | public EmailSimpleEventMessage(long userId) {
34 | this.userId = userId;
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/event/EmptyEventMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common.event;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-12-24
28 | */
29 | @Data
30 | public class EmptyEventMessage implements Serializable {
31 | final long userId;
32 |
33 | public EmptyEventMessage(long userId) {
34 | this.userId = userId;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/event/HotMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common.event;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2024-01-20
28 | */
29 | @Data
30 | public class HotMessage implements Serializable {
31 | byte[] hotCode;
32 | }
33 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-common-data/src/main/java/com/iohao/game/example/multiple/eventbus/common/event/UserLoginEventMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.common.event;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-12-24
28 | */
29 | @Data
30 | public class UserLoginEventMessage implements Serializable {
31 | final long userId;
32 |
33 | public UserLoginEventMessage(long userId) {
34 | this.userId = userId;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-external/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-external
14 |
15 |
16 |
17 | com.iohao.example
18 | the-eventbus-common-data
19 | ${project.parent.version}
20 |
21 |
22 |
23 | com.iohao.game
24 | external-netty
25 | ${ioGame.version}
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-logic-email/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-logic-email
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | the-eventbus-common-data
20 | ${project.parent.version}
21 |
22 |
23 |
24 | com.iohao.game
25 | bolt-client
26 | ${ioGame.version}
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-logic-email/src/main/java/com/iohao/game/example/multiple/eventbus/email/EmailAnyApp1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.multiple.eventbus.email;
20 |
21 | import com.iohao.game.bolt.broker.client.BrokerClientApplication;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2024-01-21
26 | */
27 | public class EmailAnyApp1 {
28 | public static void main(String[] args) {
29 | EmailLogicStartup emailLogicStartup = new EmailLogicStartup("1");
30 | // 启动游戏逻辑服
31 | BrokerClientApplication.start(emailLogicStartup);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple-eventbus/the-eventbus-logic-user/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-eventbus-logic-user
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | the-eventbus-common-data
20 | ${project.parent.version}
21 |
22 |
23 |
24 | com.iohao.game
25 | bolt-client
26 | ${ioGame.version}
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/README.md:
--------------------------------------------------------------------------------
1 | ## 简介
2 | 演示:多服单进程启动、多服多进程启动、代码组织与约定
3 |
4 | 关于[代码组织与约定-文档](https://www.yuque.com/iohao/game/keyrxn)
5 |
6 | ```text
7 | .
8 | ├── the-client 【模拟游戏客户端的请求】
9 | ├── the-common-broker 【Broker(游戏网关)】
10 | ├── the-common-data 【公共的模块包】
11 | ├── the-common-external 【游戏对外服】
12 | ├── the-one-application 【多服单进程启动演示】
13 | └── the-weather-game-logic 【游戏逻辑服】
14 | ```
15 |
16 | ## 多服单进程的启动演示
17 | > 启动类 MyOneApplication.java;在 the-one-application 模块中。
18 |
19 | ## 多服多进程的启动演示
20 | 多服多进程启动时,需要先启动 Broker(游戏网关),其他逻辑服随意;
21 |
22 | 1 启动 Broker(游戏网关)
23 | > 启动类 MyBrokerServer.java;在 the-common-broker 模块中。
24 |
25 | 2 启动游戏逻辑服
26 | > 启动类 WeatherLogicStartupApplication.java;在 the-weather-game-logic 模块中。
27 |
28 | 3 启动游戏对外服
29 | > 启动类 MyExternalServer.java;在 the-common-external 模块中。
30 |
31 |
32 | ## 启动模拟客户端,发起请求
33 | 当游戏服务器相关的启动完成后,可以向服务器发送请求;
34 | > 启动类 MyOneWebsocketClient.java;在 the-client 模块中。
35 |
36 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-client/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-client
14 |
15 |
16 |
17 | com.iohao.example
18 | the-common-data
19 | ${project.parent.version}
20 |
21 |
22 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-broker/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-broker/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-common-broker
14 |
15 |
16 |
17 | com.iohao.example
18 | the-common-data
19 | 3.0.0.io
20 |
21 |
22 |
23 | com.iohao.game
24 | bolt-broker-server
25 | ${ioGame.version}
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-data/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-data/src/main/java/com/iohao/game/example/multiple/common/cmd/CmdModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.multiple.common.cmd;
19 |
20 | /**
21 | * @author 渔民小镇
22 | * @date 2023-03-30
23 | */
24 | public interface CmdModule {
25 | int weather = 1;
26 | }
27 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-data/src/main/java/com/iohao/game/example/multiple/common/cmd/internal/WeatherCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.multiple.common.cmd.internal;
19 |
20 | import com.iohao.game.example.multiple.common.cmd.CmdModule;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2023-03-30
25 | */
26 | public interface WeatherCmd {
27 | int cmd = CmdModule.weather;
28 |
29 | int hello = 1;
30 |
31 | int login = 2;
32 | }
33 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-data/src/main/java/com/iohao/game/example/multiple/common/data/TheLogin.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.multiple.common.data;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-04-10
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class TheLogin {
33 | String jwt;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-data/src/main/java/com/iohao/game/example/multiple/common/data/TheUserInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.multiple.common.data;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-04-10
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class TheUserInfo {
33 | long id;
34 | String name;
35 | }
36 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-data/src/main/java/com/iohao/game/example/multiple/common/data/Weather.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.multiple.common.data;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-03-30
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class Weather {
33 | /** id */
34 | int id;
35 | String name;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-external/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-common-external/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-common-external
14 |
15 |
16 |
17 | com.iohao.example
18 | the-common-data
19 | 3.0.0.io
20 |
21 |
22 |
23 | com.iohao.game
24 | external-netty
25 | ${ioGame.version}
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-one-application/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-weather-game-logic/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-weather-game-logic/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | the-weather-game-logic
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | the-common-data
20 | 3.0.0.io
21 |
22 |
23 |
24 | com.iohao.game
25 | bolt-client
26 | ${ioGame.version}
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/SimpleExample/example-multiple/the-weather-game-logic/src/main/java/com/iohao/game/example/multiple/weather/WeatherLogicStartupApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.multiple.weather;
19 |
20 | import com.iohao.game.bolt.broker.client.BrokerClientApplication;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2023-03-30
25 | */
26 |
27 | public class WeatherLogicStartupApplication {
28 | public static void main(String[] args) {
29 | WeatherLogicStartup weatherLogicStartup = new WeatherLogicStartup();
30 | // 启动游戏逻辑服
31 | BrokerClientApplication.start(weatherLogicStartup);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SimpleExample/example/README.md:
--------------------------------------------------------------------------------
1 |
2 | 示例目录说明
3 | ```text
4 | .
5 | ├── example-broadcast 示例目录 广播(推送)
6 | ├── example-cluster-run-one 示例目录 集群
7 | ├── example-endpoint 示例目录 玩家动态绑定逻辑服节点
8 | ├── example-for-spring 示例目录 spring 集成
9 | ├── example-for-tcp-socket 示例目录 对外服使用tcp协议
10 | ├── example-hook 示例目录 钩子相关(心跳,用户上线、下线)
11 | ├── example-interaction 示例目录 逻辑服与逻辑服之间的交互(可跨进程)
12 | ├── example-interaction-same 示例目录 逻辑服间的相互通信;请求同类型多个逻辑服的结果集(可跨进程)
13 | ├── example-parent
14 | ├──
15 | ├──
16 | └──
17 | ```
18 |
19 |
20 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-broadcast/README.md:
--------------------------------------------------------------------------------
1 | ## 3类通讯方式之一广播
2 |
3 | https://www.yuque.com/iohao/game/qv4qfo
--------------------------------------------------------------------------------
/SimpleExample/example/example-broadcast/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-broadcast
14 |
15 |
16 | com.iohao.example
17 | example-parent
18 | ${project.parent.version}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-broadcast/src/main/java/com/iohao/game/example/broadcast/action/DemoBroadcastCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.broadcast.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-05-18
25 | */
26 | public interface DemoBroadcastCmd {
27 | /** 模块 - 主 cmd : 1 */
28 | int cmd = DemoModuleCmd.demoModule_7_cmd;
29 |
30 | /** 广播一些消息 */
31 | int broadcastMsg = 0;
32 |
33 | int helloBroadcast1 = 1;
34 |
35 | int testRangeBroadcast = 2;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-cluster-run-one/README.md:
--------------------------------------------------------------------------------
1 | ## 集群使用示例
2 |
3 | https://www.yuque.com/iohao/game/qmo56c
--------------------------------------------------------------------------------
/SimpleExample/example/example-cluster-run-one/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-cluster-run-one
14 |
15 |
16 |
17 | com.iohao.example
18 | example-parent
19 | ${project.parent.version}
20 |
21 |
22 |
23 | com.iohao.game
24 | light-jprotobuf
25 | ${ioGame.version}
26 |
27 |
28 |
29 |
30 | com.iohao.game
31 | run-one-netty
32 | ${ioGame.version}
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-cluster-run-one/src/main/java/com/iohao/game/example/cluster/one/action/DemoClusterCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.cluster.one.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-05-15
25 | */
26 | public interface DemoClusterCmd {
27 | /** 模块 - 主 cmd : 6 */
28 | int cmd = DemoModuleCmd.demoModule_6_cmd;
29 |
30 | /** 示例 here 方法 */
31 | int here = 0;
32 | }
33 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-cluster-run-one/src/test/java/com/iohao/game/example/cluster/one/DemoClusterLogic.java:
--------------------------------------------------------------------------------
1 | package com.iohao.game.example.cluster.one;
2 |
3 | import com.iohao.game.bolt.broker.client.AbstractBrokerClientStartup;
4 | import com.iohao.game.example.cluster.one.server.DemoClusterLogicServer;
5 | import com.iohao.game.external.core.netty.simple.NettyClusterSimpleRunOne;
6 |
7 | import java.util.List;
8 | import java.util.concurrent.TimeUnit;
9 |
10 | /**
11 | * 游戏逻辑服
12 | *
13 | * @author 渔民小镇
14 | * @date 2022-05-16
15 | */
16 | public class DemoClusterLogic {
17 | public static void main(String[] args) throws InterruptedException {
18 |
19 | DemoClusterConfig.defaultConfig();
20 |
21 | // 逻辑服
22 | var demoLogicServer = new DemoClusterLogicServer();
23 | List logicList = List.of(demoLogicServer);
24 |
25 | // 简单的启动器
26 | new NettyClusterSimpleRunOne()
27 | // 禁用本地集群
28 | .disableBrokerServerCluster()
29 | // 逻辑服列表
30 | .setLogicServerList(logicList)
31 | // 启动 对外服、网关、逻辑服
32 | .startup();
33 |
34 | TimeUnit.MINUTES.sleep(30);
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/SimpleExample/example/example-codec-json/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-codec-json
14 |
15 |
16 |
17 | com.iohao.example
18 | example-parent
19 | ${project.parent.version}
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-web
25 | ${springboot.version}
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-codec-json/src/main/java/com/iohao/example/json/app/JsonMsg.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.example.json.app;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2022-12-04
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class JsonMsg {
33 | String name;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-codec-json/src/main/resources/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | websocket.js
7 |
8 |
9 |
ioGame websocket.js
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-endpoint/README.md:
--------------------------------------------------------------------------------
1 | ## 用户动态绑定逻辑服节点
2 |
3 | https://www.yuque.com/iohao/game/idl1wm
--------------------------------------------------------------------------------
/SimpleExample/example/example-endpoint/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-endpoint
14 |
15 |
16 | com.iohao.example
17 | example-parent
18 | ${project.parent.version}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-endpoint/src/main/java/com/iohao/game/example/endpoint/animal/action/DemoCmdForEndPointAnimal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.endpoint.animal.action;
20 |
21 | import com.iohao.game.example.common.DemoModuleCmd;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2023-06-06
26 | */
27 | public interface DemoCmdForEndPointAnimal {
28 | int cmd = DemoModuleCmd.demoModule_20_endpoint_animal_cmd;
29 |
30 | /** 随机一个动物 */
31 | int randomAnimal = 0;
32 | }
33 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-endpoint/src/main/java/com/iohao/game/example/endpoint/match/action/DemoCmdForEndPointMatch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.endpoint.match.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * 战斗服的 cmd
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-05-28
27 | */
28 | public interface DemoCmdForEndPointMatch {
29 | /** 模块 - 主 cmd : 11 */
30 | int cmd = DemoModuleCmd.demoModule_11_endpoint_match_cmd;
31 |
32 | /** 示例 匹配 */
33 | int matching = 0;
34 | /** 登录验证 */
35 | int loginVerify = 1;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-endpoint/src/main/java/com/iohao/game/example/endpoint/room/action/DemoCmdForEndPointRoom.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.endpoint.room.action;
19 |
20 |
21 | import com.iohao.game.example.common.DemoModuleCmd;
22 |
23 | /**
24 | * 战斗服的 cmd
25 | *
26 | * @author 渔民小镇
27 | * @date 2022-05-28
28 | */
29 | public interface DemoCmdForEndPointRoom {
30 | /** 模块 - 主 cmd : 10 */
31 | int cmd = DemoModuleCmd.demoModule_10_endpoint_room_cmd;
32 |
33 | /** 示例 统计房间数量 方法 */
34 | int countRoom = 0;
35 | /** 房间内的操作 */
36 | int operation = 1;
37 | }
38 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-external-biz-region/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | example-external-biz-region
14 |
15 |
16 |
17 | com.iohao.example
18 | example-parent
19 | ${project.parent.version}
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-external-biz-region/src/main/java/com/iohao/game/example/external/biz/common/MyExternalBizCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.external.biz.common;
20 |
21 | /**
22 | * @author 渔民小镇
23 | * @date 2024-07-19
24 | */
25 | public interface MyExternalBizCode {
26 | /** 在线玩家 */
27 | int onlineUser = 1;
28 | }
29 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-external-biz-region/src/main/java/com/iohao/game/example/external/biz/common/OnlineUser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.external.biz.common;
20 |
21 | import lombok.Data;
22 |
23 | import java.io.Serializable;
24 | import java.util.ArrayList;
25 | import java.util.List;
26 |
27 | /**
28 | * @author 渔民小镇
29 | * @date 2024-07-19
30 | */
31 | @Data
32 | public class OnlineUser implements Serializable {
33 | List userIds = new ArrayList<>();
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-external-cache/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | example-external-cache
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | example-parent
20 | ${project.parent.version}
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-for-spring/README.md:
--------------------------------------------------------------------------------
1 | ## spring 集成
2 |
3 | https://www.yuque.com/iohao/game/evkgnz
--------------------------------------------------------------------------------
/SimpleExample/example/example-for-spring/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-for-spring
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | example-parent
20 | ${project.parent.version}
21 |
22 |
23 |
24 | org.springframework.boot
25 | spring-boot-starter-web
26 | ${springboot.version}
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-for-spring/src/main/java/com/iohao/game/example/spring/action/DemoCmdForSpring.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.spring.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * spring 演示相关
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-03-23
27 | */
28 | public interface DemoCmdForSpring {
29 | /** 模块 - 主 cmd : 2 */
30 | int cmd = DemoModuleCmd.demoModule_2_spring_cmd;
31 |
32 | /** 示例 here 方法 */
33 | int here = 0;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-for-tcp-socket/README.md:
--------------------------------------------------------------------------------
1 | ## tcp 连接示例
2 |
3 | https://www.yuque.com/iohao/game/ywe7uc
--------------------------------------------------------------------------------
/SimpleExample/example/example-for-tcp-socket/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-for-tcp-socket
14 |
15 |
16 | com.iohao.example
17 | example-parent
18 | ${project.parent.version}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-for-tcp-socket/src/main/java/com/iohao/game/example/one/tcp/other/DemoCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.one.tcp.other;
20 |
21 | import com.iohao.game.example.common.DemoModuleCmd;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2024-11-23
26 | * @since 21.21
27 | */
28 | public interface DemoCmd {
29 | /** 模块 - 主 cmd : 1 */
30 | int cmd = DemoModuleCmd.demoModule_1_cmd;
31 | /** 示例 here 方法 */
32 | int here = 0;
33 | }
--------------------------------------------------------------------------------
/SimpleExample/example/example-hook/README.md:
--------------------------------------------------------------------------------
1 | ## 钩子相关(心跳,用户上线、下线)
2 |
3 | https://www.yuque.com/iohao/game/lxqbnb
--------------------------------------------------------------------------------
/SimpleExample/example/example-hook/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-hook
14 |
15 |
16 |
17 | com.iohao.example
18 | example-parent
19 | ${project.parent.version}
20 |
21 |
22 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-hook/src/main/java/com/iohao/game/example/hook/action/DemoCmdForHookRoom.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.hook.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * 战斗服的 cmd
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-05-28
27 | */
28 | public interface DemoCmdForHookRoom {
29 | /** 模块 - 主 cmd : 10 */
30 | int cmd = DemoModuleCmd.demoModule_12_hook_cmd;
31 |
32 | /** 示例 退出房间 方法 */
33 | int quitRoom = 0;
34 | /** 登录验证 */
35 | int loginVerify = 1;
36 | int hello = 2;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction-same/README.md:
--------------------------------------------------------------------------------
1 | ## 3类通讯方式之请求同类型多个逻辑服通信结果
2 |
3 | https://www.yuque.com/iohao/game/rf9rb9
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction-same/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-interaction-same
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | example-parent
20 | ${project.parent.version}
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction-same/src/main/java/com/iohao/game/example/interaction/same/hall/action/DemoCmdForHall.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.interaction.same.hall.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * 战斗服的 cmd
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-05-22
27 | */
28 | public interface DemoCmdForHall {
29 | /** 模块 - 主 cmd : 8 */
30 | int cmd = DemoModuleCmd.demoModule_8_hall_cmd;
31 |
32 | /** 示例 count 方法 */
33 | int count = 0;
34 | int testCount = 1;
35 | }
36 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction-same/src/main/java/com/iohao/game/example/interaction/same/room/action/DemoCmdForRoom.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.interaction.same.room.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * 战斗服的 cmd
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-05-22
27 | */
28 | public interface DemoCmdForRoom {
29 | /** 模块 - 主 cmd : 9 */
30 | int cmd = DemoModuleCmd.demoModule_9_room_cmd;
31 |
32 | /** 示例 统计房间数量 方法 */
33 | int countRoom = 0;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction/README.md:
--------------------------------------------------------------------------------
1 | ## 3类通讯方式之逻辑服之间的交互
2 |
3 | https://www.yuque.com/iohao/game/anguu6
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-interaction
14 |
15 |
16 |
17 |
18 | com.iohao.example
19 | example-parent
20 | ${project.parent.version}
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction/src/main/java/com/iohao/game/example/interaction/fight/action/DemoCmdForFight.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.interaction.fight.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * 战斗服的 cmd
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-03-24
27 | */
28 | public interface DemoCmdForFight {
29 | /** 模块 - 主 cmd : 3 */
30 | int cmd = DemoModuleCmd.demoModule_3_fight_cmd;
31 |
32 | /** 示例 fight 方法 */
33 | int fight = 0;
34 | int testMatch = 1;
35 | int async = 2;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction/src/main/java/com/iohao/game/example/interaction/msg/DemoWeatherMsg.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.interaction.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * 天气预报响应
27 | *
28 | * @author 渔民小镇
29 | * @date 2022-03-24
30 | */
31 | @ToString
32 | @ProtobufClass
33 | @FieldDefaults(level = AccessLevel.PUBLIC)
34 | public class DemoWeatherMsg {
35 | /** id */
36 | int attack;
37 | }
38 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction/src/main/java/com/iohao/game/example/interaction/msg/MatchMsg.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.interaction.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2022-06-08
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class MatchMsg {
33 | String description;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-interaction/src/main/java/com/iohao/game/example/interaction/weather/action/DemoCmdForWeather.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.interaction.weather.action;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * 天气预报服的 cmd
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-03-24
27 | */
28 | public interface DemoCmdForWeather {
29 |
30 | /** 模块 - 主 cmd : 4 */
31 | int cmd = DemoModuleCmd.demoModule_4_weather_cmd;
32 |
33 | /** 示例 今天天气 方法 */
34 | int todayWeather = 0;
35 | int createRoom = 1;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-parent
14 |
15 |
16 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/CacheCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.common.cmd;
20 |
21 | import com.iohao.game.example.common.DemoModuleCmd;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2024-02-02
26 | */
27 | public interface CacheCmd {
28 | int cmd = DemoModuleCmd.cache_cmd;
29 |
30 | int loginVerify = 0;
31 | int cacheHere = 1;
32 | int cacheCustom = 2;
33 | int cacheList = 3;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/ExternalBizRegionCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.common.cmd;
20 |
21 | import com.iohao.game.example.common.DemoModuleCmd;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2024-07-19
26 | */
27 | public interface ExternalBizRegionCmd {
28 | int cmd = DemoModuleCmd.external_biz_region_cmd;
29 |
30 | int loginVerify = 1;
31 | int listOnlineUser = 2;
32 | int listOnlineUserAll = 3;
33 | }
34 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/JsonCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.cmd;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-11-24
25 | */
26 | public interface JsonCmd {
27 | int cmd = DemoModuleCmd.json_cmd;
28 | int hello = 1;
29 | int jsonMsg = 2;
30 | }
31 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/JsrJakartaCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.cmd;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-10-26
25 | */
26 | public interface JsrJakartaCmd {
27 | int cmd = DemoModuleCmd.jsr_jakarta_17_cmd;
28 |
29 | int jsrJakarta = 1;
30 | int hello = 2;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/JsrJavaxCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.cmd;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-10-28
25 | */
26 | public interface JsrJavaxCmd {
27 | int cmd = DemoModuleCmd.jsr_javax_18_cmd;
28 |
29 | int jsrJavax = 1;
30 | }
31 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/MeterCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.cmd;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-10-02
25 | */
26 | public interface MeterCmd {
27 | int cmd = DemoModuleCmd.meter_cmd;
28 | int here = 1;
29 | }
30 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/cmd/MeterLoginCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.cmd;
19 |
20 | import com.iohao.game.example.common.DemoModuleCmd;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-10-08
25 | */
26 | public interface MeterLoginCmd {
27 | int cmd = DemoModuleCmd.meter_login_cmd;
28 | int login = 1;
29 | }
30 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/DemoBroadcastMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * 广播消息 demo pb
27 | *
28 | * @author 渔民小镇
29 | * @date 2022-05-18
30 | */
31 | @ToString
32 | @ProtobufClass
33 | @FieldDefaults(level = AccessLevel.PUBLIC)
34 | public class DemoBroadcastMessage {
35 | String msg;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/DemoOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.Setter;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2022-05-28
29 | */
30 | @Setter
31 | @ToString
32 | @ProtobufClass
33 | @FieldDefaults(level = AccessLevel.PUBLIC)
34 | public class DemoOperation {
35 | String name;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/HelloReq.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License..
16 | */
17 | package com.iohao.game.example.common.msg;
18 |
19 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
20 | import com.iohao.game.widget.light.protobuf.ProtoFileMerge;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2022-02-24
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | @ProtoFileMerge(fileName = "socket.proto", filePackage = "pb.socket")
33 | public class HelloReq {
34 | String name;
35 | }
36 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/HelloSpringMsg.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.Setter;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2022-05-14
29 | */
30 | @Setter
31 | @ToString
32 | @ProtobufClass
33 | @FieldDefaults(level = AccessLevel.PUBLIC)
34 | public class HelloSpringMsg {
35 | String name;
36 | }
37 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/MatchResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * 匹配响应结果
27 | *
28 | * @author 渔民小镇
29 | * @date 2022-05-28
30 | */
31 | @ToString
32 | @ProtobufClass
33 | @FieldDefaults(level = AccessLevel.PUBLIC)
34 | public class MatchResponse {
35 | /** true 匹配成功 */
36 | boolean matchSuccess;
37 | }
38 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/RoomNumMsg.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.msg;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2022-05-22
28 | */
29 | @ProtobufClass
30 | @ToString
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class RoomNumMsg {
33 | int roomCount;
34 | }
35 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-parent/src/main/java/com/iohao/game/example/common/msg/login/DemoLoginVerify.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.example.common.msg.login;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.Setter;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2022-05-28
29 | */
30 | @Setter
31 | @ToString
32 | @ProtobufClass
33 | @FieldDefaults(level = AccessLevel.PUBLIC)
34 | public class DemoLoginVerify {
35 | /** jwt */
36 | String jwt;
37 | }
38 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-redisson-lock-spring-boot-starter/README.md:
--------------------------------------------------------------------------------
1 | ## 分布式锁
2 |
3 |
4 | https://www.yuque.com/iohao/game/wz7af5
--------------------------------------------------------------------------------
/SimpleExample/example/example-redisson-lock-spring-boot-starter/src/main/java/com/iohao/game/domain/common/lock/ReturnHandle.java:
--------------------------------------------------------------------------------
1 | package com.iohao.game.domain.common.lock;
2 |
3 | /**
4 | * 带返回值的执行接口
5 | *
8 | *
9 | * @author shen
10 | * @date 2022-03-28
11 | * @Slogan 慢慢变好,是给自己最好的礼物
12 | */
13 | public interface VoidHandle {
14 | void execute();
15 | }
16 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-redisson-lock/src/main/java/com/iohao/game/domain/entity/UserWallet.java:
--------------------------------------------------------------------------------
1 | package com.iohao.game.domain.entity;
2 |
3 | import lombok.AccessLevel;
4 | import lombok.Data;
5 | import lombok.EqualsAndHashCode;
6 | import lombok.experimental.Accessors;
7 | import lombok.experimental.FieldDefaults;
8 |
9 | import java.io.Serializable;
10 | import java.math.BigDecimal;
11 |
12 | /**
13 | * 用户钱包
14 | *
15 | * @author shen
16 | * @date 2022-03-28
17 | * @Slogan 慢慢变好,是给自己最好的礼物
18 | */
19 | @Data
20 | @EqualsAndHashCode
21 | @Accessors(chain = true)
22 | @FieldDefaults(level = AccessLevel.PRIVATE)
23 | public class UserWallet implements Serializable {
24 | String userId;
25 | String name;
26 | BigDecimal balance;
27 | }
28 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-redisson-lock/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8098
3 |
4 | spring:
5 | task:
6 | execution:
7 | pool:
8 | max-size: 16
9 | core-size: 8
10 | redis:
11 | redisson:
12 | file: classpath:redisson-config.yml
--------------------------------------------------------------------------------
/SimpleExample/example/example-redisson-lock/src/main/resources/redisson-config.yml:
--------------------------------------------------------------------------------
1 | singleServerConfig:
2 | idleConnectionTimeout: 10000
3 | connectTimeout: 10000
4 | timeout: 3000
5 | retryAttempts: 3
6 | retryInterval: 1500
7 | password: null
8 | subscriptionsPerConnection: 5
9 | clientName: null
10 | address: "redis://127.0.0.1:6379"
11 | subscriptionConnectionMinimumIdleSize: 1
12 | subscriptionConnectionPoolSize: 50
13 | connectionMinimumIdleSize: 32
14 | connectionPoolSize: 64
15 | database: 0
16 | dnsMonitoringInterval: 5000
17 | threads: 0
18 | nettyThreads: 0
19 | codec:
20 | class: "org.redisson.codec.JsonJacksonCodec"
21 | transportMode: "NIO"
--------------------------------------------------------------------------------
/SimpleExample/example/example-wrapper-base-type/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | simpleExample
7 | com.iohao.example
8 | 3.0.0.io
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | example-wrapper-base-type
14 |
15 |
16 |
17 | com.iohao.example
18 | example-parent
19 | ${project.parent.version}
20 |
21 |
22 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-ws-token/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### IntelliJ IDEA ###
7 | .idea/modules.xml
8 | .idea/jarRepositories.xml
9 | .idea/compiler.xml
10 | .idea/libraries/
11 | *.iws
12 | *.iml
13 | *.ipr
14 |
15 | ### Eclipse ###
16 | .apt_generated
17 | .classpath
18 | .factorypath
19 | .project
20 | .settings
21 | .springBeans
22 | .sts4-cache
23 |
24 | ### NetBeans ###
25 | /nbproject/private/
26 | /nbbuild/
27 | /dist/
28 | /nbdist/
29 | /.nb-gradle/
30 | build/
31 | !**/src/main/**/build/
32 | !**/src/test/**/build/
33 |
34 | ### VS Code ###
35 | .vscode/
36 |
37 | ### Mac OS ###
38 | .DS_Store
--------------------------------------------------------------------------------
/SimpleExample/example/example-ws-token/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | simpleExample
9 | 3.0.0.io
10 | ../../pom.xml
11 |
12 |
13 | example-ws-token
14 |
15 |
16 | com.iohao.example
17 | example-parent
18 | ${project.parent.version}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SimpleExample/example/example-ws-token/src/main/java/com/iohao/game/example/ws/verify/action/WsVerifyCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.example.ws.verify.action;
20 |
21 | import com.iohao.game.example.common.DemoModuleCmd;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2023-08-04
26 | */
27 | public interface WsVerifyCmd {
28 | int cmd = DemoModuleCmd.wsVerifyModule_21_cmd;
29 |
30 | int login = 1;
31 | }
32 |
--------------------------------------------------------------------------------
/SpringBootExample/Dockerfile:
--------------------------------------------------------------------------------
1 | # 拉取 jdk 作为基础镜像
2 | FROM openjdk:21-jdk-oracle
3 | # 作者
4 | MAINTAINER 渔民小镇 <262610965@qq.com>
5 | # 添加 jar 到镜像
6 | ADD ./spring-z-one-game/target/spring-z-one-game-1.0-SNAPSHOT.jar .
7 | # 镜像启动后暴露的端口
8 | EXPOSE 10100
9 | # jar运行命令,参数使用逗号隔开
10 | ENTRYPOINT ["java","-jar","spring-z-one-game-1.0-SNAPSHOT.jar"]
--------------------------------------------------------------------------------
/SpringBootExample/docker:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SpringBootExample/docker
--------------------------------------------------------------------------------
/SpringBootExample/spring-client-native-pb/protocol.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | cd /Users/join/gitme/myproject/ioGameExamples/SpringBootExample/spring-client-native-pb
3 | protoc --java_out=src/main/java proto/common.proto
4 | protoc --java_out=src/main/java proto/biz.proto
--------------------------------------------------------------------------------
/SpringBootExample/spring-client-native-pb/src/main/java/com/iohao/game/spring/client/SpringWebsocketNativeProtoClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.client;
19 |
20 | import com.iohao.game.spring.client.command.WebsocketNativeProtoClientKit;
21 | import lombok.extern.slf4j.Slf4j;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2022-08-03
26 | */
27 | @Slf4j
28 | public class SpringWebsocketNativeProtoClient {
29 | public static void main(String[] args) throws Exception {
30 | WebsocketNativeProtoClientKit.runClient();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-client-native-pb/src/main/java/com/iohao/message/MyTempUserInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.message;
19 |
20 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
21 | import lombok.AccessLevel;
22 | import lombok.ToString;
23 | import lombok.experimental.FieldDefaults;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-01-04
28 | */
29 | @ToString
30 | @ProtobufClass
31 | @FieldDefaults(level = AccessLevel.PUBLIC)
32 | public class MyTempUserInfo {
33 | /** id */
34 | long id;
35 |
36 | String name;
37 | }
38 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-client/src/main/java/com/iohao/game/spring/client/Dog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.spring.client;
20 |
21 | import lombok.AccessLevel;
22 | import lombok.Getter;
23 | import lombok.Setter;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2024-04-30
29 | */
30 | @FieldDefaults(level = AccessLevel.PUBLIC)
31 | public class Dog {
32 | int value ;
33 | }
34 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | ioGame-example-springboot
9 | 1.0-SNAPSHOT
10 |
11 |
12 | spring-common-pb
13 |
14 |
15 |
16 | com.iohao.game
17 | light-jprotobuf
18 | ${ioGame.version}
19 |
20 |
21 |
22 |
23 |
24 | jakarta.validation
25 | jakarta.validation-api
26 | ${jakarta.validation-api.version}
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/SpringGameProtoFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.common;
19 |
20 | /**
21 | * @author 渔民小镇
22 | * @date 2022-07-10
23 | */
24 | public interface SpringGameProtoFile {
25 | String COMMON_FILE_NAME = "common.proto";
26 | String COMMON_FILE_PACKAGE = "pb.common";
27 | }
28 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/SpringTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.common;
19 |
20 | import lombok.extern.slf4j.Slf4j;
21 |
22 | /**
23 | * @author 渔民小镇
24 | * @date 2022-08-02
25 | */
26 | @Slf4j
27 | public class SpringTest {
28 | public static void main(String[] args) {
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/Update.java:
--------------------------------------------------------------------------------
1 | package com.iohao.game.spring.common;
2 |
3 | /**
4 | * 更新
5 | *
6 | * @author fangwei
7 | * @date 2022/09/20
8 | */
9 | public interface Update {
10 | }
11 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/cmd/IssuesCmdModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.spring.common.cmd;
20 |
21 | /**
22 | * ioGame issues
23 | *
24 | * @author 渔民小镇
25 | * @date 2023-06-15
26 | */
27 | public interface IssuesCmdModule {
28 | int cmd = SpringCmdModule.issuesCmd;
29 |
30 | int the143 = 1;
31 | int the143Result = 2;
32 | int the147 = 3;
33 | int the186 = 4;
34 | int the338 = 5;
35 | int the338_1 = 6;
36 | }
37 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/cmd/RoomCmdModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.common.cmd;
19 |
20 | /**
21 | * 房间的模块
22 | *
23 | * @author 渔民小镇
24 | * @date 2022-08-12
25 | */
26 | public interface RoomCmdModule {
27 | int cmd = SpringCmdModule.roomCmd;
28 | /** 统计房间的数量 */
29 | int countRoom = 1;
30 | int helloRoom = 2;
31 | }
32 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/cmd/SpringCmdModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.common.cmd;
19 |
20 | /**
21 | * 这里存放所有的模块主 cmd
22 | *
23 | * @author 渔民小镇
24 | * @date 2022-07-09
25 | */
26 | public interface SpringCmdModule {
27 | /** 学校模块 */
28 | int schoolCmd = 1;
29 | /** 班级模块 */
30 | int classesCmd = 2;
31 | /** 大厅模块 */
32 | int hallCmd = 3;
33 | /** 房间的模块 */
34 | int roomCmd = 4;
35 | /** 其他测试 */
36 | int otherSchoolCmd = 5;
37 | int issuesCmd = 6;
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-common-pb/src/main/java/com/iohao/game/spring/common/pb/Vector3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.spring.common.pb;
20 |
21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
22 | import lombok.AccessLevel;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2023-09-04
29 | */
30 | @ToString
31 | @ProtobufClass
32 | @FieldDefaults(level = AccessLevel.PUBLIC)
33 | public class Vector3 {
34 | int x;
35 | int y;
36 | int z;
37 | }
38 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-broker/README.md:
--------------------------------------------------------------------------------
1 | ## 游戏网关(Broker)
2 |
3 | ### 打 jar 包
4 |
5 | #### 1 在 broker pom 中添加下述配置
6 | > 进入 SpringBootExample/spring-game-broker 目录,在 pom.xml 中添加下述配置
7 |
8 | ```xml
9 |
10 |
11 |
14 |
15 | org.springframework.boot
16 | spring-boot-maven-plugin
17 |
18 | com.iohao.game.spring.broker.GameBrokerApplication
19 | JAR
20 |
21 |
22 |
23 |
24 | repackage
25 |
26 |
27 |
28 |
29 |
30 |
31 | ```
32 |
33 | #### 2 打 jar 包
34 | > 使用终端进入 SpringBootExample/spring-game-broker 目录,输入下述命令。
35 | ```shell
36 | mvn package
37 | ```
38 |
39 | 命令执行后,会生成 target/spring-game-broker-1.0-SNAPSHOT.jar
40 |
41 | #### 3 注意事项
42 | 不使用时,将步骤1 中的 pom 注释,否则在打单体包时会有冲突。
43 |
44 | 以上是单独打游戏网关(Broker)的 jar 包步骤
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-broker/src/main/java/com/iohao/game/spring/broker/GameBrokerApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.broker;
19 |
20 | /**
21 | * 单独启动类:游戏网关
22 | *
23 | * @author 渔民小镇
24 | * @date 2022-07-09
25 | */
26 | public class GameBrokerApplication {
27 | public static void main(String[] args) {
28 | // 启动游戏网关
29 | GameBrokerBoot.main(args);
30 | }
31 | }
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-external/README.md:
--------------------------------------------------------------------------------
1 | ## 游戏对外服
2 |
3 | ### 打 jar 包
4 |
5 | #### 1 在 external pom 中添加下述配置
6 | > 进入 SpringBootExample/spring-game-external 目录,在 pom.xml 中添加下述配置
7 |
8 | ```xml
9 |
10 |
11 |
14 |
15 | org.springframework.boot
16 | spring-boot-maven-plugin
17 |
18 | com.iohao.game.spring.external.GameExternalApplication
19 | JAR
20 |
21 |
22 |
23 |
24 | repackage
25 |
26 |
27 |
28 |
29 |
30 |
31 | ```
32 |
33 | #### 2 打 jar 包
34 | > 使用终端进入 SpringBootExample/spring-game-external 目录,输入下述命令。
35 | ```shell
36 | mvn package
37 | ```
38 |
39 | 命令执行后,会生成 target/spring-game-external-1.0-SNAPSHOT.jar
40 |
41 | #### 3 注意事项
42 | 不使用时,将步骤1 中的 pom 注释,否则在打单体包时会有冲突。
43 |
44 | 以上是单独打游戏对外服的 jar 包步骤
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-external/src/main/java/com/iohao/game/spring/external/GameExternalApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.external;
19 |
20 | /**
21 | * 单独启动类:游戏对外服
22 | *
23 | * @author 渔民小镇
24 | * @date 2022-07-09
25 | */
26 | public class GameExternalApplication {
27 | public static void main(String[] args) {
28 | // 启动游戏对外服
29 | GameExternal.main(args);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-logic-classes/src/main/java/com/iohao/game/spring/logic/classes/service/ClassesService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.logic.classes.service;
19 |
20 | import lombok.extern.slf4j.Slf4j;
21 | import org.springframework.stereotype.Service;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2022-07-10
26 | */
27 | @Slf4j
28 | @Service
29 | public class ClassesService {
30 | public void helloSpring() {
31 | log.info("hello spring Classes");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-logic-hall/src/main/java/com/iohao/game/spring/logic/hall/GameLogicHallClientApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.logic.hall;
19 |
20 | import com.iohao.game.bolt.broker.client.BrokerClientApplication;
21 |
22 | /**
23 | * 大厅游戏逻辑服启动类
24 | *
25 | * @author 渔民小镇
26 | * @date 2022-07-30
27 | */
28 | public class GameLogicHallClientApplication {
29 | public static void main(String[] args) {
30 | GameLogicHallLogic gameLogicHallLogic = new GameLogicHallLogic();
31 | BrokerClientApplication.start(gameLogicHallLogic);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-logic-room-interaction-same/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.example
8 | ioGame-example-springboot
9 | 1.0-SNAPSHOT
10 |
11 |
12 | spring-game-logic-room-interaction-same
13 |
14 |
15 |
16 | com.iohao.example
17 | spring-game-logic-common
18 | ${project.parent.version}
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-logic-school/src/main/java/com/iohao/game/spring/logic/school/annotation/IgnoreDebugInout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.game.spring.logic.school.annotation;
20 |
21 | import java.lang.annotation.*;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2023-07-20
26 | */
27 | @Target({ElementType.METHOD})
28 | @Retention(RetentionPolicy.RUNTIME)
29 | @Documented
30 | public @interface IgnoreDebugInout {
31 | }
--------------------------------------------------------------------------------
/SpringBootExample/spring-game-logic-school/src/main/java/com/iohao/game/spring/logic/school/service/SchoolService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * # iohao.com . 渔民小镇
3 | * Copyright (C) 2021 - present double joker (262610965@qq.com) . All Rights Reserved.
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.iohao.game.spring.logic.school.service;
19 |
20 | import lombok.extern.slf4j.Slf4j;
21 | import org.springframework.stereotype.Service;
22 |
23 | /**
24 | * @author 渔民小镇
25 | * @date 2022-07-10
26 | */
27 | @Slf4j
28 | @Service
29 | public class SchoolService {
30 | public void helloSpring() {
31 | log.info("hello spring School");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/fxglSimpleGame/.gitignore:
--------------------------------------------------------------------------------
1 | ### other dir ###
2 | classes/
3 | .temp/
4 | logs/
5 | log/
6 | .svn/
7 | svn/
8 | lib/
9 | .act.*
10 | system/
11 |
12 | HELP.md
13 | !**/src/main/**
14 | !**/src/test/**
15 |
16 | *.class
17 |
18 | ### jreble config ###
19 | rebel.xml
20 |
21 | ### Package Files ###
22 | *.jar
23 | *.war
24 | *.ear
25 | *.zip
26 |
27 | # tcp 与前端通讯的 api
28 | tcp-api/
29 |
30 | # gradle #
31 | build/
32 | .gradle/
33 | out/
34 |
35 | ### maven ###
36 | target/
37 | !.mvn/wrapper/maven-wrapper.jar
38 | .mvn
39 | mvnw
40 | mvnw.cmd
41 | ### intellj file type ###
42 | bin/
43 | .idea
44 | *.iws
45 | *.iml
46 | *.ipr
47 |
48 | ### NetBeans ###
49 | /nbproject/private/
50 | /nbbuild/
51 | /dist/
52 | /nbdist/
53 | /.nb-gradle/
54 |
55 | ### VS Code ###
56 | .vscode/
57 |
58 | ### STS ###
59 | .apt_generated
60 | .factorypath
61 | .settings
62 | .springBeans
63 | .sts4-cache
64 |
65 | ### eclipse file type ###
66 | .settings/
67 | .classpath
68 | .project
69 |
70 | ### ---- Mac OS X ###
71 | .DS_Store
72 | Icon?
73 |
74 | ### ---- Windows ###
75 |
76 | ### Windows image file caches ###
77 | Thumbs.db
78 |
79 | ### Folder integration file ###
80 | Desktop.ini
81 |
82 | ### ---- Javadoc ###
83 | docs.tar
84 |
85 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
86 | hs_err_pid*
87 | /target/
88 |
89 | doc_game.txt
--------------------------------------------------------------------------------
/fxglSimpleGame/README.md:
--------------------------------------------------------------------------------
1 | ## 简介
2 |
3 | FXGL + ioGame 网络游戏中的多人移动演示
4 |
5 | [文档地址](https://www.yuque.com/iohao/game/bolt)
6 |
7 |
8 |
9 | ## 启动
10 |
11 | 1. GameServerApplication 先启动服务器
12 | 2. GameApp 启动游戏界面 1
13 | 3. GameApp2 启动游戏界面 2
14 |
15 |
16 |
17 | 加入房间后,按键 WASD 可移动自己。
18 |
19 |
20 | ## 游戏界面预览
21 |
22 |
23 | 
--------------------------------------------------------------------------------
/fxglSimpleGame/common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.iohao.demo
8 | fxglNetGameSimple
9 | 1.0-SNAPSHOT
10 |
11 |
12 | common
13 |
14 |
15 | 21
16 | 21
17 | UTF-8
18 |
19 |
20 |
--------------------------------------------------------------------------------
/fxglSimpleGame/common/src/main/java/com/iohao/demo/game/common/MyCmd.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - 2023 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.demo.game.common;
20 |
21 | /**
22 | * @author 渔民小镇
23 | * @date 2023-11-23
24 | */
25 | public interface MyCmd {
26 | /** 主路由 */
27 | int cmd = 1;
28 | int login = 0;
29 |
30 | int enterRoom = 1;
31 | int quitRoom = 2;
32 |
33 | /** 子路由 here */
34 | int move = 4;
35 | int print = 30;
36 | }
37 |
--------------------------------------------------------------------------------
/fxglSimpleGame/common/src/main/java/com/iohao/demo/game/common/PlayerInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - 2023 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.demo.game.common;
20 |
21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
22 | import lombok.AccessLevel;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2023-11-24
29 | */
30 | @ToString
31 | @ProtobufClass
32 | @FieldDefaults(level = AccessLevel.PUBLIC)
33 | public class PlayerInfo {
34 | /** id */
35 | long userId;
36 | String name;
37 | double x;
38 | double y;
39 | }
40 |
--------------------------------------------------------------------------------
/fxglSimpleGame/common/src/main/java/com/iohao/demo/game/common/PlayerMove.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - 2023 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.demo.game.common;
20 |
21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
22 | import lombok.AccessLevel;
23 | import lombok.ToString;
24 | import lombok.experimental.FieldDefaults;
25 |
26 | /**
27 | * @author 渔民小镇
28 | * @date 2023-11-23
29 | */
30 | @ToString
31 | @ProtobufClass
32 | @FieldDefaults(level = AccessLevel.PUBLIC)
33 | public class PlayerMove {
34 | long playerId;
35 | int dir;
36 | double x;
37 | double y;
38 | }
39 |
--------------------------------------------------------------------------------
/fxglSimpleGame/game-fxgl/src/main/resources/assets/music/bgm.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/fxglSimpleGame/game-fxgl/src/main/resources/assets/music/bgm.mp3
--------------------------------------------------------------------------------
/fxglSimpleGame/game-fxgl/src/main/resources/assets/sounds/lose_life.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/fxglSimpleGame/game-fxgl/src/main/resources/assets/sounds/lose_life.wav
--------------------------------------------------------------------------------
/fxglSimpleGame/game-fxgl/src/main/resources/assets/sounds/shoot2.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/fxglSimpleGame/game-fxgl/src/main/resources/assets/sounds/shoot2.wav
--------------------------------------------------------------------------------
/fxglSimpleGame/game-fxgl/src/main/resources/assets/ui/demo_ui.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/fxglSimpleGame/img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/fxglSimpleGame/img.png
--------------------------------------------------------------------------------
/ioGameWeb2Game/.gitignore:
--------------------------------------------------------------------------------
1 | ### other dir ###
2 | classes/
3 | .temp/
4 | logs/
5 | log/
6 | .svn/
7 | svn/
8 | example/lib/
9 | .act.*
10 | system/
11 |
12 | HELP.md
13 | !**/src/main/**
14 | !**/src/test/**
15 |
16 | *.class
17 |
18 | ### jreble config ###
19 | rebel.xml
20 |
21 | ### Package Files ###
22 | *.jar
23 | *.war
24 | *.ear
25 | *.zip
26 |
27 | # tcp 与前端通讯的 api
28 | tcp-api/
29 |
30 | # gradle #
31 | build/
32 | .gradle/
33 | out/
34 |
35 | ### maven ###
36 | target/
37 | !.mvn/wrapper/maven-wrapper.jar
38 | .mvn
39 | mvnw
40 | mvnw.cmd
41 | ### intellj file type ###
42 | bin/
43 | .idea
44 | *.iws
45 | *.iml
46 | *.ipr
47 |
48 | ### NetBeans ###
49 | /nbproject/private/
50 | /nbbuild/
51 | /dist/
52 | /nbdist/
53 | /.nb-gradle/
54 |
55 | ### VS Code ###
56 | .vscode/
57 |
58 | ### STS ###
59 | .apt_generated
60 | .factorypath
61 | .settings
62 | .springBeans
63 | .sts4-cache
64 |
65 | ### eclipse file type ###
66 | .settings/
67 | .classpath
68 | .project
69 |
70 | ### ---- Mac OS X ###
71 | .DS_Store
72 | Icon?
73 |
74 | ### ---- Windows ###
75 |
76 | ### Windows image file caches ###
77 | Thumbs.db
78 |
79 | ### Folder integration file ###
80 | Desktop.ini
81 |
82 | ### ---- Javadoc ###
83 | docs.tar
84 |
85 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
86 | hs_err_pid*
87 | /target/
88 |
89 | doc_game.txt
--------------------------------------------------------------------------------
/ioGameWeb2Game/README.md:
--------------------------------------------------------------------------------
1 | **web 转游戏 - 示例理解篇 - 文档**
2 |
3 | https://www.yuque.com/iohao/game/gpzmc8vadn4vl70z
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/ioGameWeb2Game/src/main/java/com/iohao/web2game/IoGameWeb2GameApplication.java:
--------------------------------------------------------------------------------
1 | package com.iohao.web2game;
2 |
3 | import com.iohao.game.action.skeleton.ext.spring.ActionFactoryBeanForSpring;
4 | import com.iohao.game.external.core.netty.simple.NettySimpleHelper;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.context.annotation.Bean;
8 |
9 | import java.util.List;
10 |
11 |
12 | // Generated by https://start.springboot.io
13 | @SpringBootApplication
14 | public class IoGameWeb2GameApplication {
15 | public static void main(String[] args) {
16 | SpringApplication.run(IoGameWeb2GameApplication.class, args);
17 |
18 | // 启动游戏服务器
19 | int port = 10100;
20 | NettySimpleHelper.run(port, List.of(new HelloLogicServer()));
21 | }
22 |
23 | @Bean
24 | public ActionFactoryBeanForSpring actionFactoryBean() {
25 | // 将业务框架交给 spring 管理
26 | return ActionFactoryBeanForSpring.me();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ioGameWeb2Game/src/main/java/com/iohao/web2game/action/UserService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - present 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.web2game.action;
20 |
21 | import org.springframework.stereotype.Service;
22 |
23 | import java.util.concurrent.atomic.AtomicInteger;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2025-01-21
28 | * @since 21.24
29 | */
30 | @Service
31 | public final class UserService {
32 | AtomicInteger atomicInteger = new AtomicInteger(0);
33 |
34 | public int incrementId() {
35 | return atomicInteger.getAndIncrement();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ioGameWeb2Game/src/main/java/com/iohao/web2game/client/HelloClient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ioGame
3 | * Copyright (C) 2021 - 2023 渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
4 | * # iohao.com . 渔民小镇
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU Affero General Public License as
8 | * published by the Free Software Foundation, either version 3 of the
9 | * License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Affero General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Affero General Public License
17 | * along with this program. If not, see .
18 | */
19 | package com.iohao.web2game.client;
20 |
21 | import com.iohao.game.external.client.join.ClientRunOne;
22 |
23 | import java.util.List;
24 |
25 | /**
26 | * @author 渔民小镇
27 | * @date 2023-08-21
28 | */
29 | public class HelloClient {
30 | public static void main(String[] args) {
31 | // 启动模拟客户端
32 | new ClientRunOne()
33 | .setInputCommandRegions(List.of(new HelloInputCommandRegion()))
34 | .startup();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ioGameWeb2Game/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------