A classic network game server architecture

Source: Internet
Author: User

First of all, let alone (drawing pictures in windows ...)


This figure shows the architecture of a zone. The architecture of all zones is the same. The servergroup In the dotted box above is the same as that in the box next to it. All x n servers in the figure are composed of multiple servers. The red lines, green lines, and blue lines are shown in the diagram. As you can see about the agent server, it is actually the gate.
This section describes the content and significance of the data connection that marks the location of the number.

1-this is a WebService pipeline. When a user activates the account in the region or modifies the account password, this channel is used to insert and update the account information of the user.
2-this is also a WebService pipeline, which is used to obtain and control the role information of the user in the group, as well as update operations such as pay mall tokens.
3-this is a local TCP/IP connection. This connection is mainly used to register a server group on the login server, and to register account login information with the user server after logging on to the server to verify the account, and perform operations on the account role information that has been logged on (such as kicking the current login role), as well as server group information updates (the current number of online players, etc ).
4-this is also a local TCP/IP connection. This connection is used to verify the Client Connected to the gameserver, obtain the role data information, and return the role data changes on the gameserver.
5-this connection is also a local TCP/IP connection, which is used for interaction between the Public Information Server and several game servers and for exchanging some world-class game information (such as Guild information, cross-server team information and cross-server chat channels ).
6-the two connections here mean that the agent of userserver and gameserver can be used interchangeably, that is, after the player enters the Group, there is no need to switch the agent. If you are not afraid of chaos, you can also calculate the agent used to log on to the server, so that you do not need to change the agent throughout the process, reducing the number of repeated connections and improving stability. (After all, the number of connections is reduced, which also reduces the chance of disconnections to the server)

In this architecture, gameserver is actually a combination of game logic, which can be expanded into several different logic servers for public data exchange through publicserver.
Userserver actually acts as a servergroup leader. It registers and updates the server group information (name, current number of people) with loginserver and schedules the agent, provide an agent with the minimum number of users to players who have selected this group. At the same time, it also provides a role management server function, which is sent to the client's current role list, role creation, deletion, selection, and other management operations. It is also a server for verifying user information. gameserver needs to verify the validity of the client and obtain the role data selected by the player.

Games using this architecture usually have the following performances.
1-you must activate a region to log on to your account in the region.
2-when you start the client, a login device is displayed, and a region is selected.
3-when a user starts a real client, the user enters the account and password at the beginning.
4-after the Account Verification is complete, select a server in the region.
5-after selecting the server, go to role management. Roles cannot be shared on different servers.

There are quite a few games on the market that match the above performance characteristics, and there is no lack of great achievements. This architecture is not a new architecture, but it is classic enough and perfect, and the logic is simple and clear. It is a good choice for MMORPG or server architectures of other online games.

Original article address:

Http://www.cppblog.com/johndragon/archive/2008/04/10/46768.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.