计算机中国象棋网络对弈软件毕业设计
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
┊┊┊┊┊┊┊┊┊┊┊┊┊装┊┊┊┊┊订┊┊┊┊┊线┊┊┊┊┊┊┊┊┊┊┊┊┊
摘要
中国象棋网络版是一款可以实现多人同时在线的网络对弈象棋软件。
中国象棋网络版采用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 and 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)