没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
安徽工业大学 毕业设计(论文)说明书
摘 要
中国象棋网络版是一款可以实现多人同时在线的网络对弈象棋软件。
中国象棋网络版采用 架构,由跨平台的 语言和 数据库
开发,在开发过程中使用了多线程、、 编程以及 和
协议等技术。中国象棋网络版提供了:棋友状态列表,弈棋邀请,观看他
人弈棋,棋谱记录和保存,在线交流,快速注册等功能。服务端提供了:发布
系统消息提示,服务器状态显示,在线棋友管理等功能。最后,对系统进行测
试表明,系统功能达到了预期的要求,实现与同类的象棋软件如 QQ 象棋类似
的功能,具有界面友好,操作简便,运行稳定的特点,完成设计要求的功能。
本系统不足之处在于没有实现人机对弈、聊天记录的本机存储,将在以后的更
新版本中逐步完善。
关键词: 对弈,,多线程
装
订
线
安徽工业大学 毕业设计(论文)说明书
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.2 开发和运行环境........................................................................................................................... 1
1.2.1
开发环境
..................................................................................................................................1
1.2.2
运行环境
..................................................................................................................................1
. ! 和网络套接字技术
2.1 JAVA 简介........................................................................................................................................2
2.2 JAVA 图形技术................................................................................................................................2
2.3 JAVA 事件响应技术........................................................................................................................3
2.3.1
鼠标事件响应
..........................................................................................................................3
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.1 中国象棋网络版架构分析与设计................................................................................................6
3.2 中国象棋网络版数据通信设计与实现........................................................................................6
3.2.1
通信协议选择
..........................................................................................................................6
3.2.2
数据类型分析
..........................................................................................................................7
3.2.3
数据格式设计
........................................................................................................................10
3.2.4
数据通信与处理伪码示例
....................................................................................................12
$.中国象棋网络版客户端实现%
4.1 客户端基础架构.........................................................................................................................15
4.2 客户端 GUI 设计......................................................................................................................... 15
4.2.1
弈棋主面板
............................................................................................................................15
4.2.2
用户列表面板
........................................................................................................................16
4.2.3
棋谱记录面板
........................................................................................................................16
4.2.4
用户交流面板
........................................................................................................................16
4.3 客户端类设计.............................................................................................................................17
4.3.1 chessboardP............................................................................................................................17
4.3.2 userP.......................................................................................................................................17
装
订
线
安徽工业大学 毕业设计(论文)说明书
4.3.3 chessstateP.............................................................................................................................18
4.3.4 chatP.......................................................................................................................................18
4.3.5
数据处理相关类
....................................................................................................................18
4.4 客户端主要算法伪码示例.........................................................................................................19
4.4.1
棋子和棋盘状态维护算法简介
............................................................................................19
4.4.2
棋盘规则马规则伪码示例
....................................................................................................19
4.4.3
棋子选择和移动伪码示例
....................................................................................................19
4.4.4
棋谱生成部分伪码示例
........................................................................................................19
4.4.5
棋局结果判定伪码示例
........................................................................................................20
4.4.6
通信数据处理和分发算法简介
............................................................................................21
4.4.7
棋子选中闪烁算法简介
........................................................................................................21
%中国象棋网络版服务器端实现
5.1 服务器端基础架构..................................................................................................................... 22
5.2 服务器端 GUI 设计......................................................................................................................23
5.3 服务器端类设计.........................................................................................................................24
5.3.1 serverGUI................................................................................................................................24
5.3.2 serverListener..........................................................................................................................24
5.3.3 chessroom...............................................................................................................................24
5.3.4 databaseinterface...................................................................................................................25
5.4 数据库相关开发.........................................................................................................................25
5.4.1
数据库需求分析
....................................................................................................................25
5.4.2
数据库表设计
........................................................................................................................25
5.5 服务器端主要算法伪码示例......................................................................................................26
5.5.1
登录注册时与数据库交互伪码示例
....................................................................................26
5.5.2
弈棋聊天用户列表维护数据转发算法简介
........................................................................26
5.5.3 MD5
加密产生密匙伪码示例
................................................................................................27
5.5.4
踢用户下线伪码示例
............................................................................................................27
#.中国象棋网络版运行测试&
6.1.客户端功能测试.........................................................................................................................28
6.1.1
用户上线响应异常
...............................................................................................................28
6.1.2
弈棋过程中将可以出九宫异常
............................................................................................28
6.2 服务器端测试.............................................................................................................................29
6.2.1
用户下线后服务器在线用户数统计异常
............................................................................29
6.2.2
对正在弈棋的用户强制下线异常
........................................................................................30
6.3 测试总结..................................................................................................................................... 31
结束语"
致 谢""
参考文献"$
!
装
订
线
剩余53页未读,继续阅读
资源评论
- huoshandong2013-12-22不怎么的。。。。
- hanbaoliemail2014-09-11参考下吧,但和百度文库中的差不多
- fishyang19892014-04-17马马虎虎,将就用呗
yangyu_cn
- 粉丝: 3
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功