├── .gitignore ├── LICENSE ├── README.md ├── SdkExample ├── .gitignore ├── README.md ├── README_CN.md ├── doc │ ├── CsHello1.png │ ├── CsHello2.png │ ├── CsLoginVerify1.png │ ├── CsLoginVerify2.png │ ├── GodotCsproj.png │ ├── ImportProtbuf.png │ ├── ImportSdk.png │ ├── MyAction.png │ ├── TsHello1.png │ ├── TsHello2.png │ ├── TsListen.png │ ├── TsListenList.png │ ├── TsLoginVerify1.png │ ├── TsLoginVerify2.png │ ├── UnityPlugins.png │ ├── actions.png │ └── server.png ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ └── example │ │ │ └── sdk │ │ │ ├── GenerateTest.java │ │ │ ├── SdkApplication.java │ │ │ └── logic │ │ │ ├── SdkLogicServer.java │ │ │ ├── action │ │ │ ├── MyAction.java │ │ │ ├── SdkAction.java │ │ │ └── SdkCmd.java │ │ │ └── data │ │ │ ├── AnimalEnum.java │ │ │ ├── BulletMessage.java │ │ │ ├── CarEnum.java │ │ │ ├── LoginVerifyMessage.java │ │ │ ├── SdkGameCodeEnum.java │ │ │ ├── SdkProtoFile.java │ │ │ └── UserMessage.java │ └── resources │ │ └── logback.xml │ └── test │ └── java │ └── com │ └── iohao │ └── example │ └── sdk │ └── MyClient.java ├── SimpleExample ├── LICENSE ├── README.md ├── component │ ├── README.md │ ├── chat-core │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── component │ │ │ └── chat │ │ │ ├── ChatLogicServer.java │ │ │ ├── action │ │ │ └── ChatAction.java │ │ │ └── room │ │ │ └── c2c │ │ │ ├── DefaultUserChatRoom.java │ │ │ ├── UserChatRoom.java │ │ │ └── UserChatRooms.java │ ├── chat-provide │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── component │ │ │ └── chat │ │ │ ├── client │ │ │ ├── ChatInputCommandRegion.java │ │ │ └── ClientChatKit.java │ │ │ ├── cmd │ │ │ ├── ChatCmd.java │ │ │ └── ChatFileMerge.java │ │ │ └── proto │ │ │ ├── ChatChannelMessage.java │ │ │ ├── ChatMessage.java │ │ │ ├── ChatMessageItem.java │ │ │ ├── ChatMessageTypeEnum.java │ │ │ ├── ChatNotifyMessage.java │ │ │ └── ChatSendMessage.java │ ├── login-core │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── component │ │ │ └── login │ │ │ ├── LoginLogicServer.java │ │ │ └── action │ │ │ ├── PressureAction.java │ │ │ └── TheLoginAction.java │ ├── login-provide │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── component │ │ │ └── login │ │ │ ├── client │ │ │ └── LoginInputCommandRegion.java │ │ │ ├── cmd │ │ │ └── LoginCmd.java │ │ │ └── proto │ │ │ ├── LoginVerify.java │ │ │ └── UserInfo.java │ └── z-client │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── component │ │ │ ├── ComponentApplication.java │ │ │ └── client │ │ │ ├── MyClient1.java │ │ │ ├── MyClient2.java │ │ │ ├── MyClientCommon.java │ │ │ └── PressureClient.java │ │ └── resources │ │ └── logback.xml ├── doc_maven.txt ├── example-exchange │ ├── README.md │ ├── exchange-client │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── exchange │ │ │ └── client │ │ │ └── ExchangeClient.java │ ├── exchange-common │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── exchange │ │ │ │ └── common │ │ │ │ ├── ExchangeAttachment.java │ │ │ │ └── ExchangeCmd.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── exchange-game-logic │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── exchange │ │ │ └── logic │ │ │ ├── ExchangeAction.java │ │ │ ├── ExchangeGameApplication.java │ │ │ └── ExchangeGameLogicServer.java │ └── exchange-web-gm │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── exchange │ │ └── web │ │ ├── GameManagerApplication.java │ │ ├── GameManagerController.java │ │ ├── GameManagerLogicServer.java │ │ ├── OtherController.java │ │ └── kit │ │ ├── MyKit.java │ │ └── UserFlowContext.java ├── example-game-collect │ ├── README.md │ ├── fxgl-tank │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── tank │ │ │ │ ├── Config.java │ │ │ │ ├── GameEntityFactory.java │ │ │ │ ├── GameType.java │ │ │ │ ├── TankApp.java │ │ │ │ ├── component │ │ │ │ ├── Dir.java │ │ │ │ ├── EnemyViewComponent.java │ │ │ │ └── PlayerViewComponent.java │ │ │ │ ├── net │ │ │ │ ├── TankNet.java │ │ │ │ └── cmd │ │ │ │ │ ├── HallCmd.java │ │ │ │ │ └── TankCmd.java │ │ │ │ └── ui │ │ │ │ ├── GameLoadingScene.java │ │ │ │ └── GameMenu.java │ │ │ └── resources │ │ │ ├── assets │ │ │ ├── sounds │ │ │ │ ├── e_fire.mp3 │ │ │ │ ├── mainMenuHover.wav │ │ │ │ ├── normalBomb.wav │ │ │ │ ├── normalFire.wav │ │ │ │ ├── select.wav │ │ │ │ ├── start.wav │ │ │ │ └── tank_move.wav │ │ │ ├── textures │ │ │ │ ├── H1_ship.png │ │ │ │ ├── bullet │ │ │ │ │ ├── normal.png │ │ │ │ │ └── plus.png │ │ │ │ ├── helmet_used.png │ │ │ │ ├── icon.png │ │ │ │ ├── loadingBg.png │ │ │ │ ├── logo.png │ │ │ │ └── tank │ │ │ │ │ ├── H1U.png │ │ │ │ │ ├── H2U.png │ │ │ │ │ ├── bomb_rocket_1.png │ │ │ │ │ ├── bomb_rocket_2.png │ │ │ │ │ ├── bomb_rocket_3.png │ │ │ │ │ ├── bomb_rocket_4.png │ │ │ │ │ ├── bomb_rocket_5.png │ │ │ │ │ ├── bomb_rocket_6.png │ │ │ │ │ ├── bomb_rocket_7.png │ │ │ │ │ ├── bomb_rocket_8.png │ │ │ │ │ ├── bomb_rocket_9.png │ │ │ │ │ └── spawnTank.png │ │ │ └── ui │ │ │ │ └── fonts │ │ │ │ └── airstrikeacad.ttf │ │ │ └── logback.xml │ ├── game-common-proto │ │ ├── pom.xml │ │ ├── proto.sh │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── collect │ │ │ └── proto │ │ │ ├── GameProtoFile.java │ │ │ ├── GenerateFileForProto.java │ │ │ ├── common │ │ │ ├── BarHelloPb.java │ │ │ ├── LoginVerify.java │ │ │ └── UserInfo.java │ │ │ └── tank │ │ │ ├── TankBroadcastMessage.java │ │ │ ├── TankBullet.java │ │ │ ├── TankEnterRoom.java │ │ │ ├── TankLocation.java │ │ │ ├── TankPlayer.java │ │ │ ├── TankRoomBroadcastRes.java │ │ │ └── TheHelloMessage.java │ ├── game-common │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── collect │ │ │ └── common │ │ │ ├── FrameKit.java │ │ │ ├── GameBarSkeletonConfig.java │ │ │ ├── GameCodeEnum.java │ │ │ ├── GameConfig.java │ │ │ ├── HallCmd.java │ │ │ └── ModuleKeyCont.java │ ├── game-external │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── collect │ │ │ │ └── external │ │ │ │ └── GameExternalBoot.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── game-logic-hall │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── collect │ │ │ └── hall │ │ │ ├── HallClientStartup.java │ │ │ └── action │ │ │ └── TankLoginAction.java │ ├── game-logic-tank │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── collect │ │ │ │ └── tank │ │ │ │ ├── TankClientStartup.java │ │ │ │ ├── TankCmd.java │ │ │ │ ├── action │ │ │ │ └── TankAction.java │ │ │ │ ├── config │ │ │ │ ├── BulletId.java │ │ │ │ ├── TankBootItemConfig.java │ │ │ │ └── TankKit.java │ │ │ │ ├── mapstruct │ │ │ │ ├── TankMapstruct.java │ │ │ │ └── package-info.java │ │ │ │ └── room │ │ │ │ ├── TankPlayerEntity.java │ │ │ │ ├── TankRoomEntity.java │ │ │ │ └── TankRoomService.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── collect │ │ │ └── tank │ │ │ └── mapstruct │ │ │ └── TankMapstructTest.java │ └── game-one │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── collect │ │ │ └── one │ │ │ ├── GameOne.java │ │ │ └── TestGenerate.java │ │ └── resources │ │ ├── logback.txt │ │ └── logback.xml ├── example-multiple-eventbus │ ├── the-eventbus-analyse-data │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── eventbus │ │ │ └── analyse │ │ │ ├── AnalyseEventBusSubscriber.java │ │ │ └── AnalyseLogicStartup.java │ ├── the-eventbus-broker │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── eventbus │ │ │ └── broker │ │ │ └── EventbusBrokerServer.java │ ├── the-eventbus-client │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── eventbus │ │ │ └── client │ │ │ └── EventbusOneClient.java │ ├── the-eventbus-common-data │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── multiple │ │ │ │ └── eventbus │ │ │ │ └── common │ │ │ │ ├── EmailCmd.java │ │ │ │ ├── TheBusLogin.java │ │ │ │ ├── TheBusUserInfo.java │ │ │ │ ├── UserCmd.java │ │ │ │ ├── bar │ │ │ │ └── BarSkeletonKit.java │ │ │ │ └── event │ │ │ │ ├── ActionStatEventMessage.java │ │ │ │ ├── ActionStatEventMessageRegion.java │ │ │ │ ├── EmailAnyMessage.java │ │ │ │ ├── EmailMethodEventMessage.java │ │ │ │ ├── EmailOrderEventMessage.java │ │ │ │ ├── EmailSimpleEventMessage.java │ │ │ │ ├── EmptyEventMessage.java │ │ │ │ ├── HotMessage.java │ │ │ │ └── UserLoginEventMessage.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── the-eventbus-external │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── eventbus │ │ │ └── external │ │ │ └── EventbusExternalServer.java │ ├── the-eventbus-logic-email │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── eventbus │ │ │ └── email │ │ │ ├── EmailAction.java │ │ │ ├── EmailAnyApp1.java │ │ │ ├── EmailAnyApp2.java │ │ │ ├── EmailLogicStartup.java │ │ │ └── subscriber │ │ │ ├── EmailAnyEventBusSubscriber.java │ │ │ ├── EmailEventBusSubscriber.java │ │ │ └── EmailOrderEventBusSubscriber.java │ ├── the-eventbus-logic-user │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── multiple │ │ │ │ └── eventbus │ │ │ │ └── user │ │ │ │ ├── UserAction.java │ │ │ │ ├── UserEventBusSubscriber.java │ │ │ │ └── UserLogicStartup.java │ │ │ └── test │ │ │ └── resources │ │ │ └── logback.xml │ └── the-eventbus-one-application │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── example │ │ └── multiple │ │ └── eventbus │ │ └── EventbusOneApplication.java ├── example-multiple │ ├── README.md │ ├── the-client │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── client │ │ │ └── MyOneClient.java │ ├── the-common-broker │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── broker │ │ │ └── MyBrokerServer.java │ ├── the-common-data │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── multiple │ │ │ │ └── common │ │ │ │ ├── cmd │ │ │ │ ├── CmdModule.java │ │ │ │ └── internal │ │ │ │ │ └── WeatherCmd.java │ │ │ │ └── data │ │ │ │ ├── TheLogin.java │ │ │ │ ├── TheUserInfo.java │ │ │ │ └── Weather.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── the-common-external │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── external │ │ │ └── MyExternalServer.java │ ├── the-one-application │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── multiple │ │ │ └── one │ │ │ └── MyOneApplication.java │ └── the-weather-game-logic │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── example │ │ └── multiple │ │ └── weather │ │ ├── WeatherAction.java │ │ ├── WeatherLogicStartup.java │ │ ├── WeatherLogicStartupApplication.java │ │ └── WeatherLoginAction.java ├── example │ ├── README.md │ ├── example-broadcast │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── broadcast │ │ │ ├── DemoBroadcastApplication.java │ │ │ ├── DemoBroadcastClient.java │ │ │ ├── DemoBroadcastServer.java │ │ │ ├── action │ │ │ ├── BroadcastMessageAction.java │ │ │ ├── DemoBroadcastCmd.java │ │ │ └── RangeBroadcastAction.java │ │ │ └── sniper │ │ │ └── SniperBroadcastApplication.java │ ├── example-cluster-run-one │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── cluster │ │ │ │ └── one │ │ │ │ ├── DemoClusterApplication.java │ │ │ │ ├── DemoClusterClient.java │ │ │ │ ├── action │ │ │ │ ├── DemoClusterAction.java │ │ │ │ └── DemoClusterCmd.java │ │ │ │ └── server │ │ │ │ └── DemoClusterLogicServer.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── cluster │ │ │ └── one │ │ │ ├── DemoClusterConfig.java │ │ │ ├── DemoClusterExternal.java │ │ │ ├── DemoClusterGate10200.java │ │ │ ├── DemoClusterGate10201.java │ │ │ ├── DemoClusterGate10202.java │ │ │ ├── DemoClusterLogic.java │ │ │ ├── examples │ │ │ ├── ClusterJoinExamples.java │ │ │ ├── ClusterJoinNamespacesExamples.java │ │ │ ├── CustomMetadataEncodingExample.java │ │ │ ├── GossipExample.java │ │ │ ├── MembershipEventsExample.java │ │ │ ├── MessagingExample.java │ │ │ └── WebsocketMessagingExample.java │ │ │ └── temp │ │ │ ├── DemoCluster30056.java │ │ │ ├── DemoCluster30057.java │ │ │ ├── DemoCluster30058.java │ │ │ └── DemoClusterKit.java │ ├── example-codec-json │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── example │ │ │ │ └── json │ │ │ │ └── app │ │ │ │ ├── JsonAction.java │ │ │ │ ├── JsonApplication.java │ │ │ │ ├── JsonClient.java │ │ │ │ ├── JsonLogicServer.java │ │ │ │ └── JsonMsg.java │ │ │ └── resources │ │ │ └── static │ │ │ ├── assets │ │ │ ├── jquery-1.11.3.min.js │ │ │ └── websocket.js │ │ │ └── index.html │ ├── example-endpoint │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── endpoint │ │ │ ├── DemoEndPointApplication.java │ │ │ ├── DemoForEndPointClient.java │ │ │ ├── animal │ │ │ ├── AnimalLogicServer.java │ │ │ └── action │ │ │ │ ├── AnimalAction.java │ │ │ │ └── DemoCmdForEndPointAnimal.java │ │ │ ├── match │ │ │ ├── DemoEndPointMatchServer.java │ │ │ └── action │ │ │ │ ├── DemoCmdForEndPointMatch.java │ │ │ │ └── DemoMatchAction.java │ │ │ └── room │ │ │ ├── DemoEndPointRoomServer.java │ │ │ └── action │ │ │ ├── DemoCmdForEndPointRoom.java │ │ │ └── DemoEndPointRoomAction.java │ ├── example-external-biz-region │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── external │ │ │ └── biz │ │ │ ├── ExternalBizRegionAction.java │ │ │ ├── ExternalBizRegionApplication.java │ │ │ ├── ExternalBizRegionClient.java │ │ │ ├── ExternalBizRegionLogicServer.java │ │ │ └── common │ │ │ ├── MyExternalBizCode.java │ │ │ ├── OnlineUser.java │ │ │ └── OnlineUserExternalBizRegion.java │ ├── example-external-cache │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── external │ │ │ └── cache │ │ │ ├── CacheAction.java │ │ │ ├── CacheApplication.java │ │ │ ├── CacheLogicServer.java │ │ │ └── client │ │ │ ├── CacheInputCommandRegion.java │ │ │ ├── TcpClient.java │ │ │ └── WsClient.java │ ├── example-for-spring │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── spring │ │ │ ├── DemoForSpringClient.java │ │ │ ├── DemoSpringApplication.java │ │ │ ├── DemoSpringLogicServer.java │ │ │ └── action │ │ │ ├── DemoCmdForSpring.java │ │ │ ├── DemoSpringAction.java │ │ │ └── DemoSpringService.java │ ├── example-for-tcp-socket │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── one │ │ │ │ └── tcp │ │ │ │ ├── DemoTcpSocketApplication.java │ │ │ │ ├── DemoTcpSocketClient.java │ │ │ │ └── other │ │ │ │ ├── DemoAction.java │ │ │ │ ├── DemoCmd.java │ │ │ │ ├── DemoLogicServer.java │ │ │ │ └── TestExternalCodec.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── example-hook │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── hook │ │ │ ├── DemoHookApplication.java │ │ │ ├── DemoHookClient.java │ │ │ ├── action │ │ │ ├── DemoCmdForHookRoom.java │ │ │ └── DemoHookRoomAction.java │ │ │ ├── custom │ │ │ ├── DemoIdleHook.java │ │ │ └── DemoUserHook.java │ │ │ └── server │ │ │ └── DemoHookRoomServer.java │ ├── example-interaction-same │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── interaction │ │ │ │ └── same │ │ │ │ ├── DemoInteractionSameApplication.java │ │ │ │ ├── DemoInteractionSameClient.java │ │ │ │ ├── InteractionSameKit.java │ │ │ │ ├── hall │ │ │ │ ├── DemoSameHallLogicServer.java │ │ │ │ └── action │ │ │ │ │ ├── DemoCmdForHall.java │ │ │ │ │ ├── DemoHallAction.java │ │ │ │ │ └── FlowContextExample.java │ │ │ │ └── room │ │ │ │ ├── DemoSameRoomLogicServer.java │ │ │ │ └── action │ │ │ │ ├── DemoCmdForRoom.java │ │ │ │ └── DemoRoomAction.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── interaction │ │ │ └── same │ │ │ └── DemoClusterInteractionSameApplication.java │ ├── example-interaction │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── interaction │ │ │ ├── DemoInteractionApplication.java │ │ │ ├── DemoInteractionClient.java │ │ │ ├── fight │ │ │ ├── DemoFightLogicServer.java │ │ │ └── action │ │ │ │ ├── DemoCmdForFight.java │ │ │ │ └── DemoFightAction.java │ │ │ ├── msg │ │ │ ├── DemoFightMsg.java │ │ │ ├── DemoWeatherMsg.java │ │ │ └── MatchMsg.java │ │ │ ├── part │ │ │ ├── DemoInteractionBroker.java │ │ │ ├── DemoInteractionExternalClient.java │ │ │ ├── DemoInteractionFightClient.java │ │ │ └── DemoInteractionWeatherClient.java │ │ │ └── weather │ │ │ ├── DemoWeatherLogicServer.java │ │ │ └── action │ │ │ ├── DemoCmdForWeather.java │ │ │ └── DemoWeatherAction.java │ ├── example-jsr-jakarta │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── example │ │ │ └── jsr │ │ │ └── jakarta │ │ │ ├── DebugActionAfter.java │ │ │ ├── JsrJakartaApplication.java │ │ │ ├── JsrJakartaClient.java │ │ │ ├── action │ │ │ └── JsrJakartaAction.java │ │ │ ├── pb │ │ │ └── JsrJakartaPb.java │ │ │ └── server │ │ │ └── JsrJakartaLogicServer.java │ ├── example-jsr-javax │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── example │ │ │ └── jsr │ │ │ └── javax │ │ │ ├── JsrJavaxApplication.java │ │ │ ├── JsrJavaxClient.java │ │ │ ├── action │ │ │ └── JsrJavaxAction.java │ │ │ ├── pb │ │ │ └── JsrJavaxPb.java │ │ │ └── server │ │ │ └── JsrJavaxLogicServer.java │ ├── example-parent │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ └── example │ │ │ │ └── common │ │ │ │ ├── DemoLogicServerModuleId.java │ │ │ │ ├── DemoModuleCmd.java │ │ │ │ ├── cmd │ │ │ │ ├── CacheCmd.java │ │ │ │ ├── ExternalBizRegionCmd.java │ │ │ │ ├── JsonCmd.java │ │ │ │ ├── JsrJakartaCmd.java │ │ │ │ ├── JsrJavaxCmd.java │ │ │ │ ├── MeterCmd.java │ │ │ │ └── MeterLoginCmd.java │ │ │ │ └── msg │ │ │ │ ├── DemoAttachment.java │ │ │ │ ├── DemoBroadcastMessage.java │ │ │ │ ├── DemoOperation.java │ │ │ │ ├── HelloReq.java │ │ │ │ ├── HelloSpringMsg.java │ │ │ │ ├── MatchResponse.java │ │ │ │ ├── RoomNumMsg.java │ │ │ │ └── login │ │ │ │ ├── DemoLoginVerify.java │ │ │ │ └── DemoUserInfo.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── example-redisson-lock-spring-boot-starter │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ ├── domain │ │ │ │ ├── common │ │ │ │ │ └── lock │ │ │ │ │ │ ├── ReturnHandle.java │ │ │ │ │ │ └── VoidHandle.java │ │ │ │ └── config │ │ │ │ │ ├── DistibutedLockProperties.java │ │ │ │ │ ├── DistributedLockAutoConfiguration.java │ │ │ │ │ └── RedissonConfig.java │ │ │ │ └── service │ │ │ │ ├── DefaultRedissonDistributedLock.java │ │ │ │ └── DistributedLock.java │ │ │ └── resource │ │ │ └── META-INF │ │ │ └── spring.factories │ ├── example-redisson-lock │ │ ├── README.md │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── iohao │ │ │ │ └── game │ │ │ │ ├── RedissonExampleApplication.java │ │ │ │ ├── api │ │ │ │ ├── Consumer.java │ │ │ │ └── SpringMultiThreadDistributeLock.java │ │ │ │ ├── domain │ │ │ │ ├── common │ │ │ │ │ └── lock │ │ │ │ │ │ ├── ReturnHandle.java │ │ │ │ │ │ └── VoidHandle.java │ │ │ │ ├── config │ │ │ │ │ └── RedissonConfig.java │ │ │ │ └── entity │ │ │ │ │ └── UserWallet.java │ │ │ │ └── service │ │ │ │ ├── DefaultRedissonDistributedLock.java │ │ │ │ └── DistributedLock.java │ │ │ └── resources │ │ │ ├── application.yml │ │ │ └── redisson-config.yml │ ├── example-wrapper-base-type │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── example │ │ │ └── wrapper │ │ │ ├── WrapperApplication.java │ │ │ ├── WrapperClient.java │ │ │ ├── action │ │ │ ├── BoolAction.java │ │ │ ├── IntAction.java │ │ │ ├── LongAction.java │ │ │ ├── StringAction.java │ │ │ └── WrapperCmd.java │ │ │ └── server │ │ │ └── WrapperLogicServer.java │ └── example-ws-token │ │ ├── .gitignore │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── example │ │ └── ws │ │ └── verify │ │ ├── WsClient.java │ │ ├── WsVerifyApplication.java │ │ ├── action │ │ ├── WsVerifyAction.java │ │ └── WsVerifyCmd.java │ │ ├── external │ │ └── MyWebSocketVerifyHandler.java │ │ └── server │ │ └── WsVerifyLogicServer.java └── pom.xml ├── SpringBootExample ├── Dockerfile ├── LICENSE ├── README.md ├── docker ├── pom.xml ├── spring-client-native-pb │ ├── pom.xml │ ├── proto │ │ ├── biz.proto │ │ └── common.proto │ ├── protocol.sh │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ ├── game │ │ │ └── spring │ │ │ │ └── client │ │ │ │ ├── SpringWebsocketNativeProtoClient.java │ │ │ │ ├── command │ │ │ │ └── WebsocketNativeProtoClientKit.java │ │ │ │ └── tester │ │ │ │ ├── NativePbTest.java │ │ │ │ └── NativeProtoTest.java │ │ │ ├── message │ │ │ ├── BizProto.java │ │ │ ├── MyTempUserInfo.java │ │ │ └── Proto.java │ │ │ └── pb │ │ │ └── LoginVerify.java │ │ └── resources │ │ └── logback.xml ├── spring-client │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── client │ │ ├── Dog.java │ │ ├── SpringClient.java │ │ └── Temp.java ├── spring-common-pb │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ └── game │ │ │ └── spring │ │ │ └── common │ │ │ ├── SendDoc.java │ │ │ ├── SpringGameCodeEnum.java │ │ │ ├── SpringGameProtoFile.java │ │ │ ├── SpringTest.java │ │ │ ├── Update.java │ │ │ ├── cmd │ │ │ ├── ClassesCmdModule.java │ │ │ ├── HallCmdModule.java │ │ │ ├── IssuesCmdModule.java │ │ │ ├── OtherSchoolCmdModule.java │ │ │ ├── RoomCmdModule.java │ │ │ ├── SchoolCmdModule.java │ │ │ └── SpringCmdModule.java │ │ │ ├── data │ │ │ └── MyAttachment.java │ │ │ └── pb │ │ │ ├── Animal.java │ │ │ ├── AnimalType.java │ │ │ ├── CatMessage.java │ │ │ ├── ClassesPb.java │ │ │ ├── Issue338RoomInfo.java │ │ │ ├── LogicRequestPb.java │ │ │ ├── LoginVerify.java │ │ │ ├── OtherVerify.java │ │ │ ├── RoomNumPb.java │ │ │ ├── SceneEnterReq.java │ │ │ ├── SchoolLevelPb.java │ │ │ ├── SchoolPb.java │ │ │ ├── SpringBroadcastMessagePb.java │ │ │ ├── UserInfo.java │ │ │ └── Vector3.java │ │ └── resources │ │ └── logback.xml ├── spring-game-broker │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── broker │ │ ├── GameBrokerApplication.java │ │ └── GameBrokerBoot.java ├── spring-game-external │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── external │ │ ├── GameExternal.java │ │ ├── GameExternalApplication.java │ │ └── codec │ │ └── MyTcpExternalCodec.java ├── spring-game-logic-classes-starter │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── logic │ │ └── classes │ │ └── GameLogicClassesApplication.java ├── spring-game-logic-classes │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── logic │ │ └── classes │ │ ├── GameLogicClassesLogic.java │ │ ├── action │ │ └── ClassesAction.java │ │ └── service │ │ └── ClassesService.java ├── spring-game-logic-common │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ ├── action │ │ └── skeleton │ │ │ └── core │ │ │ └── flow │ │ │ └── MyFlowContext.java │ │ └── spring │ │ └── logic │ │ └── core │ │ ├── MyBarSkeletonConfig.java │ │ ├── MyDefaultMethodParser.java │ │ └── MyProtoDataCodec.java ├── spring-game-logic-hall │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── logic │ │ └── hall │ │ ├── GameLogicHallClientApplication.java │ │ ├── GameLogicHallLogic.java │ │ └── action │ │ ├── HallAction.java │ │ ├── LoginAction.java │ │ └── SpringIntAction.java ├── spring-game-logic-room-interaction-same │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── logic │ │ └── interaction │ │ └── same │ │ └── room │ │ ├── SameRoomLogic.java │ │ ├── SameRoomLogicClientApplication.java │ │ ├── action │ │ └── RoomAction.java │ │ └── multi │ │ └── server │ │ ├── SameRoomLogicClient1.java │ │ └── SameRoomLogicClient2.java ├── spring-game-logic-school-starter │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── logic │ │ └── school │ │ └── GameLogicSchoolApplication.java ├── spring-game-logic-school │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── game │ │ └── spring │ │ └── logic │ │ └── school │ │ ├── GameLogicSchoolLogic.java │ │ ├── action │ │ ├── IssuesAction.java │ │ ├── OtherSchoolAction.java │ │ └── SchoolAction.java │ │ ├── annotation │ │ └── IgnoreDebugInout.java │ │ └── service │ │ └── SchoolService.java └── spring-z-one-game │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── iohao │ └── game │ └── spring │ ├── SpringGameOneApplication.java │ ├── TestGenerate.java │ └── other │ └── server │ └── ExternalWithBrokerServerApplication.java ├── fxglSimpleGame ├── .gitignore ├── LICENSE ├── README.md ├── common │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ └── demo │ │ │ └── game │ │ │ └── common │ │ │ ├── MyCmd.java │ │ │ ├── PlayerInfo.java │ │ │ └── PlayerMove.java │ │ └── resources │ │ └── logback.xml ├── game-fxgl │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── iohao │ │ │ ├── demo │ │ │ └── game │ │ │ │ └── fxgl │ │ │ │ ├── GameApp.java │ │ │ │ ├── GameApp2.java │ │ │ │ ├── GameController.java │ │ │ │ ├── GameFactory.java │ │ │ │ └── MyKit.java │ │ │ └── fx │ │ │ └── game │ │ │ └── component │ │ │ └── control │ │ │ ├── Dir.java │ │ │ └── PlayerMoveComponent.java │ │ └── resources │ │ └── assets │ │ ├── music │ │ └── bgm.mp3 │ │ ├── sounds │ │ ├── lose_life.wav │ │ └── shoot2.wav │ │ └── ui │ │ └── demo_ui.fxml ├── game-server │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── iohao │ │ └── demo │ │ └── game │ │ └── server │ │ ├── GameAction.java │ │ ├── GameServerApplication.java │ │ └── MyLogicServer.java ├── img.png └── pom.xml └── ioGameWeb2Game ├── .gitignore ├── README.md ├── pom.xml └── src └── main ├── java └── com │ └── iohao │ └── web2game │ ├── HelloLogicServer.java │ ├── IoGameWeb2GameApplication.java │ ├── action │ ├── HelloAction.java │ └── UserService.java │ └── client │ ├── HelloClient.java │ └── HelloInputCommandRegion.java └── resources └── application.properties /.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 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 示例集合介绍 2 | 3 | 此仓库包含 ioGame 文档中所有示例的集合,每个目录都是一个独立的示例项目。 4 | 5 | | **目录、源码** | **描述、文档** | 6 | | ----------------- | ------------------------------------------------------------ | 7 | | RoomExample | [桌游、房间类 (yuque.com)](https://www.yuque.com/iohao/game/vtzbih) 相关示例,游戏客户端使用 FXGL 制作,有大厅、房间。 | 8 | | SimpleExample | 文档中所有功能点的示例 | 9 | | SpringBootExample | [ioGame 综合示例 (yuque.com)](https://www.yuque.com/iohao/game/ruaqza) | 10 | | ioGameWeb2Game | [web 转游戏 - 示例理解篇 (yuque.com)](https://www.yuque.com/iohao/game/gpzmc8vadn4vl70z) | 11 | | fxglSimpleGame | [fxgl-ioGame-移动同步 (yuque.com)](https://www.yuque.com/iohao/game/bolt) | 12 | | SdkExample | [代码生成(yuque.com)](https://www.yuque.com/iohao/game/irth38),该项目是与 ioGame SDK(C# Sdk、Ts Sdk) 相关的联调演示,服务器提供了 `action、广播、错误码` 等相关内容用于交互演示。 | 13 | 14 | 15 | 16 | ## ioGame 文档 17 | 18 | [ioGame 网络游戏服务器框架文档 (yuque.com)](https://www.yuque.com/iohao/game) 19 | 20 | 21 | -------------------------------------------------------------------------------- /SdkExample/.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 -------------------------------------------------------------------------------- /SdkExample/doc/CsHello1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/CsHello1.png -------------------------------------------------------------------------------- /SdkExample/doc/CsHello2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/CsHello2.png -------------------------------------------------------------------------------- /SdkExample/doc/CsLoginVerify1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/CsLoginVerify1.png -------------------------------------------------------------------------------- /SdkExample/doc/CsLoginVerify2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/CsLoginVerify2.png -------------------------------------------------------------------------------- /SdkExample/doc/GodotCsproj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/GodotCsproj.png -------------------------------------------------------------------------------- /SdkExample/doc/ImportProtbuf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/ImportProtbuf.png -------------------------------------------------------------------------------- /SdkExample/doc/ImportSdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/ImportSdk.png -------------------------------------------------------------------------------- /SdkExample/doc/MyAction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/MyAction.png -------------------------------------------------------------------------------- /SdkExample/doc/TsHello1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/TsHello1.png -------------------------------------------------------------------------------- /SdkExample/doc/TsHello2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/TsHello2.png -------------------------------------------------------------------------------- /SdkExample/doc/TsListen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/TsListen.png -------------------------------------------------------------------------------- /SdkExample/doc/TsListenList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/TsListenList.png -------------------------------------------------------------------------------- /SdkExample/doc/TsLoginVerify1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/TsLoginVerify1.png -------------------------------------------------------------------------------- /SdkExample/doc/TsLoginVerify2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/TsLoginVerify2.png -------------------------------------------------------------------------------- /SdkExample/doc/UnityPlugins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/UnityPlugins.png -------------------------------------------------------------------------------- /SdkExample/doc/actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/actions.png -------------------------------------------------------------------------------- /SdkExample/doc/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SdkExample/doc/server.png -------------------------------------------------------------------------------- /SdkExample/src/main/java/com/iohao/example/sdk/logic/data/AnimalEnum.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.example.sdk.logic.data; 20 | 21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass; 22 | import com.iohao.game.widget.light.protobuf.ProtoFileMerge; 23 | 24 | /** 25 | * AnimalEnum 26 | * 27 | * @author 渔民小镇 28 | * @date 2025-03-22 29 | * @since 21.26 30 | */ 31 | @ProtobufClass 32 | @ProtoFileMerge(fileName = SdkProtoFile.fileName, filePackage = SdkProtoFile.filePackage) 33 | public enum AnimalEnum { 34 | dog1, 35 | bird1 36 | } 37 | -------------------------------------------------------------------------------- /SdkExample/src/main/java/com/iohao/example/sdk/logic/data/CarEnum.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.example.sdk.logic.data; 20 | 21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass; 22 | import com.iohao.game.widget.light.protobuf.ProtoFileMerge; 23 | 24 | /** 25 | * CarEnum 26 | * @author 渔民小镇 27 | * @date 2025-03-22 28 | * @since 21.26 29 | */ 30 | @ProtobufClass 31 | @ProtoFileMerge(fileName = SdkProtoFile.fileName, filePackage = SdkProtoFile.filePackage) 32 | public enum CarEnum { 33 | dog, 34 | bird, 35 | catCar 36 | } 37 | -------------------------------------------------------------------------------- /SdkExample/src/main/java/com/iohao/example/sdk/logic/data/SdkProtoFile.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.example.sdk.logic.data; 20 | 21 | /** 22 | * @author 渔民小镇 23 | * @date 2024-11-01 24 | */ 25 | public interface SdkProtoFile { 26 | String fileName = "common.proto"; 27 | String filePackage = "common"; 28 | 29 | String fileName2 = "common2.proto"; 30 | String filePackage2 = "common2"; 31 | } 32 | -------------------------------------------------------------------------------- /SimpleExample/component/README.md: -------------------------------------------------------------------------------- 1 | 参考文档 [压测&模拟客户端请求](https://www.yuque.com/iohao/game/tc83ud) 2 | 3 | -------------------------------------------------------------------------------- /SimpleExample/component/chat-core/.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/component/chat-core/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 | chat-core 14 | 15 | 16 | 17 | com.iohao.example 18 | chat-provide 19 | ${project.parent.version} 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SimpleExample/component/chat-provide/.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/component/chat-provide/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 | chat-provide 14 | 15 | 16 | 17 | com.iohao.game 18 | light-jprotobuf 19 | ${ioGame.version} 20 | 21 | 22 | -------------------------------------------------------------------------------- /SimpleExample/component/chat-provide/src/main/java/com/iohao/game/component/chat/cmd/ChatFileMerge.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.component.chat.cmd; 20 | 21 | /** 22 | * @author 渔民小镇 23 | * @date 2023-07-12 24 | */ 25 | public interface ChatFileMerge { 26 | String fileName = "chat.proto"; 27 | String filePackage = "pb.chat"; 28 | } 29 | -------------------------------------------------------------------------------- /SimpleExample/component/login-core/.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/component/login-core/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 | login-core 14 | 15 | 16 | 17 | com.iohao.example 18 | login-provide 19 | ${project.parent.version} 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SimpleExample/component/login-provide/.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/component/login-provide/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 | login-provide 14 | 15 | -------------------------------------------------------------------------------- /SimpleExample/component/login-provide/src/main/java/com/iohao/game/component/login/cmd/LoginCmd.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.component.login.cmd; 20 | 21 | import com.iohao.game.action.skeleton.core.CmdInfo; 22 | 23 | /** 24 | * @author 渔民小镇 25 | * @date 2023-07-16 26 | */ 27 | public interface LoginCmd { 28 | int cmd = 126; 29 | int login = 0; 30 | int inc = 100; 31 | int inc2 = 101; 32 | 33 | static CmdInfo of(int subCmd) { 34 | return CmdInfo.of(cmd, subCmd); 35 | } 36 | } -------------------------------------------------------------------------------- /SimpleExample/component/login-provide/src/main/java/com/iohao/game/component/login/proto/LoginVerify.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.component.login.proto; 20 | 21 | import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass; 22 | import lombok.AccessLevel; 23 | import lombok.Getter; 24 | import lombok.Setter; 25 | import lombok.ToString; 26 | import lombok.experimental.FieldDefaults; 27 | 28 | /** 29 | * @author 渔民小镇 30 | * @date 2023-07-16 31 | */ 32 | @ToString 33 | @ProtobufClass 34 | @FieldDefaults(level = AccessLevel.PUBLIC) 35 | public class LoginVerify { 36 | String jwt; 37 | } -------------------------------------------------------------------------------- /SimpleExample/component/z-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/component/z-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 | z-client 14 | 15 | 16 | 17 | com.iohao.example 18 | chat-core 19 | ${project.parent.version} 20 | 21 | 22 | 23 | com.iohao.example 24 | login-core 25 | ${project.parent.version} 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /SimpleExample/component/z-client/src/main/java/com/iohao/game/component/client/MyClient1.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.component.client; 20 | 21 | /** 22 | * @author 渔民小镇 23 | * @date 2023-07-16 24 | */ 25 | public class MyClient1 { 26 | public static void main(String[] args) { 27 | // 使用玩家 userId:1 28 | long userId = 1; 29 | MyClientCommon.start(userId); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SimpleExample/component/z-client/src/main/java/com/iohao/game/component/client/MyClient2.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.component.client; 20 | 21 | /** 22 | * @author 渔民小镇 23 | * @date 2023-07-16 24 | */ 25 | public class MyClient2 { 26 | public static void main(String[] args) { 27 | long userId = 2; 28 | MyClientCommon.start(userId); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SimpleExample/doc_maven.txt: -------------------------------------------------------------------------------- 1 | 建议安装 mvnd,可并发编译 2 | 3 | mvnd clean install -Dmaven.test.skip=true 4 | 5 | 编译 6 | mvnd compile 7 | 8 | jprotobuf 9 | mvnd jprotobuf:precompile 10 | 11 | 生成 html doc 12 | mvnd clean install -Dmaven.test.skip=true 13 | 14 | 依赖相关 15 | mvnd dependency:tree>doc_game.txt 16 | 17 | 重复依赖检测,并解决冲突jar 18 | mvnd enforcer:display-info 19 | mvnd validate -------------------------------------------------------------------------------- /SimpleExample/example-exchange/README.md: -------------------------------------------------------------------------------- 1 | ### 简介 2 | 3 | gm 后台管理 与 ioGame 交互示例。 4 | 5 | see https://www.yuque.com/iohao/game/uwxeg2uk86mu27mp 6 | 7 | 8 | 当我们将项目启动后,在浏览器输入 9 | - http://localhost:8080/gm/recharge 可触发 gm - recharge 方法。 10 | - http://localhost:8080/gm/notice 可触发 gm - notice 方法。该示例在请求游戏逻辑服时,不会携带上玩家的元信息。 11 | - http://localhost:8080/other/notice 可触发 other - notice 方法,会从游戏对外服获取一些玩家的数据,如玩家的元信息、所绑定的游戏逻辑服 ...等。该示例在请求游戏逻辑服时,会携带上玩家的元信息。 12 | 13 | 14 | -------------------------------------------------------------------------------- /SimpleExample/example-exchange/exchange-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 | exchange-client 14 | 15 | 16 | 17 | com.iohao.example 18 | exchange-common 19 | 3.0.0.io 20 | 21 | 22 | -------------------------------------------------------------------------------- /SimpleExample/example-exchange/exchange-common/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 | exchange-common 14 | 15 | -------------------------------------------------------------------------------- /SimpleExample/example-exchange/exchange-common/src/main/java/com/iohao/game/exchange/common/ExchangeCmd.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.exchange.common; 20 | 21 | import com.iohao.game.action.skeleton.core.CmdInfo; 22 | 23 | /** 24 | * @author 渔民小镇 25 | * @date 2024-03-13 26 | */ 27 | public interface ExchangeCmd { 28 | int cmd = 20; 29 | 30 | int loginVerify = 1; 31 | int recharge = 2; 32 | int notice = 3; 33 | 34 | static CmdInfo of(int subCmd) { 35 | return CmdInfo.of(cmd, subCmd); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SimpleExample/example-exchange/exchange-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 | exchange-game-logic 14 | 15 | 16 | 17 | com.iohao.example 18 | exchange-common 19 | 3.0.0.io 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SimpleExample/example-exchange/exchange-web-gm/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 | exchange-web-gm 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-web 19 | ${springboot.version} 20 | 21 | 22 | 23 | com.iohao.example 24 | exchange-common 25 | 3.0.0.io 26 | 27 | 28 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/README.md: -------------------------------------------------------------------------------- 1 | 示例目录说明 2 | ```text 3 | example-game-collect 4 | ├── fxgl-tank 游戏引擎坦克客户端 示例目录 5 | ├── game-common 一些通用的功能 6 | ├── game-common-proto 示例 pb 示例目录 7 | ├── game-external 对外服 示例目录 8 | ├── game-logic-hall 登录逻辑服 示例目录 9 | ├── game-logic-tank 坦克逻辑服 示例目录 10 | └── game-one 一键启动 游戏网关、游戏逻辑服(登录和坦克)、对外服 示例目录 11 | 12 | ``` 13 | 14 | > game-external 对外服 【启动类 GameExternalBoot】 15 | > 16 | > game-logic-hall 登录逻辑服 【启动类 HallClientStartup】 17 | > 18 | > game-logic-tank 坦克逻辑服 【启动类 TankClientStartup】 19 | > 20 | > 这几个都是可以单独启动的,启动顺序网关、逻辑服、对外服,但是开发阶段每次分别启动这几个太麻烦了。建议一键启动 game-one 21 | > 22 | > game-one 【启动类 GameOne.java】 23 | 24 | 25 | 26 | ### 网络部分 27 | 28 | 在网络请求部分,使用了 [ioGame sdk (yuque.com)](https://www.yuque.com/iohao/game/ot4o45f8u9566wu0) 来简化与 ioGame 通信的网络交互部分。 -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/java/com/iohao/game/tank/GameType.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.tank; 2 | 3 | /** 4 | * @author 渔民小镇 5 | * @date 2022-03-06 6 | */ 7 | public enum GameType { 8 | /** 玩家 */ 9 | PLAYER, 10 | 11 | /** 玩家 */ 12 | ENEMY, 13 | 14 | /** 子弹 */ 15 | BULLET, 16 | } 17 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/java/com/iohao/game/tank/component/Dir.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.tank.component; 2 | 3 | import javafx.geometry.Point2D; 4 | 5 | /** 6 | * @author 渔民小镇 7 | * @date 2022-03-06 8 | */ 9 | public enum Dir { 10 | /** 11 | * 12 | */ 13 | UP(new Point2D(0, -1)), 14 | RIGHT(new Point2D(1, 0)), 15 | DOWN(new Point2D(0, 1)), 16 | LEFT(new Point2D(-1, 0)); 17 | 18 | public Point2D vector; 19 | 20 | Dir(Point2D vector) { 21 | this.vector = vector; 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/java/com/iohao/game/tank/net/cmd/HallCmd.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.tank.net.cmd; 18 | 19 | /** 20 | * @author 渔民小镇 21 | * @date 2022-02-02 22 | */ 23 | public interface HallCmd { 24 | /** 模块A - 主 cmd */ 25 | int cmd = 1; 26 | 27 | /** 登录验证 */ 28 | int loginVerify = 1; 29 | } 30 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/java/com/iohao/game/tank/net/cmd/TankCmd.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.tank.net.cmd; 18 | 19 | /** 20 | * 游戏 - 坦克模块 21 | * 22 | * @author 渔民小镇 23 | * @date 2022-01-14 24 | */ 25 | public interface TankCmd { 26 | /** 模块 - 主 cmd : 2 */ 27 | int cmd = 2; 28 | 29 | /** 进入房间 */ 30 | int enterRoom = 2; 31 | /** 坦克射击(发射子弹) */ 32 | int shooting = 6; 33 | int testShooting = 7; 34 | int testShootingOrder = 8; 35 | } -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/java/com/iohao/game/tank/ui/GameLoadingScene.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.tank.ui; 2 | 3 | import com.almasb.fxgl.app.scene.LoadingScene; 4 | import com.iohao.game.tank.Config; 5 | import javafx.scene.shape.Rectangle; 6 | 7 | /** 8 | * @author 渔民小镇 9 | * @date 2022-03-06 10 | */ 11 | public class GameLoadingScene extends LoadingScene { 12 | 13 | public GameLoadingScene() { 14 | Rectangle rect = new Rectangle(getAppWidth(), getAppHeight(), Config.BG_GARY); 15 | 16 | getContentRoot().getChildren().setAll(rect); 17 | 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/e_fire.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/e_fire.mp3 -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/mainMenuHover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/mainMenuHover.wav -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/normalBomb.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/normalBomb.wav -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/normalFire.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/normalFire.wav -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/select.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/select.wav -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/start.wav -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/tank_move.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/sounds/tank_move.wav -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/H1_ship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/H1_ship.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/bullet/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/bullet/normal.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/bullet/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/bullet/plus.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/helmet_used.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/helmet_used.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/icon.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/loadingBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/loadingBg.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/logo.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/H1U.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/H1U.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/H2U.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/H2U.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_1.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_2.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_3.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_4.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_5.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_6.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_7.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_8.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/bomb_rocket_9.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/spawnTank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/textures/tank/spawnTank.png -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/ui/fonts/airstrikeacad.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iohao/ioGameExamples/42c9de467cf9ff1a86db20b2db310d57441109b9/SimpleExample/example-game-collect/fxgl-tank/src/main/resources/assets/ui/fonts/airstrikeacad.ttf -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-common-proto/proto.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mvn clean 3 | mvn compile 4 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-common-proto/src/main/java/com/iohao/game/collect/proto/GameProtoFile.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.collect.proto; 18 | 19 | /** 20 | * @author 渔民小镇 21 | * @date 2022-01-25 22 | */ 23 | public interface GameProtoFile { 24 | String COMMON_FILE_NAME = "common.proto"; 25 | String COMMON_FILE_PACKAGE = "proto"; 26 | } 27 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-common-proto/src/main/java/com/iohao/game/collect/proto/common/BarHelloPb.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.collect.proto.common; 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-02-05 28 | */ 29 | @ProtobufClass 30 | @ToString 31 | @FieldDefaults(level = AccessLevel.PUBLIC) 32 | public class BarHelloPb { 33 | int amount; 34 | } 35 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-common/src/main/java/com/iohao/game/collect/common/GameConfig.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.collect.common; 18 | 19 | /** 20 | * @author 渔民小镇 21 | * @date 2022-01-12 22 | */ 23 | public interface GameConfig { 24 | /** 对外服务器 port */ 25 | int externalPort = 10100; 26 | /** 对外服务器 ip */ 27 | String externalIp = "127.0.0.1"; 28 | /** http 升级 websocket 协议地址 */ 29 | String websocketPath = "/websocket"; 30 | } 31 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-common/src/main/java/com/iohao/game/collect/common/HallCmd.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.collect.common; 18 | 19 | /** 20 | * @author 渔民小镇 21 | * @date 2022-02-02 22 | */ 23 | public interface HallCmd { 24 | /** 模块A - 主 cmd */ 25 | int cmd = 1; 26 | 27 | /** 登录验证 */ 28 | int loginVerify = 1; 29 | } 30 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-common/src/main/java/com/iohao/game/collect/common/ModuleKeyCont.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.collect.common; 18 | 19 | /** 20 | * @author 渔民小镇 21 | * @date 2022-01-12 22 | */ 23 | public interface ModuleKeyCont { 24 | 25 | /** 用户模块 */ 26 | int userModuleId = 10; 27 | /** 游戏 坦克模块 */ 28 | int gameTankModuleId = 11; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-hall/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 | game-logic-hall 14 | 15 | 16 | 17 | com.iohao.example 18 | game-common 19 | ${project.parent.version} 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-tank/README.md: -------------------------------------------------------------------------------- 1 | 雷少的诡异坦克 2 | 坦克游戏逻辑服 -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-tank/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 | game-logic-tank 14 | 15 | 16 | 17 | com.iohao.example 18 | game-common 19 | ${project.parent.version} 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-tank/src/main/java/com/iohao/game/collect/tank/config/BulletId.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.collect.tank.config; 18 | 19 | /** 20 | * @author 渔民小镇 21 | * @date 2022-01-15 22 | */ 23 | public interface BulletId { 24 | /** 玩具弹 */ 25 | int toyBullet = 1; 26 | 27 | 28 | /** 雪弹 */ 29 | int snowBullet = 2; 30 | } 31 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-tank/src/main/java/com/iohao/game/collect/tank/config/TankBootItemConfig.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.collect.tank.config; 18 | 19 | import com.iohao.game.common.internal.BootItemConfig; 20 | 21 | /** 22 | * @author 渔民小镇 23 | * @date 2022-01-15 24 | */ 25 | public class TankBootItemConfig implements BootItemConfig { 26 | @Override 27 | public void config() { 28 | // TankBulletConfig tankBulletConfig = new TankBulletConfig(); 29 | // tankBulletConfig.setBulletType(0); 30 | // tankBulletConfig.setAttackValue(1); 31 | // tankBulletConfig.setSpeed(1); 32 | 33 | 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-tank/src/main/java/com/iohao/game/collect/tank/config/TankKit.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.collect.tank.config; 18 | 19 | import com.iohao.game.bolt.broker.core.client.BrokerClient; 20 | import lombok.experimental.UtilityClass; 21 | 22 | /** 23 | * @author 渔民小镇 24 | * @date 2022-01-16 25 | */ 26 | @UtilityClass 27 | public class TankKit { 28 | public BrokerClient brokerClient; 29 | } 30 | -------------------------------------------------------------------------------- /SimpleExample/example-game-collect/game-logic-tank/src/main/java/com/iohao/game/collect/tank/mapstruct/package-info.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 | /** 18 | * 实体映射工具 19 | *
20 |  *     https://mapstruct.org/documentation/stable/reference/html/
21 |  *
22 |  *     bean 相互转换
23 |  * 
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 | *
 6 |  *     后期可以放到conmmon中,再所有存在回调的地方使用
 7 |  * 
8 | * 9 | * @author shen 10 | * @date 2022-03-28 11 | * @Slogan 慢慢变好,是给自己最好的礼物 12 | */ 13 | public interface ReturnHandle { 14 | T execute(); 15 | } 16 | -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock-spring-boot-starter/src/main/java/com/iohao/game/domain/common/lock/VoidHandle.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.domain.common.lock; 2 | 3 | /** 4 | * 带返回值的执行接口 5 | *
 6 |  *  后期可以放到conmmon中,再所有存在回调的地方使用
 7 |  * 
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-spring-boot-starter/src/main/java/com/iohao/game/domain/config/DistibutedLockProperties.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.domain.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | @ConfigurationProperties(prefix = "iogame") 8 | public class DistibutedLockProperties { 9 | private String redissonConfigName; 10 | 11 | public String getRedissonConfigName() { 12 | return redissonConfigName; 13 | } 14 | 15 | public void setRedissonConfigName(String redissonConfigName) { 16 | this.redissonConfigName = redissonConfigName; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock-spring-boot-starter/src/main/java/com/iohao/game/domain/config/DistributedLockAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.domain.config; 2 | 3 | import com.iohao.game.service.DefaultRedissonDistributedLock; 4 | import com.iohao.game.service.DistributedLock; 5 | import org.redisson.api.RedissonClient; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | @Configuration 12 | public class DistributedLockAutoConfiguration { 13 | 14 | @Autowired 15 | private RedissonClient redissonClient; 16 | 17 | @Bean 18 | @ConditionalOnMissingBean 19 | public DistributedLock distributedLock() { 20 | return new DefaultRedissonDistributedLock(redissonClient); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock-spring-boot-starter/src/main/resource/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | // ??redisson???????????? 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.iohao.game.domain.config.DistributedLockAutoConfiguration -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock/README.md: -------------------------------------------------------------------------------- 1 | ## 分布式锁 2 | 3 | 4 | https://www.yuque.com/iohao/game/wz7af5 -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock/src/main/java/com/iohao/game/RedissonExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | 7 | @SpringBootApplication 8 | //开启线程池 9 | @EnableAsync 10 | public class RedissonExampleApplication { 11 | public static void main(String[] args) { 12 | SpringApplication.run(RedissonExampleApplication.class, args); 13 | 14 | //模拟多线程环境竞争锁 15 | // ExecutorsDistributeLock executorsDistributeLock = SpringUtil.getBean(ExecutorsDistributeLock.class); 16 | // executorsDistributeLock.testRlock(); 17 | 18 | //使用Spring默认线程池,即@EnableAsync模拟的多线程环境竞争锁 19 | // SpringMultiThreadDistributeLock springMultiThreadDistributeLock = SpringUtil.getBean(SpringMultiThreadDistributeLock.class); 20 | 21 | //模拟多线程消费 22 | // springMultiThreadDistributeLock.testRlock(); 23 | 24 | //模拟多线程tryLock 25 | // springMultiThreadDistributeLock.testTryLock(); 26 | 27 | //模拟多线程lock 28 | // springMultiThreadDistributeLock.testLock(); 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock/src/main/java/com/iohao/game/domain/common/lock/ReturnHandle.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.domain.common.lock; 2 | 3 | /** 4 | * 带返回值的执行接口 5 | *
 6 |  *     后期可以放到conmmon中,再所有存在回调的地方使用
 7 |  * 
8 | * 9 | * @author shen 10 | * @date 2022-03-28 11 | * @Slogan 慢慢变好,是给自己最好的礼物 12 | */ 13 | public interface ReturnHandle { 14 | T execute(); 15 | } 16 | -------------------------------------------------------------------------------- /SimpleExample/example/example-redisson-lock/src/main/java/com/iohao/game/domain/common/lock/VoidHandle.java: -------------------------------------------------------------------------------- 1 | package com.iohao.game.domain.common.lock; 2 | 3 | /** 4 | * 带返回值的执行接口 5 | *
 6 |  *  后期可以放到conmmon中,再所有存在回调的地方使用
 7 |  * 
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 | ![img.png](img.png) -------------------------------------------------------------------------------- /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 |