Font Size: a A A

Design And Implementation Of Game Server Based On Socket

Posted on:2015-11-27Degree:MasterType:Thesis
Country:ChinaCandidate:S ZhengFull Text:PDF
GTID:2298330434950508Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the development of network technology and the support of our national policy, Chinese game industry has entered a rapid development era. Network game complexity increases dramatically, from simple stand-alone game to now which support hundreds of thousands or even millions of people online at the same time in the virtual world. So a stable and efficient background server is the basic guarantee of any virtual game world.The purpose of this project is the design and development of game server based on socket. Online game is usually composed with client and server. An online game can’t run well without game server no matter it is PC game, mobile game or web game. Different games on different platforms can use different client development technology but the basic framework and flow logic of server is reusable. According to the project requirement, our system design is divided into two layers; the base layer provides a framework whit various tool modules such as data module, thread module, protocol module, object management module, database module,IO module, session module and so on. The application layer encapsulates application server and gateway server respectively processing server logic and handles protocol, which is based on base layer. The development of this project makes the upper logic server only need to worry about its own logic without careless of basic details.In order to achieve the purpose of our game, the author designed and developed the basic layer and application layer. The basic layer provides the models need by the upper layer:the thread model provide the thread pool and thread safe tools; the protocol module provide the system required protocol. Data model provide the data stream and the data compression and encryption. Object manager model manage all the server object. Database model and log model encapsulate the database operation and system log operation. Net IO model operate all the net operation. In the application layer, in order to improve the efficiency of message forwarding and event driven, the program uses two open source network frameworks named libevent and zeromq to improve the performance and the stability of server. The application layer encapsulates the application server and gateway server. The application server encapsulates the basic logic. The gateway server is provided as the interface of the background application servers. The development of a specify server only need to care about the design of server object and server protocol. Currently, the author has completed all of the above functions. The specify server base on this project has been put into use now. The performance and stability are consistent with expected. The use of this project has greatly saved the company server development time and cost and earned wide recognition.
Keywords/Search Tags:Game Server, Socket, libevent, zerom
PDF Full Text Request
Related items