渔民小镇 hai 1 ano
pai
achega
deb1e880c8
Modificáronse 57 ficheiros con 3849 adicións e 19 borrados
  1. 89 0
      .gitignore
  2. 661 0
      LICENSE
  3. 11 0
      LICENSE_SUBJOIN
  4. 425 19
      README.md
  5. 38 0
      broker/.gitignore
  6. 43 0
      broker/pom.xml
  7. 56 0
      broker/src/main/java/com/iohao/mmo/broker/MyBrokerServer.java
  8. 38 0
      common/common-core/.gitignore
  9. 21 0
      common/common-core/pom.xml
  10. 31 0
      common/common-core/src/main/java/com/iohao/mmo/common/annotation/IoThread.java
  11. 42 0
      common/common-core/src/main/java/com/iohao/mmo/common/core/flow/MyAttachment.java
  12. 63 0
      common/common-core/src/main/java/com/iohao/mmo/common/core/flow/MyFlowContext.java
  13. 44 0
      common/common-core/src/main/java/com/iohao/mmo/common/logic/server/LogicServerKit.java
  14. 114 0
      common/common-core/src/main/java/com/iohao/mmo/common/processor/hook/MyRequestMessageClientProcessorHook.java
  15. 38 0
      external/.gitignore
  16. 43 0
      external/pom.xml
  17. 66 0
      external/src/main/java/com/iohao/mmo/external/MyExternalServer.java
  18. 38 0
      logic/all-logic/.gitignore
  19. 35 0
      logic/all-logic/pom.xml
  20. 38 0
      logic/login-logic/.gitignore
  21. 36 0
      logic/login-logic/pom.xml
  22. 49 0
      logic/login-logic/src/main/java/com/iohao/mmo/login/LoginLogicServer.java
  23. 75 0
      logic/login-logic/src/main/java/com/iohao/mmo/login/action/LoginAction.java
  24. 38 0
      logic/person-logic/.gitignore
  25. 35 0
      logic/person-logic/pom.xml
  26. 48 0
      logic/person-logic/src/main/java/com/iohao/mmo/person/action/PersonAction.java
  27. 58 0
      logic/person-logic/src/main/java/com/iohao/mmo/person/entity/PersonBasicPropertyEntity.java
  28. 35 0
      logic/person-logic/src/main/java/com/iohao/mmo/person/entity/PersonEntity.java
  29. 36 0
      logic/person-logic/src/main/java/com/iohao/mmo/person/service/PersonMapper.java
  30. 62 0
      logic/person-logic/src/main/java/com/iohao/mmo/person/service/PersonService.java
  31. 38 0
      one-application/.gitignore
  32. 41 0
      one-application/pom.xml
  33. 71 0
      one-application/src/main/java/com/iohao/mmo/app/OneApplication.java
  34. 113 0
      one-application/src/main/resources/logback.xml
  35. 38 0
      one-client/.gitignore
  36. 31 0
      one-client/pom.xml
  37. 58 0
      one-client/src/main/java/com/iohao/mmo/client/CommonClient.java
  38. 34 0
      one-client/src/main/java/com/iohao/mmo/client/OneClient.java
  39. 113 0
      one-client/src/main/resources/logback.xml
  40. 210 0
      pom.xml
  41. 38 0
      provide/all-provide/.gitignore
  42. 35 0
      provide/all-provide/pom.xml
  43. 38 0
      provide/common-provide/.gitignore
  44. 35 0
      provide/common-provide/pom.xml
  45. 30 0
      provide/common-provide/src/main/java/com/iohao/mmo/common/provide/cmd/CmdModule.java
  46. 38 0
      provide/login-provide/.gitignore
  47. 29 0
      provide/login-provide/pom.xml
  48. 66 0
      provide/login-provide/src/main/java/com/iohao/mmo/login/client/LoginInputCommandRegion.java
  49. 31 0
      provide/login-provide/src/main/java/com/iohao/mmo/login/cmd/LoginCmd.java
  50. 35 0
      provide/login-provide/src/main/java/com/iohao/mmo/login/proto/LoginVerify.java
  51. 38 0
      provide/login-provide/src/main/java/com/iohao/mmo/login/proto/UserInfo.java
  52. 38 0
      provide/person-provide/.gitignore
  53. 28 0
      provide/person-provide/pom.xml
  54. 30 0
      provide/person-provide/src/main/java/com/iohao/mmo/person/cmd/PersonCmd.java
  55. 58 0
      provide/person-provide/src/main/java/com/iohao/mmo/person/proto/PersonBasicPropertyMessage.java
  56. 37 0
      provide/person-provide/src/main/java/com/iohao/mmo/person/proto/PersonMessage.java
  57. 92 0
      运营权.md

+ 89 - 0
.gitignore

@@ -0,0 +1,89 @@
+### other dir ###
+classes/
+.temp/
+logs/
+log/
+.svn/
+svn/
+lib/
+.act.*
+system/
+
+HELP.md
+!**/src/main/**
+!**/src/test/**
+
+*.class
+
+### jreble config ###
+rebel.xml
+
+### Package Files ###
+*.jar
+*.war
+*.ear
+*.zip
+
+# tcp 与前端通讯的 api
+tcp-api/
+
+# gradle #
+build/
+.gradle/
+out/
+
+### maven ###
+target/
+!.mvn/wrapper/maven-wrapper.jar
+.mvn
+mvnw
+mvnw.cmd
+### intellj file type ###
+bin/
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### STS ###
+.apt_generated
+.factorypath
+.settings
+.springBeans
+.sts4-cache
+
+### eclipse file type ###
+.settings/
+.classpath
+.project
+
+### ---- Mac OS X ###
+.DS_Store
+Icon?
+
+### ---- Windows ###
+
+### Windows image file caches ###
+Thumbs.db
+
+### Folder integration file ###
+Desktop.ini
+
+### ---- Javadoc ###
+docs.tar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+/target/
+
+doc_game.txt

+ 661 - 0
LICENSE

@@ -0,0 +1,661 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU Affero General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<https://www.gnu.org/licenses/>.

+ 11 - 0
LICENSE_SUBJOIN

@@ -0,0 +1,11 @@
+所有版权、专利...等归 【渔民小镇、262610965@qq.com、luoyizhu@gmail.com、iohao.com】所有,并持有最终解释权。
+
+该项目仅用于学习,不可用于商业运营。在没有向我们取得运营权时,视为盗窃行为。
+
+不可二次分发、售卖本项目。
+
+
+
+
+
+

+ 425 - 19
README.md

@@ -1,37 +1,443 @@
-### 3 分钟了解如何进入开发
+## 群号
 
-欢迎使用 Codeup,通过阅读以下内容,你可以快速熟悉 Codeup ,并立即开始今天的工作。
+群号:[🔥🔥回合制网络游戏 MMO (yuque.com)](https://www.yuque.com/iohao/game/sw08q89x3x7kiuhx#E9UNx)
 
-### 提交**文件**
 
-首先,你需要了解在 Codeup 中如何提交代码文件,跟着文档「[__提交第一行代码__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6786b81620014ef7574)」一起操作试试看吧。
 
-### 开启扫描
+主要内容是 MMO 回合制网络游戏项目开发与学习,也是 ioGame 网络编程框架的最佳实践项目。
 
-开发过程中,为了更好的管理你的代码资产,Codeup 内置了「[__代码规约扫描__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f68b6b81620014ef7588)」和「[__敏感信息检测__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6886b81620014ef7587)」服务,你可以在代码库设置-集成与服务中一键开启,开启后提交或合并请求的变更将自动触发扫描,并及时提供结果反馈。
 
-![](https://img.alicdn.com/tfs/TB1nRDatoz1gK0jSZLeXXb9kVXa-1122-380.png "")
 
-![](https://img.alicdn.com/tfs/TB1PrPatXY7gK0jSZKzXXaikpXa-1122-709.png "")
+提供完整的项目源码、详细的文档、问答交流...等。
 
-### 代码评审
 
-功能开发完毕后,通常你需要发起「[__代码合并和评审__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6876b81620014ef7585)」,Codeup 支持多人协作的代码评审服务,你可以通过「[__保护分支__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f68e6b81620014ef758c)」策略及「[__合并请求设置__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f68f6b81620014ef758d)」对合并过程进行流程化管控,同时提供 WebIDE 在线代码评审及冲突解决能力,让你的评审过程更加流畅。
 
-![](https://img.alicdn.com/tfs/TB1XHrctkP2gK0jSZPxXXacQpXa-1432-887.png "")
+如果你对网络编程感兴趣,或许这是一个很好的入门机会。
 
-![](https://img.alicdn.com/tfs/TB1V3fctoY1gK0jSZFMXXaWcVXa-1432-600.png "")
 
-### 编写文档
 
-项目推进过程中,你的经验和感悟可以直接记录到 Codeup 代码库的「[__文档__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5e13107eedac6e001bd84889)」内,让智慧可视化
+如果你是 web 领域的开发者,但对网络游戏开发感兴趣,或许这是一个很好的入门机会
 
-![](https://img.alicdn.com/tfs/TB1BN2ateT2gK0jSZFvXXXnFXXa-1432-700.png "")
 
-### 成员协作
 
-是时候邀请成员一起编写卓越的代码工程了,请点击右上角「成员」邀请你的小伙伴开始协作吧!
+| github                                                      | gitee                                                      |
+| ----------------------------------------------------------- | ---------------------------------------------------------- |
+| [ioGameMMO 回合制网络游戏源码](https://github.com/iohao/ioGameMMO) | [ioGameMMO 回合制网络游戏源码](https://gitee.com/iohao/ioGameMMO) |
 
-### 更多
 
-Git 使用教学、高级功能指引等更多说明,参见[__Codeup帮助文档__](https://thoughts.teambition.com/sharespace/5d88b152037db60015203fd3/docs/5dc4f6756b81620014ef7571)。
+
+## 项目内容
+
+更详细的可以到在线文档中了解 [🔥🔥回合制游戏项目 MMO (yuque.com)](https://www.yuque.com/iohao/game/sw08q89x3x7kiuhx)
+
+
+
+这是一个基于 ioGame 网络编程框架开发的 MMO 类型的回合制网络游戏项目,这类型的游戏涵盖的点比较多,是 ioGame 的最佳实践。我们会尽可能的在项目中演示框架文档中提及的理论特性。
+
+
+
+该项目教学不会讲解框架源码相关的,更多的是偏应用的,就是教你如何使用。如果你能将项目学完,基本上就具备了独立开发游戏的能力了。
+
+
+
+整体模块内容如下(更多内容将在后续添加...)
+
+- 注册、登录
+- 人物信息、属性、数值
+- 英雄系统:技能
+- 英雄技能系统
+- 宠物系统:属性、技能、打书、
+- 宠物技能系统:宠物技能书、技能作用、给宠物上书。
+- 商店系统
+- 道具系统
+- 背包系统
+- 装备系统:升级
+- 任务系统
+- 邮件系统
+- 排行榜系统
+- 聊天系统
+- 好友系统
+- 战斗系统:战斗过程、战斗奖励
+- 组队系统
+
+
+![输入图片说明](https://foruda.gitee.com/images/1689791871708247959/6ad82164_5475.png "ioGameMMO.png")
+
+
+## 组件化与改造
+
+上述各个子系统(游戏逻辑服)几乎都是可以组件化的,我们会在此教学中,尽可能的将每个可独立的游戏逻辑服组件化。当逻辑服组件化后,我们将来可以还可以复用这些组件。
+
+
+
+虽然我们在开头介绍该项目是一个小型回合制的游戏项目,但实际上还能将其改造为其他类型的游戏。比如改为实时战斗类型的游戏,两者更多的是在战斗系统部分的区别,其他的子系统可以复用。
+
+
+
+ioGame 已提供了 TCP、WebSocket、UDP 连接方式的支持,并提供了灵活的方式来实现连接方式的切换。可以将 TCP、WebSocket、UDP 连接方式与业务代码进行无缝衔接。开发者可以用一套业务代码,无需任何改动,同时支持多种通信协议。所以,如果这部分需要做改造的,我们可以忽略不计。
+
+
+
+## 项目产生背景
+
+ioGame 在网络编程方面是先进的、富有想象力的、与时俱进的框架。除了能制作网络游戏外,还能用在物联网等其他领域,总之与网络相关的领域基本上都适用。
+
+
+
+项目是基于网络编程框架 ioGame 开发的,也是 ioGame 的最佳实践。ioGame 正式发布至中央仓库已经一周年了,经历了近 50 个版本的高速迭代。期间得到了众多开发者的认可,并且这些数据都是可查的,统计数据来源于语雀后台,这些数据都是**真实的、客观存在的、活的。与 git star 数据不同的是,因为成本的原因,某宝某多还没有出现能提供这种服务的商家,所以这样的统计数据也更具真实性。** 
+
+
+
+- [点击我,到语雀后台查看 ioGame 的数据](https://www.yuque.com/iohao)
+- [ioGame 框架版本更新日志](https://www.yuque.com/iohao/game/ab15oe)
+
+
+
+ioGame 为开发者提供了丰富的文档与示例,对于有过游戏开发经验的小伙伴来说已经足够了,甚至可以用丰富来形容。但这些对于没有游戏开发经验的人来说是远远不够的,即使看完了文档与示例后,不懂得如何灵活的运用在游戏中。这些都是正常的现象,之所以会有这种现象是因为没有项目可练习。
+
+
+
+另外一个比较困难的点,就是其他领域的开发者想要进入游戏领域则比较困难,因为大部分的公司都需要具备游戏开发经验,这样就导致了对游戏开发有兴趣的人进不来的困境。
+
+
+
+游戏开发与 web 类型的 xxx管理系统不同,游戏研发相对来说更困难,且研发经费也较高(没有谁的钱是大风刮来的),所以很少能看见相关的开源产品;这样就造成了入门困难的局面,想入门的开发者没地方入门;为了打破这个局面和普及 ioGame,这里决定使用 ioGame 来研发 MMO 类型的回合制游戏,让 java 从业者有机会能看到游戏开发的整体过程。
+
+
+
+本项目对 web 开发者是友好的,如果你之前做过 web 开发,那么学习本项目是一件轻松且简单的事。
+
+
+
+该项目整体内容比较丰富,学习完项目后,基本可以开发出市面上 90% 的游戏了。不夸张的说,当你学习完该系列后,基本上可以超越游戏行业 80% 的从业人员。
+
+
+
+如果你想深入学习游戏开发、如果你是其他领域的开发者且对游戏开发有兴趣,请选择我们。我们会用心的制作该系列的文档,并且我们有编写优质文档的能力,这点从 ioGame 提供的文档中就可以看出。
+
+
+
+**适合人员**
+
+- 对游戏开发感兴趣的。
+- 想从其他领域转入游戏行业,这是一个不错的机会。
+- 如果你想深入学习,这会是一个不错的项目,整体系统丰富,综合了多方面的内容。
+
+
+
+## 互动型项目
+
+本项目是边开发边教学类型的项目,并不是类似录播那种有固定大纲的。与录播不同的是,这是一个可参与型的项目,也是一个可互动型的项目。
+
+
+
+这种模式的好处就是,当开发者有问题,或有其他需求时,我们可以随时变更策略,以满足多数开发者当下的需求。简单点说,你们是老板、你们是策划、你们是游戏的设计者,只要是合理范围内的需求,我们都是会做记录,并在后续的规划中安排上。
+
+
+
+如果你对此模式感兴趣,欢迎加入我们。
+
+
+
+## 故事背景
+
+### 参考简介
+
+当前开发的是回合制游戏,如果你对回合制游戏不熟悉,可以参考一下梦幻西游手游之类的。之前也说过,回合制游戏与即时战斗类的游戏只是在战斗部分的所不同,但大部分的系统都是可以通用的。所以,只要没有涉及到战斗部分内容的,就可以将我们现在做的游戏称为通用游戏。
+
+
+
+### 故事背景
+
+在一个名为渔民小镇的城镇中,居住着许多喜爱冒险的英雄。这个小镇周围环境优美,是个旅游胜地,吸引了许多游客前来观光和休闲。然而,最近,一股黑暗势力突然出现,威胁着小镇和其居民的安全。
+
+
+
+这个黑暗势力由一位邪恶的巫师领导,他使用黑魔法控制了周边的森林和山脉,并派遣手下侵袭小镇。居民们生活在恐惧之中,他们需要拯救者的到来来击败黑暗势力,恢复和平与安宁。
+
+
+
+为了解救小镇和居民,我们需要招集这些英雄。这些英雄拥有各自独特的技能和能力,可以擅长物理攻击、魔法攻击、医疗或辅助。他们都住在渔民小镇上,过着平凡的生活,但在危机时刻,他们愿意奋起抵抗黑暗势力。
+
+
+
+在这个回合制的 MMO 游戏中,玩家可以选择一个英雄来进行战斗。每个英雄都有自己独特的技能树和装备,玩家可以根据自己的游戏风格和策略选择最适合自己的英雄。有些英雄擅长远程物理攻击,如射手,他们使用弓箭和弩来对抗敌人;有些英雄擅长近战物理攻击,如剑客,他们运用灵活的剑术打击敌人;还有一些英雄擅长魔法攻击,他们可以控制火焰、冰霜、闪电等元素来打击敌人;还有一些英雄擅长医疗和辅助技能,可以为队友提供治疗和增益效果。
+
+
+
+除了英雄,玩家还可以携带宠物宝宝一起战斗。这些宝宝拥有各种特色,有些可以提供额外的攻击力,有些可以为队友提供辅助效果,还有些可以变身成强大的怪兽来对抗敌人。玩家需要与自己的宠物宝宝建立深厚的关系,训练它们并发挥它们的潜力。
+
+
+
+在游戏中,玩家们可以通过组队过副本、任务和剧情,与其他英雄一起冒险。通过合作与协作,玩家们可以共同击败强大的敌人,解锁新的地图和装备,提升自己的实力。
+
+
+
+在副本中,他们将面临各种挑战和敌人,需要通过团队协作和策略才能成功通关。完成任务和剧情将推动故事的发展,揭示出邪恶势力背后更深层的秘密。
+
+
+
+玩家不仅可以升级,提升他们的技能和装备,还可以升级和培养宠物宝宝。随着宠物宝宝的成长,它们将获得新的技能和能力,为玩家在战斗中提供更多的支持和战斗力。
+
+
+
+渔民小镇的命运掌握在玩家们的手中。让我们招集这些英雄,带领他们一起战胜黑暗势力,保护渔民小镇和其居民,恢复和平与繁荣!
+
+
+
+>  提示:上述故事背景是临时写的,将来游戏发展到一定阶段会重新架构相关内容。
+
+
+
+### 大体玩法架构
+
+从上面的故事背景我们知道,游戏有很多英雄,类似 LOL 的那种英雄,每个英雄都有其特色技能。而玩家只要拥有了英雄,在战斗前是可以选择任何英雄、并携带宠物宝宝一起战斗。
+
+
+
+玩家们可以组队一起下副本、任务、剧情行。
+
+
+
+玩家可以组队、游戏内置多个英雄,玩家可以使用任意英雄战斗。每个英雄擅长有所不同,各玩家在组队时,可以选择搭配不同的组合来达到不同的效果。
+
+
+
+与一般回合制游戏不同的是,我们不固定玩家使用某一个英雄,而是可以随意切换英雄。回合制的核心之一是战斗部分,通过不同的搭配和战斗策略,往往可以展现出丰富的战斗亮点。这些搭配可以是各英雄之间的组合、阵型选择、所携带的宠物宝宝、指挥的策略...等。
+
+
+
+为了突出一些意外性,我们会在战斗中添加地形、天气等各种因素;某些英雄、或者阵型、或其他...等,则可以根据这些意外因素增减自身的一些属性。
+
+
+
+为了保证 PVP(玩家与玩家之间的)战斗之间的公平性,我们会推出一个赛事。无装备加成模式、或者说装备任选的搭配模式。在战斗前玩家可以选择各装备的搭配策略,凭借各玩家的想象力来组装出各种出奇的战术。
+
+
+
+通过上面的方式,在比赛中我们做到了公平性。正常情况下,如副本、剧情、任务等,各种加成,如装备、宠物宝宝 ...等各种加成,还是需要依靠平时的积累。
+
+
+
+这样使得游戏具有娱乐性、又具备比赛的公平性。
+
+
+
+## 前置说明
+
+由于整体规划的内容比较多,整体教学会分为几期来讲解,也就是将上述模块拆分为多个阶段来。
+
+
+
+该项目教学不会讲解框架源码相关的,更多的是偏应用的。如果你能将项目学完,基本上就具备了独立开发游戏的能力了。
+
+
+
+### **困境**
+
+在第一阶段的教学中,是偏向游戏服务器,不会有任何游戏客户端上的交互,而是使用框架提供的[模拟客户端请求](https://www.yuque.com/iohao/game/tc83ud)模块来做功能上的交互。
+
+
+
+之所以没有游戏客户端,是因为没有资金请客户端的开发者、没有资金购买 UI 和美术资源、没有资金购买 BGM 和音效、没有资金购买特效 ...等。
+
+
+
+所以,如果你比较关注的是游戏客户方面的内容,那么这会让你失望。但是别担心,将来会补上游戏客户端部分的内容,所有的困难,都是可以一步一步的解决。
+
+
+
+### **收费**
+
+这是一个收费教学项目,收费是基于以下几点考虑:
+
+1. 如果你从事过游戏相关行业,就知道整体项目需要的成本有多高。在上面困境中,解释了为什么第一阶段不会有游戏客户端部分的内容;但考虑到整体的趣味性,将来是会安排游戏客户端部分的,前提是有足够的资金时。而我们想通过教学收费的方式,来实现这一可能性。
+2. 整体规划的内容比较多,制作这个系列需要大量的时间、人力物力;如果选择用爱发电的策略,这几乎是不可能完成的。
+3. 发展需要,一切的发展都离不开经济与物质上的支持。
+4. 建立门槛,过滤观光客;优先让付费用户学习、掌握生产资料,从而提高自身竞争力。
+
+
+
+这里在补充一些,付费用户相比于自身探索的开发者,会节约大量时间成本 。这些节约出来的时间,已经足够研发几款小游戏了,甚至有可能转化为收益了。我们会让付费用户优先掌握生产资料,因为市场上或者说行业上对于这部分的供需关系是有限的,先进入的优势远大于后进入者。
+
+
+
+### 前置小结
+
+在本小节,从自身的困境中说明了为什么需要收费。由于整体规划比较大,我们会将内容会分为多个阶段来教学。
+
+
+
+介绍了授权沟通码的作用,谈到了取得运营权后各方利益的分配问题。我们会将所得利润继续投入到产品的研发中。
+
+
+
+如果你有幸白嫖了该项目的相关资源,这并不是因为你强,而是因为你不尊重知识产权。
+
+
+
+或许你可以用较低的价格,从其他不良商家手中购买到这些相关的产品与资料,但这是不好的行为。从税收层面来说,他们的这一行为不会为国家与社会贡献任何税收;从产品持续投入来说,他们不会为产品的迭代投入一分钱;不要让劣币驱逐良币,不良商家这样的行为比劣币更可恶,是纯粹的盗窃,他们的行为伤害了真正在做事的人。
+
+
+
+而我们会在取得利润后,将利润持续的投入到产品的研发中,形成良性循环。研发过程需要大量的人力物力、时间 ...等,请支持正版,请支持我们的计划,谢谢。
+
+
+
+## 环境安装及准备工作
+
+本项目的学习者建议具备 1 年及以上工作的经验,纯新手不推荐往下看。由于项目整体规划比较大,所以太过基础的不会细讲,比如语法、基本环境的安装 ...等。项目整体是偏应用的,更多的是讨论游戏相关的内容。
+
+
+
+[环境安装 ](https://www.yuque.com/iohao/game/pe7gig)
+
+
+
+建议先了解 ioGame 框架的基础概念,可以阅读 [ioGame 快速理解篇](https://www.yuque.com/iohao/game/le48p1go9gkdqgih)。
+
+
+
+## 第一阶段内容
+
+暂定内容如下,在制作的过程中会有变动。
+
+
+
+### 项目的搭建
+
+
+> 详细文档正在制作中....
+>
+> 更详细的文档,请到星球获取
+
+
+
+采用标准项目结构来搭建项目的重要性,及为何采用这样的结构?
+
+
+
+
+### 登录
+
+> 详细文档正在制作中....
+>
+> 更详细的文档,请到星球获取
+
+
+
+### 人物属性系统
+
+> 详细文档正在制作中....
+>
+> 更详细的文档,请到星球获取
+
+
+
+**人物包含一些基础属性**
+
+- 气血上限
+- 魔法上限
+- 物理伤害
+- 物理防御
+- 法术伤害
+- 法术防御
+- 速度
+- 怒气
+
+
+
+**人物等级描述**
+
+等级在游戏中并不是重点,每个阶段需要设置一个等级上限。不要让玩家花费太多时间在升级上面,而是让玩家玩专注副本、剧情、任务这上面。通过这些团队任务来得到更好的奖励,如:装备打造图书与各种耗材等。
+
+
+
+玩家组队,通过各英雄之间搭配来完成不同的副本。这也是我们后期研究的主要方向,因为需要专注升级的游戏实在太无聊了。
+
+
+
+### 英雄系统
+
+> 详细文档正在制作中....
+>
+> 更详细的文档,请到星球获取
+
+
+
+
+**英雄属性作用**
+
+基于人物的基础属性百分比增减
+
+- 物理防御百分比增减
+- 法术防御百分比增减
+- 物理攻击百分比增减
+- 法术攻击百分比增减
+- 速度百分比增减
+- 治疗量百分比增减
+
+
+
+**英雄分类**
+
+- 以物理攻击为主,擅长近战技能和高爆发输出。
+- 以法术攻击为主,擅长控制技能和群体输出。
+- 以辅助和治疗为主,擅长提供队友增益、恢复生命值,减益敌人属性。
+- 以辅助和封印控制为主,擅长减益敌人属性、控制敌方行动。
+
+
+
+**英雄擅长搭配分类**
+
+- 攻击技能:包括普通攻击和各种主动技能,用于对敌人造成伤害。
+- 治疗技能:用于为队友回复生命值,保持队伍的健康状态。
+- 辅助技能:提供各种辅助效果,如增益队友属性、减益敌人属性、增加移动速度等。
+- 控制技能:用于限制敌人的行动,如眩晕、冰冻、沉默等。
+- AOE技能:范围攻击技能,可以对一片区域内的敌人造成伤害。
+- 群体技能:可以对多个敌人或队友释放技能效果。
+- 召唤技能:可以召唤宠物或其他辅助单位来进行战斗。
+
+
+
+**英雄技能分类**
+
+- 普通技能
+- 大招
+
+
+
+**英雄设计**
+
+我们先设计一个英雄,名为阿里克斯
+
+- 英雄分类:物理攻击为主
+- 英雄擅长搭配分类:攻击技能、群体技能
+
+
+
+**阿里克斯-背景故事:**
+
+阿里克斯,被誉为雷霆剑士。从小,他就展现出非凡的战斗天赋和对正义的执着追求。阿里克斯是渔民小镇上一位出色的剑士,经过艰苦的修行和无数次的战斗,阿里克斯逐渐掌握了雷霆之力。他能够通过剑术融入自然元素的力量,使出令人震撼的雷电攻击。他的剑技犹如闪电一般迅猛,每一次挥剑都能带来毁灭性的打击。
+
+
+
+前期,简单一点处理,我们只做普攻类的,关于技能之类的放到第二阶段。
+
+
+
+## 最后
+
+上面只列出了登录、人物属性、英雄系统 ...等,第一阶段更多的内容将在后续补充。
+
+
+
+由于成本的原因,不会像 ioGame 框架那样提供完整的文档与示例。
+
+
+
+回合制网络游戏项目公开部分的迭代速度会比较慢,想要获得当前阶段较新项目源码、文档,可以在付费后得到。目前支持的付费方式是知识星球。(**不提供 IOS 的支付入口,因为 IOS 要收 30%、知识星球要收 20%**)
+
+
+
+请支持正版,我们会将收入持续的投入到该项目中,不要让劣币驱逐良币。

+ 38 - 0
broker/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 43 - 0
broker/pom.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>broker</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <!-- 数据载体 -->
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <!-- 公共核心模块 -->
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-core</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <!-- Broker(游戏网关) -->
+        <dependency>
+            <groupId>com.iohao.game</groupId>
+            <artifactId>bolt-broker-server</artifactId>
+            <version>${ioGame.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 56 - 0
broker/src/main/java/com/iohao/mmo/broker/MyBrokerServer.java

@@ -0,0 +1,56 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.broker;
+
+import com.iohao.game.bolt.broker.core.common.IoGameGlobalConfig;
+import com.iohao.game.bolt.broker.server.BrokerServer;
+import com.iohao.game.bolt.broker.server.BrokerServerBuilder;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Broker (游戏网关)
+ *
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+public class MyBrokerServer {
+    public BrokerServer createBrokerServer() {
+        // broker (游戏网关)默认端口 10200
+        return createBrokerServer(IoGameGlobalConfig.brokerPort);
+    }
+
+    public BrokerServer createBrokerServer(int port) {
+        // Broker Server (游戏网关服) 构建器
+        BrokerServerBuilder brokerServerBuilder = BrokerServer.newBuilder()
+                // broker (游戏网关)端口
+                .port(port);
+
+        // 构建游戏网关
+        return brokerServerBuilder.build();
+    }
+
+    public static void main(String[] args) throws InterruptedException {
+        BrokerServer brokerServer = new MyBrokerServer().createBrokerServer();
+        // 启动 游戏网关
+        brokerServer.startup();
+
+        TimeUnit.SECONDS.sleep(1);
+    }
+}

+ 38 - 0
common/common-core/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 21 - 0
common/common-core/pom.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>common-core</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+</project>

+ 31 - 0
common/common-core/src/main/java/com/iohao/mmo/common/annotation/IoThread.java

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

+ 42 - 0
common/common-core/src/main/java/com/iohao/mmo/common/core/flow/MyAttachment.java

@@ -0,0 +1,42 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.common.core.flow;
+
+import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
+import com.iohao.game.core.common.client.Attachment;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.FieldDefaults;
+
+/**
+ * 自定义一个元信息类,实现 Attachment 元附加信息接口
+ *
+ * @author 渔民小镇
+ * @date 2023-07-24
+ */
+@ProtobufClass
+@FieldDefaults(level = AccessLevel.PUBLIC)
+public class MyAttachment implements Attachment {
+    @Getter
+    long userId;
+
+    /** mongoDB 的用户唯一 id */
+    String objectId;
+}

+ 63 - 0
common/common-core/src/main/java/com/iohao/mmo/common/core/flow/MyFlowContext.java

@@ -0,0 +1,63 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.common.core.flow;
+
+import com.iohao.game.action.skeleton.core.flow.FlowContext;
+import com.iohao.game.common.kit.ArrayKit;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.FieldDefaults;
+
+import java.util.Objects;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-24
+ */
+public class MyFlowContext extends FlowContext {
+    public MyAttachment attachment;
+
+    /**
+     * mongoDB 的用户唯一 id
+     *
+     * @return userId String
+     */
+    public String getObjectId() {
+        initAttachment();
+
+        if (attachment == null) {
+            return null;
+        }
+
+        return attachment.objectId;
+    }
+
+    private void initAttachment() {
+        if (Objects.isNull(attachment)) {
+
+            byte[] attachmentData = this.getRequest().getHeadMetadata().getAttachmentData();
+            if (ArrayKit.isEmpty(attachmentData)) {
+                return;
+            }
+
+            this.attachment = this.getAttachment(MyAttachment.class);
+        }
+    }
+}

+ 44 - 0
common/common-core/src/main/java/com/iohao/mmo/common/logic/server/LogicServerKit.java

@@ -0,0 +1,44 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.common.logic.server;
+
+import com.iohao.game.bolt.broker.core.client.BrokerClient;
+import com.iohao.game.bolt.broker.core.client.BrokerClientBuilder;
+import com.iohao.game.bolt.broker.core.common.processor.hook.ClientProcessorHooks;
+import com.iohao.mmo.common.processor.hook.MyRequestMessageClientProcessorHook;
+import lombok.experimental.UtilityClass;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-24
+ */
+@UtilityClass
+public class LogicServerKit {
+    public ClientProcessorHooks ofClientProcessorHooks() {
+        ClientProcessorHooks hooks = new ClientProcessorHooks();
+        hooks.setRequestMessageClientProcessorHook(new MyRequestMessageClientProcessorHook());
+        return hooks;
+    }
+
+    public BrokerClientBuilder newBrokerClientBuilder() {
+        ClientProcessorHooks hooks = ofClientProcessorHooks();
+        return BrokerClient.newBuilder()
+                .clientProcessorHooks(hooks);
+    }
+}

+ 114 - 0
common/common-core/src/main/java/com/iohao/mmo/common/processor/hook/MyRequestMessageClientProcessorHook.java

@@ -0,0 +1,114 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.common.processor.hook;
+
+import com.iohao.game.action.skeleton.core.BarSkeleton;
+import com.iohao.game.action.skeleton.core.flow.FlowContext;
+import com.iohao.game.action.skeleton.protocol.HeadMetadata;
+import com.iohao.game.bolt.broker.core.common.processor.hook.RequestMessageClientProcessorHook;
+import com.iohao.game.common.kit.ExecutorKit;
+import com.iohao.game.common.kit.concurrent.ThreadCreator;
+import com.iohao.mmo.common.annotation.IoThread;
+
+import java.lang.reflect.Method;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ThreadFactory;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-24
+ */
+public final class MyRequestMessageClientProcessorHook implements RequestMessageClientProcessorHook {
+    final Executor[] executors;
+    final int executorLength;
+    final ExecutorService cacheThreadPool = ExecutorKit
+            .newCacheThreadPool("ioGameMMO");
+
+    public MyRequestMessageClientProcessorHook() {
+        int availableProcessors = availableProcessors2n();
+        executorLength = availableProcessors;
+        executors = new Executor[executorLength];
+
+        for (int i = 0; i < availableProcessors; i++) {
+            // 线程名:RequestMessage-线程总数-当前线程编号
+            int threadNo = i + 1;
+            String threadNamePrefix = String.format("RequestMessage-%s-%s", availableProcessors, threadNo);
+            executors[i] = ExecutorKit.newSingleThreadExecutor(new TheThreadFactory(threadNamePrefix));
+        }
+    }
+
+    @Override
+    public void processLogic(BarSkeleton barSkeleton, FlowContext flowContext) {
+
+        HeadMetadata headMetadata = flowContext.getRequest().getHeadMetadata();
+        Method actionMethod = flowContext.getActionCommand().getActionMethod();
+        var annotation = actionMethod.getAnnotation(IoThread.class);
+        if (Objects.nonNull(annotation)) {
+            cacheThreadPool.execute(() -> barSkeleton.handle(flowContext));
+            return;
+        }
+
+        long userId = flowContext.getUserId();
+
+        if (userId == 0) {
+            // 如果没有登录,使用 channelId 计算;如果 channelId 不存在,则使用 cmd
+            userId = Optional.ofNullable(headMetadata.getChannelId())
+                    .map(String::hashCode)
+                    .map(Math::abs)
+                    .orElseGet(headMetadata::getCmdMerge);
+        }
+
+        // 根据 userId 获取对应的 Executor
+        int index = (int) (userId & (executorLength - 1));
+
+        // 执行业务框架
+        executors[index].execute(() -> barSkeleton.handle(flowContext));
+    }
+
+    private int availableProcessors2n() {
+        int n = Runtime.getRuntime().availableProcessors();
+        n |= (n >> 1);
+        n |= (n >> 2);
+        n |= (n >> 4);
+        n |= (n >> 8);
+        n |= (n >> 16);
+        return (n + 1) >> 1;
+    }
+
+    private static class TheThreadFactory extends ThreadCreator implements ThreadFactory {
+
+        public TheThreadFactory(String threadNamePrefix) {
+            super(threadNamePrefix);
+            this.setDaemon(true);
+        }
+
+        @Override
+        public Thread newThread(Runnable runnable) {
+            return createThread(runnable);
+        }
+
+        @Override
+        protected String nextThreadName() {
+            return this.getThreadNamePrefix();
+        }
+    }
+}

+ 38 - 0
external/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 43 - 0
external/pom.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>external</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <!-- 数据载体 -->
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>all-provide</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <!-- 公共核心模块 -->
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-core</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <!-- 新版游戏对外服 -->
+        <dependency>
+            <groupId>com.iohao.game</groupId>
+            <artifactId>external-netty</artifactId>
+            <version>${ioGame.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 66 - 0
external/src/main/java/com/iohao/mmo/external/MyExternalServer.java

@@ -0,0 +1,66 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.external;
+
+import com.iohao.game.bolt.broker.core.client.BrokerAddress;
+import com.iohao.game.bolt.broker.core.common.IoGameGlobalConfig;
+import com.iohao.game.external.core.ExternalServer;
+import com.iohao.game.external.core.config.ExternalGlobalConfig;
+import com.iohao.game.external.core.config.ExternalJoinEnum;
+import com.iohao.game.external.core.netty.DefaultExternalServer;
+import com.iohao.game.external.core.netty.DefaultExternalServerBuilder;
+import com.iohao.mmo.login.cmd.LoginCmd;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+public class MyExternalServer {
+
+    public ExternalServer createExternalServer(int externalPort) {
+        extractedAccess();
+
+        // 游戏对外服 - 构建器
+        DefaultExternalServerBuilder builder = DefaultExternalServer.newBuilder(externalPort)
+                // websocket 方式连接;如果不设置,默认也是这个配置
+                .externalJoinEnum(ExternalJoinEnum.WEBSOCKET)
+                // Broker (游戏网关)的连接地址;如果不设置,默认也是这个配置
+                .brokerAddress(new BrokerAddress("127.0.0.1", IoGameGlobalConfig.brokerPort));
+
+        // 构建游戏对外服
+        return builder.build();
+    }
+
+    private static void extractedAccess() {
+        var accessAuthenticationHook = ExternalGlobalConfig.accessAuthenticationHook;
+        // 表示登录才能访问业务方法
+        accessAuthenticationHook.setVerifyIdentity(true);
+        // 添加不需要登录(身份验证)也能访问的业务方法 (action)
+        accessAuthenticationHook.addIgnoreAuthCmd(LoginCmd.cmd, LoginCmd.loginVerify);
+    }
+
+    public static void main(String[] args) {
+        // 游戏对外服端口
+        ExternalServer externalServer = new MyExternalServer()
+                .createExternalServer(ExternalGlobalConfig.externalPort);
+
+        externalServer.startup();
+    }
+
+}

+ 38 - 0
logic/all-logic/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 35 - 0
logic/all-logic/pom.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>all-logic</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>login-logic</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>person-logic</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 38 - 0
logic/login-logic/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 36 - 0
logic/login-logic/pom.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>login-logic</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>login-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <!-- 公共核心模块 -->
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-core</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 49 - 0
logic/login-logic/src/main/java/com/iohao/mmo/login/LoginLogicServer.java

@@ -0,0 +1,49 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.login;
+
+import com.iohao.game.action.skeleton.core.BarSkeleton;
+import com.iohao.game.action.skeleton.core.BarSkeletonBuilder;
+import com.iohao.game.action.skeleton.kit.LogicServerCreateKit;
+import com.iohao.game.bolt.broker.client.AbstractBrokerClientStartup;
+import com.iohao.game.bolt.broker.core.client.BrokerClientBuilder;
+import com.iohao.mmo.common.logic.server.LogicServerKit;
+import com.iohao.mmo.login.action.LoginAction;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+public class LoginLogicServer extends AbstractBrokerClientStartup {
+    @Override
+    public BarSkeleton createBarSkeleton() {
+        // 业务框架构建器
+        BarSkeletonBuilder builder = LogicServerCreateKit
+                .createBuilder(LoginAction.class);
+
+        return builder.build();
+    }
+
+    @Override
+    public BrokerClientBuilder createBrokerClientBuilder() {
+        BrokerClientBuilder builder = LogicServerKit.newBrokerClientBuilder();
+        builder.appName("登录逻辑服");
+        return builder;
+    }
+}

+ 75 - 0
logic/login-logic/src/main/java/com/iohao/mmo/login/action/LoginAction.java

@@ -0,0 +1,75 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.login.action;
+
+import com.github.javafaker.Faker;
+import com.github.javafaker.Name;
+import com.iohao.game.action.skeleton.annotation.ActionController;
+import com.iohao.game.action.skeleton.annotation.ActionMethod;
+import com.iohao.game.action.skeleton.core.flow.FlowContext;
+import com.iohao.game.bolt.broker.client.kit.UserIdSettingKit;
+import com.iohao.mmo.common.annotation.IoThread;
+import com.iohao.mmo.login.cmd.LoginCmd;
+import com.iohao.mmo.login.proto.LoginVerify;
+import com.iohao.mmo.login.proto.UserInfo;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.Locale;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+@Slf4j
+@ActionController(LoginCmd.cmd)
+public class LoginAction {
+    // cn name
+    static final Name name = new Faker(Locale.CHINA).name();
+
+    /**
+     * 登录验证
+     *
+     * @param loginVerify 登录
+     * @param flowContext flowContext
+     * @return 用户信息
+     */
+    @IoThread
+    @ActionMethod(LoginCmd.loginVerify)
+    public UserInfo loginVerify(LoginVerify loginVerify, FlowContext flowContext) {
+        /*
+         * 为了方便演示。
+         * 约定好 jwt 使用的 long 来登录。
+         * 后期在改为正常的。
+         */
+        long userId = Long.parseLong(loginVerify.jwt);
+
+        UserInfo userInfo = new UserInfo();
+        userInfo.id = userId;
+        userInfo.name = name.lastName() + name.firstName();
+
+        // channel 中设置用户的真实 userId;
+        boolean success = UserIdSettingKit.settingUserId(flowContext, userId);
+
+        if (!success) {
+            log.error("登录失败");
+        }
+
+        return userInfo;
+    }
+}

+ 38 - 0
logic/person-logic/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 35 - 0
logic/person-logic/pom.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>person-logic</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>person-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <!-- 公共核心模块 -->
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-core</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+</project>

+ 48 - 0
logic/person-logic/src/main/java/com/iohao/mmo/person/action/PersonAction.java

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

+ 58 - 0
logic/person-logic/src/main/java/com/iohao/mmo/person/entity/PersonBasicPropertyEntity.java

@@ -0,0 +1,58 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.person.entity;
+
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.FieldDefaults;
+
+/**
+ * 人物基础属性
+ *
+ * @author 渔民小镇
+ * @date 2023-07-24
+ */
+@Getter
+@Setter
+@FieldDefaults(level = AccessLevel.PRIVATE)
+public class PersonBasicPropertyEntity {
+    /** 生命值 */
+    int hp;
+    /** 魔法值 */
+    int mp;
+    /** 物理攻击 */
+    int physicsAttack;
+    /** 物理防御 */
+    int physicsDefense;
+    /** 魔法攻击 */
+    int magicAttack;
+    /** 魔法防御 */
+    int magicDefense;
+    /** 治疗强度 */
+    int treatAttack;
+    /** 封印强度 */
+    int sealAttack;
+    /** 封印防御(抵抗封印) */
+    int sealDefense;
+    /** 速度 */
+    int speed;
+    /** 怒气 */
+    int anger;
+}

+ 35 - 0
logic/person-logic/src/main/java/com/iohao/mmo/person/entity/PersonEntity.java

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

+ 36 - 0
logic/person-logic/src/main/java/com/iohao/mmo/person/service/PersonMapper.java

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

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

@@ -0,0 +1,62 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.person.service;
+
+import com.iohao.mmo.person.entity.PersonBasicPropertyEntity;
+import com.iohao.mmo.person.entity.PersonEntity;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.FieldDefaults;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-24
+ */
+@Getter
+@Setter
+@FieldDefaults(level = AccessLevel.PRIVATE)
+public class PersonService {
+    public PersonEntity getPersonEntity(String userId) {
+        //  临时数据
+        PersonBasicPropertyEntity basicProperty = getBasicPropertyTemp();
+
+        PersonEntity person = new PersonEntity();
+        person.setBasicProperty(basicProperty);
+        return person;
+    }
+
+    private static PersonBasicPropertyEntity getBasicPropertyTemp() {
+        PersonBasicPropertyEntity basicProperty = new PersonBasicPropertyEntity();
+        basicProperty.setHp(100);
+        basicProperty.setMp(100);
+        basicProperty.setPhysicsAttack(20);
+        basicProperty.setPhysicsDefense(10);
+
+        basicProperty.setMagicAttack(20);
+        basicProperty.setMagicDefense(10);
+
+        basicProperty.setTreatAttack(20);
+        basicProperty.setSealAttack(20);
+        basicProperty.setSealDefense(10);
+        basicProperty.setSpeed(50);
+        basicProperty.setAnger(0);
+        return basicProperty;
+    }
+}

+ 38 - 0
one-application/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 41 - 0
one-application/pom.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>one-application</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>all-logic</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>external</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>broker</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 71 - 0
one-application/src/main/java/com/iohao/mmo/app/OneApplication.java

@@ -0,0 +1,71 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.app;
+
+import com.iohao.game.bolt.broker.client.AbstractBrokerClientStartup;
+import com.iohao.game.bolt.broker.server.BrokerServer;
+import com.iohao.game.external.core.ExternalServer;
+import com.iohao.game.external.core.config.ExternalGlobalConfig;
+import com.iohao.game.external.core.netty.simple.NettyRunOne;
+import com.iohao.mmo.broker.MyBrokerServer;
+import com.iohao.mmo.external.MyExternalServer;
+import com.iohao.mmo.login.LoginLogicServer;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+@Slf4j
+public class OneApplication {
+    public static void main(String[] args) {
+
+        // 游戏逻辑服列表
+        List<AbstractBrokerClientStartup> logicServers = listLogic();
+
+        // 游戏对外服
+        ExternalServer externalServer = new MyExternalServer()
+                .createExternalServer(ExternalGlobalConfig.externalPort);
+
+        BrokerServer brokerServer = new MyBrokerServer()
+                .createBrokerServer();
+
+        new NettyRunOne()
+                // 游戏对外服
+                .setExternalServer(externalServer)
+                // Broker(游戏网关服)
+                .setBrokerServer(brokerServer)
+                // 游戏逻辑服列表
+                .setLogicServerList(logicServers)
+                // 启动游戏服务器
+                .startup();
+    }
+
+    private static List<AbstractBrokerClientStartup> listLogic() {
+        LoginLogicServer loginLogicServer = new LoginLogicServer();
+
+        // 游戏逻辑服列表
+        return List.of(
+                // 登录
+                loginLogicServer
+        );
+    }
+}

+ 113 - 0
one-application/src/main/resources/logback.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true">
+
+    <!-- 日志级别 -->
+    <property name="log.root.level" value="INFO"/>
+    <!-- 其他日志级别 -->
+    <property name="log.other.level" value="DEBUG"/>
+    <!-- 模块名称, 影响日志配置名,日志文件名 -->
+    <property name="log.moduleName" value="game"/>
+    <!--日志文件的保存路径,首先查找系统属性-Dlog.dir,如果存在就使用其;否则,在当前目录下创建名为logs目录做日志存放的目录 -->
+    <property name="log.base" value="${log.dir:-logs}/${log.moduleName}"/>
+    <property name="log.max.size" value="100MB"/> <!-- 日志文件大小,超过这个大小将被压缩 -->
+
+    <!-- 彩色日志 -->
+    <property name="log.pattern" value="%cyan(%d{HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %cyan(%method) %cyan(\\(%file:%line\\)) - %msg%n" />
+
+    <!--控制台输出 -->
+    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+            <!--            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}) - %highlight(%msg) %n</pattern>-->
+            <pattern>${log.pattern}</pattern>
+            <charset>utf8</charset>
+        </encoder>
+    </appender>
+
+    <!-- 用来保存输出所有级别的日志 -->
+    <appender name="file.all" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${log.base}/${log.moduleName}.log</File><!-- 设置日志不超过${log.max.size}时的保存路径,注意如果
+            是web项目会保存到Tomcat的bin目录 下 -->
+        <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件。 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${log.base}/archive/${log.moduleName}_all_%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern>
+            <!-- 文件输出日志 (文件大小策略进行文件输出,超过指定大小对文件备份) -->
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>${log.max.size}</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 日志输出的文件的格式 -->
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level[%thread]%logger{80}.%method:%L -%msg%n</pattern>
+        </layout>
+    </appender>
+
+    <!-- 这也是用来保存输出所有级别的日志 -->
+    <appender name="file.all.other" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${log.base}/${log.moduleName}_other.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${log.base}/archive/${log.moduleName}_other_%d{yyyy-MM-dd}.%i.log.zip
+            </FileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>${log.max.size}</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{56}.%method:%L -%msg%n</pattern>
+        </layout>
+    </appender>
+
+    <!-- 只用保存输出error级别的日志 -->
+    <appender name="file.error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${log.base}/${log.moduleName}_err.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${log.base}/archive/${log.moduleName}_err_%d{yyyy-MM-dd}.%i.log.zip
+            </FileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>${log.max.size}</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{56}.%method:%L - %msg%n</pattern>
+        </layout>
+        <!-- 下面为配置只输出error级别的日志 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+    <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+    <!-- 添加附加的appender,最多只能添加一个 -->
+    <appender name="file.async" class="ch.qos.logback.classic.AsyncAppender">
+        <discardingThreshold>0</discardingThreshold>
+        <queueSize>256</queueSize>
+        <includeCallerData>true</includeCallerData>
+        <appender-ref ref="file.all"/>
+    </appender>
+
+      <!-- 使用异步来记录其他信息-->
+    <appender name="file.async.other" class="ch.qos.logback.classic.AsyncAppender">
+        <discardingThreshold>0</discardingThreshold>
+        <queueSize>256</queueSize>
+        <includeCallerData>true</includeCallerData>
+        <appender-ref ref="file.all.other"/>
+    </appender>
+
+    <!-- 为某个包下的所有类的指定Appender 这里也可以指定类名称例如:com.aa.bb.ClassName -->
+    <logger name="com.iohao.mmo" additivity="false">
+        <level value="${log.root.level}"/>
+        <appender-ref ref="stdout"/>
+        <appender-ref ref="file.async"/><!-- 即com.iohao.game包下级别为 ${log.root.level}的才会使用file.async来打印 -->
+        <appender-ref ref="file.error"/>
+    </logger>
+
+    <!-- root将级别为${log.root.level}及大于${log.root.level}的日志信息交给已经配置好的名为“Console”的appender处理,“Console”appender将信息打印到Console,其它同理 -->
+    <root level="${log.root.level}">
+        <appender-ref ref="stdout"/> <!--  标识这个appender将会添加到这个logger -->
+        <appender-ref ref="file.async.other"/>
+        <appender-ref ref="file.error"/>
+    </root>
+</configuration>

+ 38 - 0
one-client/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 31 - 0
one-client/pom.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.example</groupId>
+    <artifactId>one-client</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>all-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+
+    </dependencies>
+
+</project>

+ 58 - 0
one-client/src/main/java/com/iohao/mmo/client/CommonClient.java

@@ -0,0 +1,58 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.client;
+
+import com.iohao.game.external.client.InputCommandRegion;
+import com.iohao.game.external.client.join.ClientRunOne;
+import com.iohao.game.external.client.user.ClientUser;
+import com.iohao.game.external.client.user.DefaultClientUser;
+import com.iohao.mmo.login.client.LoginInputCommandRegion;
+
+import java.util.List;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+public class CommonClient {
+    private static List<InputCommandRegion> listInputCommandRegion() {
+        LoginInputCommandRegion loginInputCommandRegion = new LoginInputCommandRegion();
+        // 模拟请求数据
+        return List.of(
+                // 登录
+                loginInputCommandRegion
+        );
+    }
+
+    static void start(long userId) {
+        // 客户端的用户(玩家)
+        ClientUser clientUser = new DefaultClientUser();
+        clientUser.setJwt(String.valueOf(userId));
+
+        List<InputCommandRegion> inputCommandRegions = listInputCommandRegion();
+
+        // 启动模拟客户端
+        new ClientRunOne()
+                .setClientUser(clientUser)
+                .setInputCommandRegions(inputCommandRegions)
+                .startup();
+    }
+
+
+}

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

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

+ 113 - 0
one-client/src/main/resources/logback.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true">
+
+    <!-- 日志级别 -->
+    <property name="log.root.level" value="INFO"/>
+    <!-- 其他日志级别 -->
+    <property name="log.other.level" value="DEBUG"/>
+    <!-- 模块名称, 影响日志配置名,日志文件名 -->
+    <property name="log.moduleName" value="game"/>
+    <!--日志文件的保存路径,首先查找系统属性-Dlog.dir,如果存在就使用其;否则,在当前目录下创建名为logs目录做日志存放的目录 -->
+    <property name="log.base" value="${log.dir:-logs}/${log.moduleName}"/>
+    <property name="log.max.size" value="100MB"/> <!-- 日志文件大小,超过这个大小将被压缩 -->
+
+    <!-- 彩色日志 -->
+    <property name="log.pattern" value="%cyan(%d{HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %cyan(%method) %cyan(\\(%file:%line\\)) - %msg%n" />
+
+    <!--控制台输出 -->
+    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+            <!--            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}) - %highlight(%msg) %n</pattern>-->
+            <pattern>${log.pattern}</pattern>
+            <charset>utf8</charset>
+        </encoder>
+    </appender>
+
+    <!-- 用来保存输出所有级别的日志 -->
+    <appender name="file.all" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${log.base}/${log.moduleName}.log</File><!-- 设置日志不超过${log.max.size}时的保存路径,注意如果
+            是web项目会保存到Tomcat的bin目录 下 -->
+        <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件。 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${log.base}/archive/${log.moduleName}_all_%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern>
+            <!-- 文件输出日志 (文件大小策略进行文件输出,超过指定大小对文件备份) -->
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>${log.max.size}</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 日志输出的文件的格式 -->
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level[%thread]%logger{80}.%method:%L -%msg%n</pattern>
+        </layout>
+    </appender>
+
+    <!-- 这也是用来保存输出所有级别的日志 -->
+    <appender name="file.all.other" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${log.base}/${log.moduleName}_other.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${log.base}/archive/${log.moduleName}_other_%d{yyyy-MM-dd}.%i.log.zip
+            </FileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>${log.max.size}</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{56}.%method:%L -%msg%n</pattern>
+        </layout>
+    </appender>
+
+    <!-- 只用保存输出error级别的日志 -->
+    <appender name="file.error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>${log.base}/${log.moduleName}_err.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${log.base}/archive/${log.moduleName}_err_%d{yyyy-MM-dd}.%i.log.zip
+            </FileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>${log.max.size}</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{56}.%method:%L - %msg%n</pattern>
+        </layout>
+        <!-- 下面为配置只输出error级别的日志 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+    <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+    <!-- 添加附加的appender,最多只能添加一个 -->
+    <appender name="file.async" class="ch.qos.logback.classic.AsyncAppender">
+        <discardingThreshold>0</discardingThreshold>
+        <queueSize>256</queueSize>
+        <includeCallerData>true</includeCallerData>
+        <appender-ref ref="file.all"/>
+    </appender>
+
+      <!-- 使用异步来记录其他信息-->
+    <appender name="file.async.other" class="ch.qos.logback.classic.AsyncAppender">
+        <discardingThreshold>0</discardingThreshold>
+        <queueSize>256</queueSize>
+        <includeCallerData>true</includeCallerData>
+        <appender-ref ref="file.all.other"/>
+    </appender>
+
+    <!-- 为某个包下的所有类的指定Appender 这里也可以指定类名称例如:com.aa.bb.ClassName -->
+    <logger name="com.iohao.mmo" additivity="false">
+        <level value="${log.root.level}"/>
+        <appender-ref ref="stdout"/>
+        <appender-ref ref="file.async"/><!-- 即com.iohao.game包下级别为 ${log.root.level}的才会使用file.async来打印 -->
+        <appender-ref ref="file.error"/>
+    </logger>
+
+    <!-- root将级别为${log.root.level}及大于${log.root.level}的日志信息交给已经配置好的名为“Console”的appender处理,“Console”appender将信息打印到Console,其它同理 -->
+    <root level="${log.root.level}">
+        <appender-ref ref="stdout"/> <!--  标识这个appender将会添加到这个logger -->
+        <appender-ref ref="file.async.other"/>
+        <appender-ref ref="file.error"/>
+    </root>
+</configuration>

+ 210 - 0
pom.xml

@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.iohao.mmo</groupId>
+    <artifactId>game</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <modules>
+        <!-- 公共模块,存放一些所有模块都要使用的 -->
+        <module>common/common-core</module>
+        <!-- 游戏对外服 -->
+        <module>external</module>
+        <!-- Broker(游戏网关) -->
+        <module>broker</module>
+        <!-- 多服单进程启动模块 -->
+        <module>one-application</module>
+        <module>one-client</module>
+
+
+        <module>logic/all-logic</module>
+        <!-- 游戏逻辑服 - 登录 -->
+        <module>logic/login-logic</module>
+
+        <module>provide/all-provide</module>
+        <module>provide/common-provide</module>
+        <!-- 对外提供的模块数据 - 登录 -->
+        <module>provide/login-provide</module>
+        <module>logic/person-logic</module>
+        <module>provide/person-provide</module>
+
+    </modules>
+
+    <properties>
+        <!-- jdk 版本 -->
+        <java.version>17</java.version>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <encoding>UTF-8</encoding>
+
+        <!-- 项目版本 -->
+        <ioGame.version>17.1.47</ioGame.version>
+        <!-- lombok 消除冗长的 Java 代码 https://mvnrepository.com/artifact/org.projectlombok/lombok -->
+        <lombok.version>1.18.24</lombok.version>
+        <!-- redis internal : https://mvnrepository.com/artifact/org.redisson/redisson -->
+        <redisson.version>3.17.3</redisson.version>
+
+        <!-- JSR380 bean 验证框架 https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
+        <hibernate-validator.version>7.0.4.Final</hibernate-validator.version>
+        <!-- JSR380 https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api -->
+        <jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
+        <!-- JSR380 https://mvnrepository.com/artifact/org.glassfish/jakarta.el -->
+        <jakarta.el.version>4.0.2</jakarta.el.version>
+
+        <!-- Java 实体映射工具 https://mvnrepository.com/artifact/org.mapstruct/mapstruct https://mapstruct.org/documentation/reference-guide/ -->
+        <org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
+
+        <!--  junit https://mvnrepository.com/artifact/junit/junit  -->
+        <junit.version>4.13.2</junit.version>
+        <!-- 演示用的假数据 https://mvnrepository.com/artifact/com.github.javafaker/javafaker -->
+        <javafaker.version>1.0.2</javafaker.version>
+
+        <!-- slf4j https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
+        <slf4j-api.version>1.7.36</slf4j-api.version>
+        <!-- slf4j https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
+        <logback.version>1.2.11</logback.version>
+
+    </properties>
+
+    <dependencies>
+        <!-- 单体应用启动 -->
+        <dependency>
+            <groupId>com.iohao.game</groupId>
+            <artifactId>run-one-netty</artifactId>
+            <version>${ioGame.version}</version>
+        </dependency>
+
+
+
+        <!-- https://mvnrepository.com/artifact/com.github.javafaker/javafaker -->
+        <dependency>
+            <groupId>com.github.javafaker</groupId>
+            <artifactId>javafaker</artifactId>
+            <version>1.0.2</version>
+        </dependency>
+
+        <!-- lombok 简化 java 代码 -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>${lombok.version}</version>
+            <optional>true</optional>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/org.mapstruct/mapstruct -->
+        <dependency>
+            <groupId>org.mapstruct</groupId>
+            <artifactId>mapstruct</artifactId>
+            <version>${org.mapstruct.version}</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4j-api.version}</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>${logback.version}</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/junit/junit -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>3.1.0</version>
+            </plugin>
+
+            <!--
+            编译插件
+            mvn compile
+            To compile your test sources, you'll do:
+            mvn test-compile
+            -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+                <configuration>
+                    <compilerVersion>${java.version}</compilerVersion>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <!-- maven 3.6.2及之后加上编译参数,可以让我们在运行期获取方法参数名称。 -->
+                    <parameters>true</parameters>
+                    <skip>true</skip>
+                    <!-- JDK9+ with module-info.java -->
+                    <annotationProcessorPaths>
+                        <!-- 实体映射工具 -->
+                        <path>
+                            <groupId>org.mapstruct</groupId>
+                            <artifactId>mapstruct-processor</artifactId>
+                            <version>${org.mapstruct.version}</version>
+                        </path>
+
+                        <!-- lombok 消除冗长的 Java 代码 -->
+                        <path>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                            <version>${lombok.version}</version>
+                        </path>
+                        <!-- additional annotation processor required as of Lombok 1.18.16 -->
+                        <!-- mapStruct 支持 lombok -->
+                        <path>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok-mapstruct-binding</artifactId>
+                            <version>0.2.0</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+
+            <!-- 打包时跳过单元测试 https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>3.0.0-M5</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+
+            <!-- 打包源码 https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-source-plugin -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>3.2.1</version>
+                <configuration>
+                    <attach>true</attach>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>

+ 38 - 0
provide/all-provide/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 35 - 0
provide/all-provide/pom.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>all-provide</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>login-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 38 - 0
provide/common-provide/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 35 - 0
provide/common-provide/pom.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>common-provide</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <dependencies>
+        <!-- 模拟客户端请求模块 https://www.yuque.com/iohao/game/tc83ud -->
+        <dependency>
+            <groupId>com.iohao.game</groupId>
+            <artifactId>light-client</artifactId>
+            <version>${ioGame.version}</version>
+        </dependency>
+
+        <!-- protobuf 模块 https://www.yuque.com/iohao/game/vpe2t6 -->
+        <dependency>
+            <groupId>com.iohao.game</groupId>
+            <artifactId>light-jprotobuf</artifactId>
+            <version>${ioGame.version}</version>
+        </dependency>
+    </dependencies>
+</project>

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

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

+ 38 - 0
provide/login-provide/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 29 - 0
provide/login-provide/pom.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>login-provide</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>

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

@@ -0,0 +1,66 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.login.client;
+
+import com.iohao.game.common.kit.InternalKit;
+import com.iohao.game.common.kit.StrKit;
+import com.iohao.game.external.client.AbstractInputCommandRegion;
+import com.iohao.game.external.client.command.InputRequestData;
+import com.iohao.game.external.client.kit.AssertKit;
+import com.iohao.mmo.login.cmd.LoginCmd;
+import com.iohao.mmo.login.proto.LoginVerify;
+import com.iohao.mmo.login.proto.UserInfo;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author 渔民小镇
+ * @date 2023-07-21
+ */
+@Slf4j
+public class LoginInputCommandRegion extends AbstractInputCommandRegion {
+    @Override
+    public void initInputCommand() {
+        this.inputCommandCreate.cmd = LoginCmd.cmd;
+
+        String jwt = clientUser.getJwt();
+        AssertKit.assertTrueThrow(StrKit.isEmpty(jwt), "必须设置登录用的 jwt");
+
+        // 动态请求参数
+        InputRequestData inputRequestData = () -> {
+            // 请求参数
+            LoginVerify loginVerify = new LoginVerify();
+            loginVerify.jwt = clientUser.getJwt();
+            return loginVerify;
+        };
+
+        ofCommand(LoginCmd.loginVerify).callback(UserInfo.class, result -> {
+            UserInfo userInfo = result.getValue();
+            log.info("登录成功 : {}", userInfo);
+            clientUser.setUserId(userInfo.id);
+            clientUser.setNickname(userInfo.name);
+        }).setDescription("登录").setInputRequestData(inputRequestData);
+
+        InternalKit.newTimeout(task -> {
+            // 自动登录
+            ofRequestCommand(LoginCmd.loginVerify).request();
+        }, 200, TimeUnit.MILLISECONDS);
+    }
+}

+ 31 - 0
provide/login-provide/src/main/java/com/iohao/mmo/login/cmd/LoginCmd.java

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

+ 35 - 0
provide/login-provide/src/main/java/com/iohao/mmo/login/proto/LoginVerify.java

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

+ 38 - 0
provide/login-provide/src/main/java/com/iohao/mmo/login/proto/UserInfo.java

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

+ 38 - 0
provide/person-provide/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 28 - 0
provide/person-provide/pom.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.iohao.mmo</groupId>
+        <artifactId>game</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>person-provide</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.iohao.mmo</groupId>
+            <artifactId>common-provide</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+    </dependencies>
+</project>

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

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

+ 58 - 0
provide/person-provide/src/main/java/com/iohao/mmo/person/proto/PersonBasicPropertyMessage.java

@@ -0,0 +1,58 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.person.proto;
+
+import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
+import lombok.AccessLevel;
+import lombok.ToString;
+import lombok.experimental.FieldDefaults;
+
+/**
+ * 人物基础属性
+ *
+ * @author 渔民小镇
+ * @date 2023-07-23
+ */
+@ToString
+@ProtobufClass
+@FieldDefaults(level = AccessLevel.PUBLIC)
+public class PersonBasicPropertyMessage {
+    /** 生命值 */
+    int hp;
+    /** 魔法值 */
+    int mp;
+    /** 物理攻击 */
+    int physicsAttack;
+    /** 物理防御 */
+    int physicsDefense;
+    /** 魔法攻击 */
+    int magicAttack;
+    /** 魔法防御 */
+    int magicDefense;
+    /** 治疗强度 */
+    int treatAttack;
+    /** 封印强度 */
+    int sealAttack;
+    /** 封印防御(抵抗封印) */
+    int sealDefense;
+    /** 速度 */
+    int speed;
+    /** 怒气 */
+    int anger;
+}

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

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

+ 92 - 0
运营权.md

@@ -0,0 +1,92 @@
+## 运营权相关
+
+在没有向我们取得运营权时,不可使用项目中的代码用于线上运营。
+
+
+
+开发者以学习为目的的,可以不需要往下看。
+
+
+
+### 如何获得授权沟通码
+
+如果你是持续型的付费用户,将有资格申请一个【授权沟通码】。
+
+
+
+付费用户可以向我们申请授权沟通码,每年需要支付 1999 RMB 的费用,授权沟通码数量是有上限的,先到先得,且只能使用一次,数量只会越来越少。从前期来看,此授权沟通码或许没什么价值,但到了后期你才会知道该授权沟通码的重要性。
+
+
+
+我们会将授权沟通码以邮箱的形式发放,双方保留记录,使其具备法律效力。
+
+
+
+### 授权沟通码的作用
+
+当我们教学系列的项目接近成品时,就会有公司想要拿来运营。在运营前需要向我们取得授权,而授权沟通码就是取得授权的第一步。如果公司没有授权沟通码,而又想运营该产品,有两种方式:
+
+1. 可以向官方购买,价格是 35 万起步。
+2. 向手上有授权沟通码的用户购买,价格自定义。
+
+
+
+我们是建议先向用户购买,因为价格可自定义。大体流程就是,需求方公司发布一个价格,我们会给所有手上拥有授权沟通码的用户发消息,询问用户是否愿意出售手上的授权沟通码。询问的顺序是按日期排序,越早获得授权沟通码的用户将优先得到询问。
+
+
+
+举例:需求方公司需要一个授权沟通码,定价 7 万;我们会按照优先级,挨个询问拥有授权沟通码的用户,问其是否愿意出售。
+
+
+
+我们的目的很明确,优先照顾早期给予我们帮助的付费用户。
+
+
+
+### 运营权
+
+在需求方公司取得授权沟通码后,可以与我们洽谈具体合作内容,洽谈内容大致是运营后的盈利分配问题。
+
+| 代表方                       | 盈利占比分配           |
+| ---------------------------- | ---------------------- |
+| ioGame 方                    | 10%                    |
+| 需求方公司项目开发组、运维组 | 至少占比 25%,多多益善 |
+| 需求方公司                   | 65%                    |
+
+
+
+总体来说需要保证多方的利益的分配,并确保需求方项目组内成员的利益。为了防止需求方公司给自己团队的员工画饼,我们会要求将盈利分配方案写入合同中,并由我们转发给项目组成员。
+
+
+
+当确定合作后,我们将运营权授权给需求方公司,并签定相关合同。
+
+
+
+当使用授权沟通码与我们签定相关合同后,此授权沟通码也将失效。
+
+
+
+### 没有取得授权而使用产品运营的案例
+
+提示:在与我们沟通产品运营权相关内容时,需要有授权沟通码;
+
+
+
+[员工窃取公司游戏源代码,半年盈利 1.5 亿](https://www.oschina.net/news/247569)
+
+
+
+[3名员工盗用公司游戏代码 半年赚了1.5亿](https://www.sohu.com/a/692270782_99900743)
+
+
+
+[员工盗公司游戏代码半年赚了1.5亿](https://www.163.com/dy/article/I8DAOIA205118DFD.html)
+
+
+
+如果你所在的公司,在没有向我们取得运营权时,就运营了此产品,请向我们提供有效证据。我们承诺在除去相关费用和官司结束后,将所得赔偿 70% 分配给你。
+
+
+
+介绍了授权沟通码的作用,谈到了取得运营权后各方利益的分配问题。我们会将所得利润继续投入到产品的研发中。