内容提要
聊天模块作为网络桥牌游戏系统中的一个模块,起到了供游戏参与者之间进行沟通、交流和增进感情的桥梁的作用。桥牌游戏是由一种叫“惠斯特”的纸牌游戏发展来的,是一种竞技性很强的游戏,通常由四名游戏者进行游戏,两人为一组对抗另一对游戏者。游戏的搭档之间必须相互配合,制定策略才能取胜。与传统的面对面的桥牌游戏不同,在网络游戏的世界里,参与游戏的玩家可能来自世界的各地,彼此之间一无所知,这时聊天模块就成了我们的“千里眼,顺风耳”,通过它我们才能了解其它游戏者的信息,彼此间从陌生到熟悉,才能从他们中找到与自己合拍的最佳拍档,一起体验游戏的快乐。
因此在设计此模块时注重了其在交流上的功能实现。本模块可以实现多人聊天、一对一聊天的功能,满足游戏者间相互交流沟通的基本需求。
本程序模块的开发是基于Windows操作系统的,使用的是微软公司的Visual C++6.0集成开发环境,因此文中也详细地介绍了Windows应用程序的开发过程和Visual C++6.0集成开发环境的相关知识。
在Windows系统上进行网络编程,要用到WinSock这个网络应用程序编程接口(API),因此也对与其相关的背景知识和使用方法进行了详细的介绍。
在模块的具体实现上是分为三部分实现的:通用部件、服务端程序和客户端程序,在文章的最后一部分有详细的介绍。
通过此模块的开发,对Windows应用程序的开发过程和VC++集成开发环境的使用有了深入的了解,同时对网络应用程序的编写也有了基本的了解。
关键词: 交流,沟通 ,聊天模块
Abstract :Chatting module is part of Networking Bridge game System. This module provide the functionality of a communication bridge between the players which let them to communicate, communion and improve their feelings. Bridge is a kind of card game derived from whist. It’s a strong competitive game. The four players are divided into two parts. In order to win the game, each partners should cooperates with each other and discuss their strategy . Unlike the face to face situation in reality, the players take part in the Networking Bridge may come from all over the world, we don’t know each other. At this time, Chatting module plays an important role at gaining the other players’ information, we use it as our “clairvoyance” and “clairaudient” to communicate with the person far away from us. With it, a stranger may become a acquaintance and may even becomes a good partner and enjoy the fun of the game together.
In the development of the module, I focus on the implementation of the module’s communication function. This module can be used in communicate with “person to person” and “one to many”. It can satisfy the players’ basic communication requirements.
This module was developed under the windows system and using the Visual C++ 6.0 Integrated Development Environment(IDE) tools. So I make a detailed introduction about the Windows application programming and the knowledge about the VC++6.0 IDE tools.
Network-aware application programming in Windows System need the appearance of the WinSock API. So I also introduced the background knowledge of the socket and the usage of the WinSock functions.
The actual implementation of the module was divided into three parts: the Common Components,the Chat Server and the Chat Client. At the end of this article, I made a detailed introduction.
I learned a lot from developing this module. I understand the Windows Application Programming process deeply and master the usage of the IDE. And I laid down a ground knowledge about Network-aware application programming.
Key word: communication communion