Mobile network game is mainly divided into two types, one is weak networking, one is strong networking.
Weak networking games, mainly refers to the game data real-time requirements of the relatively low online games, such as card games, casual games and so on.
Strong networking games, mainly refers to the game data real-time requirements of high-net games, such as MMORPG,ARPG.
Requires real-time communication between the client and the server.
Here is mainly to discuss with you how to set up a game server with load balancing, for game server development, will naturally involve zoning, cross-service, and service requirements, for these needs how can we set up a server?
The following is our server Setup for your reference:
First, we draw out the game server distribution map:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/81/wKioL1ScJHqzvvCJAAJJxWJHzSw720.bmp "title=" Single server architecture diagram "alt=" Wkiol1scjhqzvvcjaajjxwjhzsw720.bmp "/> Through, we can see that the data exchange between servers, the game server is mainly by the Loginserver,gatesever, Gameserver,dbserver,centerserver composition.
Load balancing is mainly through, Gateserver completed, that is, when the player landed, Gateserver will be based on the gamesever running situation from the inside to find a relatively free gameserver assigned to the player. There are many-to-many relationships between Gateserver and Gameserver. In other words, gateserver will only affect the number of players in the local gameserver, does not affect the overall. The display is only the software server architecture, not the hardware, meaning that the above layout can be configured on a hardware server, can also be configured on multiple servers, their configuration is done through the configuration table, the style is as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/83/wKiom1ScJhKA02SkAAESp8oySVI961.jpg "title=" Qq20141225225757.jpg "alt=" Wkiom1scjhka02skaaesp8oysvi961.jpg "/>
The above is the central server configuration, the following is the Gameserver server configuration:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/57/83/wKiom1ScJoixdog9AAC9TRVBwtA234.jpg "title=" 111. JPG "alt=" wkiom1scjoixdog9aac9trvbwta234.jpg "/>
The flow of data is this:
The user sends a message to Loginserver,loginserver to confirm that the message is correct, if it is sent to centerserver correctly, to obtain the IP address and port information of Gateserver, and then says that after the message arrives at Centerserver, Centerserver chooses the IP address and port information of the Gateserver with the lowest load to send Loginserver,loginserver to the client, the client receives the message after the link gateserver, and sends the message to the Gateserver , Gateserver saves the user ID and sends it to Centerserver, and then assigns the user to the Gameserver, fightserver on the smaller load, and records the server assigned by the user by Gateserver. Send a message to Gateserver for the logged-in user incorporation. Then Gateserver will send a message to Gameserver,gameserver will go to dbserve Verify, user information is legitimate, the whole process is this.
The architecture of the server is typically this way.
This article is from the "Kaiyukan mobile" blog, so be sure to keep this source http://jxwgame.blog.51cto.com/943299/1596095
Mobile Network game server architecture