admin管理员组文章数量:1531521
2024年5月2日发(作者:)
沈阳理工大学学士学位论文
摘 要
本文详细介绍了一个网络对战军棋游戏的设计和实现。对于军棋游戏来说,规则非
常简单,就是按照先后顺序在棋盘上走棋吃子,直到一方最先将对方的“军旗”挖掉为胜。
该游戏使用C#编程实现在网络中的通信。这里使用了UDP(User Data Protocol)。
UDP是用户数据文报协议的简称,两台计算机之间的传输类似于传递邮件;两台之间没
有明确的连接,使用UDP协议建立对等通信。游戏开始后,创建一个线程。启动线程
后,通过不断侦听本机设定的端口,得到对方发送来的信息,根据自己定义的通信协议
中传送的是“输赢信息”、“下的棋子位置信息”、“重新开始”等信息而分别处理。发送信
息较为简单,主要实现创建UDP网络服务,传送信息到指定计算机的端口号后,关闭
UDP服务。
游戏最终实现了在网络中创建游戏、加入游戏等功能,可以实现在网络中联机对战
的要求。
关键词:军棋;UDP;C#
I
沈阳理工大学学士学位论文
Abstract
This paper describes the design and implementation of the Versus-network Jun
rules are very simple:take turns playing chess on a chess board,and the one who dig the “flag”
of the other side first will be the winner.
The game uses the C # programming to establish communication in the network .UDP is
used is the short for User Data ission between two computers is
similar to delivering the message;There is no clear connection between the two, using the
UDP protocol to establish peer the start of the game, create a
starting the thread ,through continuously listening to the port we set,we get
information from the other side. Then process respectively "winning or losing ", "the pieces
position ", "start again" and other information according to our own definition of
communication g information is relatively simple,mainly to create UDP
network services, transmit information to the designated remote port of the other computer,
shut down the UDP service.
Creating the game, joining the game and other functions can be achieved in the network.
Keywords: Jun Qi;UDP;C #
II
版权声明:本文标题:基于C#的网络军棋设计毕业设计 精品 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1714663753a416602.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论