commit 63c4a7927e6f14501b3cf6a7adabe0d89b3609ca Author: 贝密游戏 Date: Thu Dec 21 22:58:23 2017 +0800 1、清理仓库 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2c5d9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/.idea +*.iml +/docker/mysql/data +/data +/target \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..23f66c7 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,102 @@ +# 编译调试部署说明 + +### 1. 服务器编译 + +#### 安装调试的前提要求 + +必须安装了 maven,和 MySQL。 + +#### 修改数据库连接地址 + + +修改 src/main/resources/application.properties 文件下面三个地方,改成自己的MySQL服务器的ip地址和帐号密码 + +spring.datasource.url=jdbc:mysql://localhost:3306/beimi?useUnicode=true&characterEncoding=UTF-8 +spring.datasource.username=root +spring.datasource.password= + + +#### 用 maven 安装两个依赖包 + +这两个包已经在项目中,不需要下载,执行下面命令即可。 + +mvn install:install-file -Dfile=src/main/resources/WEB-INF/lib/jave-1.0.2.jar -DgroupId=lt.jave -DartifactId=jave -Dversion=1.0.2 -Dpackaging=jar + +mvn install:install-file -Dfile=src/main/resources/WEB-INF/lib/ip2region-1.2.4.jar -DgroupId=org.lionsoul.ip2region -DartifactId=ip2region -Dversion=1.2.4 -Dpackaging=jar + +#### 编译代码 + +mvn compile + +#### 运行服务器端 + + +mvn spring-boot:start + +可以如下面这样,在运行时添加一些环境变量 + +mvn spring-boot:start -Drun.jvmArguments='-Dserver.port=8080' + +#### 编译打包服务器端 + +mvn package + +打包完成后会在项目根目录生成一个 target 目录,里面的 beimi-0.7.0.war 文件是打包完成的文件。 + +#### 运行编译后war + +java -Xms1240m -Xmx1240m -Xmn450m -XX:PermSize=512M -XX:MaxPermSize=512m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:NewSize=128m -XX:MaxTenuringThreshold=0 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+PrintGCDetails -Xloggc:gc.log -jar target/beimi-0.7.0.war + + + +### 2. 客户端编译流程 + +客户端代码位置在: client/version/chess + +#### 打开客户端项目 + +用 CocosCreater 打开 client/version/chess 项目。 + + +----用 CocosCreater 创建一个空白新项目 删除 assets和settings两个目录,将 client/version/chess 下的 assets 和 settings 目录cp不过去。---- + +#### 修改服务器ip地址 + +修改 client/version/chess/assets/resources/script/lib/HTTP.js 文件里的下面两句,改成自己的IP和端口号 + +baseURL:"http://localhost", +wsURL : "http://localhost:9081", + +#### 启动 CocosCreater 调试 + +然后用 CocosCreater 运行。 + + +### 3. 基于 docker 编译 + + +#### 编译 docker 镜像前的准备 + +1. 数据库连接地址需要改成 beimi,这个名字是在 docker-compose.yml 里设置的一个 docker 别名。(在 application.properties 里改) + +2. docker 启动后 mysql 数据库需要初始化数据结构和内容,初始化文件在 script/beimi.sql 。这个做一次即可,整个mysql容器的数据都存在 docker/mysql/data 目录下。只要这个目录不删除数据一直存在。可以反复重启或者删除docker容器数据都会存在。 + +3. 编译 docker 镜像之前必须使用 CocosCreater 发布一下项目,而且需要使用手机版发布。如果没有用手机版发布,需要到docker-compose.yml里,找到 beimi-client > volumes 标签,由 web-mobile 换成 desktop。 + + +#### 执行编译镜像 + +mvn clean package docker:build + +#### 启动docker容器(包括,mysql,beimi server,beimi client共三个容器) + +docker-compose up -d + +#### 关闭并删除所有容器 + +docker-compose down + +注意:docker-compose down 并不会删除数据库内容,因为数据库内容存在目录里。 + + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3865107 --- /dev/null +++ b/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "{}" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright 2017 贝密游戏 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc10798 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +#beimi + +最新版 0.7.0 + +开源棋牌游戏,包含麻将、德州、斗地主。首个版本会采用当前最流行的房卡模式。 + +贝密游戏是一系列棋牌游戏的名称,其中包含麻将、斗地主、德州,目前正在进行UI设计以及后台系统(JAVA)开发,7月中发布0.1.0版本,仅包含前端UI方案,预计8月份发布首个版本,敬请关注! + + +1. 开发工具:Cocos Creater +1. 开发语言:Java + JavaScript +1. 服务端框架:Spring Boot + MySQL + JPA + NettySocketIO +1. 客户端语言:Cocos Creater/JavaScript + + ** +细安装过程请查阅:[安装说明](INSTALL.md) +** + + +加入QQ群,了解最新开发进度 ,QQ群号: 529311623 + +[![输入图片说明](https://git.oschina.net/uploads/images/2017/0609/233259_8ab02715_1387891.png "在这里输入图片标题")](http:////shang.qq.com/wpa/qunwpa?idkey=3735ebb729ef696009be07fa2e2eba7feee6acf89c07e6e68a9b56504d9fabd0) + +UI效果图: +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192826_1d6f397f_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0709/131509_9a969010_1387891.jpeg "在这里输入图片标题") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192845_5526c6bf_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192900_a0dee563_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192913_d65bc3cd_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192926_298b49ff_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192938_28a2548f_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/192954_eeba8b49_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0719/193004_066f1ad5_1387891.png "屏幕截图.png") +![输入图片说明](https://git.oschina.net/uploads/images/2017/0709/131509_9a969010_1387891.jpeg "在这里输入图片标题") diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1c9d0fb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,37 @@ +version: '2' + +services: + mysql: + image: mysql + ports: + - 3306:3306 + environment: + MYSQL_ROOT_PASSWORD: 123456 + MYSQL_DATABASE: beimi + volumes: + - ./docker/mysql/conf:/etc/mysql/conf.d + - ./docker/mysql/data:/var/lib/mysql + command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + beimi: + image: beimi:latest + depends_on: + - mysql + links: + - mysql + ports: + # 后台管理地址的端口号 + - 8080:8080 + # socket端口号 + - 9081:9081 + beimi-client: + image: nginx + depends_on: + - beimi + links: + - beimi + volumes: + # 使用CocosCreator打包发布的地址,如果是桌面应用 web-mobile 换成 desktop + - ./client/version/chess/build/web-mobile:/usr/share/nginx/html + ports: + # 游戏界面的访问端口号 + - 8081:80 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..a783e15 --- /dev/null +++ b/pom.xml @@ -0,0 +1,408 @@ + + 4.0.0 + + com.beimi + beimi + 0.8.0 + war + + chess + 贝密游戏 + + + org.springframework.boot + spring-boot-starter-parent + 1.5.6.RELEASE + + + + UTF-8 + 1.8 + 7.1.0.Final + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-freemarker + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + org.freemarker + freemarker + + + + org.springframework.data + spring-data-jpa + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + mysql + mysql-connector-java + + + net.java.dev.jna + jna + 4.1.0 + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.boot + spring-boot-starter-security + + + + org.springframework.boot + spring-boot-starter-aop + + + + org.springframework.data + spring-data-elasticsearch + + + + org.jasypt + jasypt + 1.9.2 + + + + com.alibaba + fastjson + 1.2.37 + + + + org + jaudiotagger + 2.0.1 + + + + lt.jave + jave + 1.0.2 + + + + commons-codec + commons-codec + + + + commons-lang + commons-lang + 2.6 + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + + commons-beanutils + commons-beanutils + 1.8.0 + + + + com.corundumstudio.socketio + netty-socketio + 1.7.12 + + + commons-io + commons-io + 2.4 + + + + org.springframework + spring-context-support + + + com.hazelcast + hazelcast + 3.8 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + + + + com.alibaba + druid + 1.0.27 + + + + org.lionsoul.ip2region + ip2region + 1.2.4 + + + + com.lmax + disruptor + 3.3.6 + + + + org.apache.poi + poi + 3.15 + + + org.apache.poi + poi-ooxml + 3.15 + + + + net.coobird + thumbnailator + 0.4.8 + + + + com.github.binarywang + weixin-java-mp + 2.6.0 + + + + + org.jsoup + jsoup + 1.10.2 + + + + + commons-dbutils + commons-dbutils + 1.6 + + + + joda-time + joda-time + + + + de.odysseus.juel + juel-impl + 2.2.7 + + + + com.fasterxml.jackson.core + jackson-core + + + + + cglib + cglib + 3.2.5 + + + + org.drools + drools-core + ${drools.version} + + + org.drools + drools-compiler + ${drools.version} + + + org.drools + drools-decisiontables + ${drools.version} + + + org.drools + drools-templates + ${drools.version} + + + + org.kie + kie-api + ${drools.version} + + + + org.ehcache + ehcache + 3.3.1 + + + + org.cache2k + cache2k-core + 1.0.1.Final + + + + org.kie + kie-spring + ${drools.version} + + + + org.springframework + spring-tx + + + org.springframework + spring-beans + + + org.springframework + spring-core + + + org.springframework + spring-context + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + maven-compiler-plugin + + 1.7 + 1.7 + UTF-8 + + + + + org.apache.maven.plugins + maven-war-plugin + + true + + + + + com.spotify + docker-maven-plugin + 1.0.0 + + + + beimi + java + ["java", "-jar", "/${project.build.finalName}.war"] + + + / + ${project.build.directory} + ${project.build.finalName}.war + + + + + + + compile + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-dependency-plugin + + + [2.10,) + + + unpack + + + + + + + + + + + + + + + + + SPRING-LIBS-snapshot + https://repo.spring.io/libs-milestone + + + mvn_repository + MVNREPOSITORY + http://repo1.maven.org/maven2 + + + + + + SPRING-LIBS-snapshot + https://repo.spring.io/libs-milestone + + +