With the continuous development of network technology, Animation game industry enters a rapid development track. The online game has become a new economic growth point,whose huge market space attract a large number of countries take part in,especially Europe,the United States,Japan and South Korea.whose game industry starts earlier, relatively mature and occupy China’ game market. China’game is in rapid development in recent years,but is relatively backward compared with foreign countries. An important feature of online game is that many people are online at the same time which requires the game server has a strong capacity.The online game communication module in this paper has an important significance to improve the online game server’capacity.Firstly this paper surveys network game’research status at home and abroad and analyzes it’s development direction and bottleneck.Based on the above,this paper designs network game’communication architecture and layered mechanism of communication protocol,message coding factory, synchronous and asynchronous thread pool, then discuss creating and destroying session,checking free and illegal session, receving and handling message.This paper uses Apache Mina and designs no clogging communication module and introduce creatively Google Protocol Buffers to replace json,xml,and common ordinary binary format. At last design a network game based on the above communication module and the communication efficiency is obviously better than in json,xml,and traditional communication format system.The online game communication module and communication architecture in this paper provide good engineering reference value to the problem that the speed of response is not in time while a large number of players are online. |