- If you have java environment and node.js environment and MySQL.(otherwise please download those)
- Connect mysql code in ./TanksServer/connPool.js . You can make changes to your configuration. And create TABLE sql in ./TanksServer/mysql.txt .
- Then if you finish please cd ./TanksServer && npm install && node Tank.js (To start server)
- Make changes ./src/TankClient.java in line 19 to your server address and port.
- running ./src/TankClient.java
Of course, you can make your server in java.
The socket data is simple string.
Example:
- Server accept data "daoerche 86"; (username score)
- Server send data "dxm 195 1 txc 189 2 baba 188 3 hhh 111 4 daoerche 76 5 123456 70 6 thq 38 7 daoerche 0 5"; (user1 score1 1[This is Rank] user2 score2 2 ... user7 score7 7 currentUser score highestRank)
The project code have a sufficient number of notes. If you want you can look over code in yourself.