基于JAVA中国象棋网络对弈软件毕业设计

摘要
中国象棋网络版是一款可以实现多人同时在线的网络对弈象棋软件。
中国象棋网络版采用C/S架构,由跨平台的Java语言和MySQ L数据库开发,在开发过程中使用了多线程、java swing、Socket编程以及TCP和UDP协议等技术。中国象棋网络版提供了:棋友状态列表,弈棋邀请,观看他人弈棋,棋谱记录和保存,在线交流,快速注册等功能。服务端提供了:发布系统消息提示,服务器状态显示,在线棋友管理等功能。最后,对系统进行测试表明,系统功能达到了预期的要求,实现与同类的象棋软件如QQ象棋类似的功能,具有界面友好,操作简便,运行稳定的特点,完成设计要求的功能。本系统不足之处在于没有实现人机对弈、聊天记录的本机存储,将在以后的更新版本中逐步完善。
关键词:对弈,Java,多线程
Abstract
Chinese chess online is a software can support multiplayer play chess online at the same time .
The chinese chess online, based on the architecture of C/S, is developed by MySQL database and Java, a cross-platform language. In the development, multi-thread, Java swing, Socket programming a
nd TCP/UDP protocol are applied. First, the newer can fast register and then get an account in the network version. The players can invite others to join, watch others playing, communicate with others online and hold chess-playing records. Of course ,there exists a status bar to check the states of all chess players. Here the service releases the notes of the system information, displays the state of itself, and deal with chess players online, etc. The test of the system indicates, all the expected functions have been realized. It has the similar functions just like the QQ chess, an online software of kind. The interface is on good terms, and the operation is easy, and also it runs stably. However, disappointingly, the computer can't be an opponent of the players, and the users' computer can't keep the chat records itself. These are both the weak points and the improvements will be made in the new version.
Keywords: chess-playing , Java, Multithreading
目录
1. 前言 (1)
1.1课题的研究目的和意义 (1)
1.2开发和运行环境 (1)
1.2.1开发环境 (1)
1.2.2运行环境 (1)
2.JAVA和网络套接字技术 (2)
摆线齿轮2.1J AVA简介 (2)
2.2J AVA图形技术 (2)
2.3J AVA事件响应技术 (4)
2.3.1鼠标事件响应 (4)
2.3.2键盘事件响应 (4)
2.4网络网络通信技术 (4)
2.4.1 TCP (4)
2.4.2 UDP (4)
2.4.3 Socket (5)
2.4.4 Java实现 (5)
3.中国象棋网络版架构设计与通信设计 (7)
3.1中国象棋网络版架构分析与设计 (7)
3.2中国象棋网络版数据通信设计与实现 (7)
3.2.1通信协议选择 (7)
3.2.2数据类型分析 (9)
3.2.3数据格式设计 (11)
3.2.4数据通信与处理伪码示例 (13)
4.中国象棋网络版客户端实现 (16)
4.1客户端基础架构 (16)
4.2客户端GUI设计 (16)
4.2.1弈棋主面板 (16)
4.2.2用户列表面板 (17)
4.2.3棋谱记录面板 (17)
4.2.4用户交流面板 (17)
4.3客户端类设计 (18)
4.3.1 chessboardP (18)
4.3.2 userP (18)
4.3.3 chessstateP (19)
4.3.4 chatP (19)
4.3.5数据处理相关类 (19)
宇山自动化
4.4客户端主要算法伪码示例 (20)
4.4.1棋子和棋盘状态维护算法简介 (20)
4.4.2棋盘规则马规则伪码示例 (20)
4.4.3棋子选择和移动伪码示例 (20)
4.4.4棋谱生成部分伪码示例 (21)
4.4.5棋局结果判定伪码示例 (22)
4.4.6通信数据处理和分发算法简介 (22)
4.4.7棋子选中闪烁算法简介 (22)
5.中国象棋网络版服务器端实现 (23)
5.1服务器端基础架构 (23)
5.2服务器端GUI设计 (24)
长春密刺生态仪5.3服务器端类设计 (25)
5.3.1 serverGUI (25)
5.3.2 serverListener (25)
5.3.3 chessroom (26)
5.3.4 databaseinterface (26)
5.4数据库相关开发 (26)
5.4.1数据库需求分析 (26)
5.4.2数据库表设计 (26)
5.5服务器端主要算法伪码示例 (27)
5.5.1登录注册时与数据库交互伪码示例 (27)
5.5.2弈棋聊天用户列表维护数据转发算法简介 (28)
5.5.3 MD5加密产生密匙伪码示例 (28)
5.5.4踢用户下线伪码示例 (28)
6.中国象棋网络版运行测试 (30)
6.1.客户端功能测试 (30)
6.1.1用户上线响应异常 (30)
6.1.2弈棋过程中将可以出九宫异常 (31)
6.2服务器端测试 (32)
6.2.1用户下线后服务器在线用户数统计异常 (32)
6.2.2对正在弈棋的用户强制下线异常 (33)
6.3测试总结 (33)
结束语 (34)
致谢 (35)
参考文献 (36)
附录 (37)
1.前言
1.1  课题的研究目的和意义
本课题的目的是采用Java语言编写实现网络象棋对弈软件,实现中国象棋的网络对弈,拥有用户列表、棋谱查看保存、在线交流等功能。
虽然现在已经有了许多网络对弈软件,其中大多数都很优秀,所以本课题不作对比性开发。通过中国象棋网络版的开发熟练掌握在Eclipse下的Java开发,详细了解Socket网络套接字技术、TCP和UDP协议,掌握MySQL应用。
1.2开发和运行环境
1.2.1开发环境
操作系统Windows7
开发平台 MyEcilpse 8.5
雪莲生发液
JDK1.6.0_17新型大棚骨架
数据库  MySQL5.1
MySQL Workbench 5.2 CE
1.2.2运行环境
Window 7、Windows xp等各类支持Java的操作系统。

本文发布于:2024-09-22 14:34:54,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/2/220067.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:伪码   示例   中国象棋   网络版   实现   用户
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议