- 此项目是棋牌,是pomelo + cocos creator学习最佳入门项目
- 服务器api接口文档参考: doc/棋牌服务器API.md
- node 版本:6.11.1
- sh 1-cnpm-install (npm网速太慢安装不上,只好使用cnpm安装)
- 新建logs目录,不然运行报错
- mysql版本: 5.6+
- 进入mysql终端,登陆mysql,并且用source命令导入数据库
➜ ~ mysql -u root -p
Enter password: jianan
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.20 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> source /Users/jianan/Documents/study/NiuNiu-creator-pomelo/game-server/app/dao/mysql/chess.sql
Query OK, 1 row affected (0.00 sec)
Database changed
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
game-server/config/mysql.json
把该文件中的user
和password
修改为上一步中mysql设置的用户名和密码
cd chess/game-server
pomelo start
到这里,如果不出意外,服务器就安装结束并且启动啦
- CocosCreator版本: 1.9.3
- 效果图:
- 1.就在于 channel和gameRoom的绑定,这样保证一个房间独立出来。
- 2.DouniuRoom调用startGame,驱动游戏的开始。
- 3.mysql数据库虽然有多份实例,所有的数据库其实就是mysql数据库的一个客户端. 数据库服务器只有一个,因此暂时对于小用户量用户 来说,足够了