-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Introduction to Lord of Pomelo
Lord of pomelo (LOP) is a distributed MMO RPG game Demo based on pomelo framework.
Lord of Pomelo covers core content of the mainstream MMORPGs: it has three game scenes, eight different role types, various game tasks, and a variety of items and weapons, as well as a variety of monsters and boss. Players can shuttle multiple virtual scene, complete various of tasks, enhance the level and interact with other players.
In order to investigate the ability of the pomelo server response, LOP with a real-time battle mode, most of the player's behavior behavior, including attack, use skills, the seizure of the props and the use of real time. After multiple rounds of optimization to achieve the load capacity of the single scene 800, the same time can guarantee a good response time, specific optimization of the process and results see (Link).
LOP is developed under pomelo framework standard. by using cluster server management, it can support 800 concurrent access in a single scene. And the capability can be increased by adding more scene servers.
![Pomelo architechture] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/lordofpomelo-all-arch.png)
As shown above, LOP including two types of servers: game-server and web-server. web-server is a http web server, which used as the entry of the game demo. It also includes player register and OAuth authentication logic. After players complete the registration and verification, will enter the game-server, the to support actual game experience. Game-server the LOP core server cluster, the websocket server includes a set of front-end and the back end of the game logic server cluster, game-server architecture as shown below:
![Game-server] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/game-server.png)
The Client can figure above any support websocket client, the client comes in the LOP by html5, not only can run on a PC browser, and you can run the support html5 terminal (such as iphone ios high with android phone), and real-time interaction between different platforms.
As shown in the figure, the Game-server server can also be divided into two types: Fronted Server and Backend Server frontend server websocket server clusters, to news and direct communication websoket client to client communications, responsible for message forwarding, filtering, as well as to the rear end of the Clients broadcasting message function. Backend Server is mainly used to process the game logic, including a variety of different types of games server. Wherein the scenario server is a most important game server, and is primarily responsible for the maintenance of the game scene, the game data in real time to update and save has been updated regularly and maintenance functions of the game scene, these features through the plurality of modules has other The server to synergistic completed. Scene server also taken the form of scalable, each scene corresponding to the server of a confrontation scene, by the increase of the scene to disperse the pressure of a single server, to spread the load.
Lord of Pomelo is in full compliance with Pomelo framework developed, the boot process uses Pomelo in startup mode, [pomelo start, please read before reading the following content]
App.js the entrance is lord of pomelo start its mandate mainly includes three parts: reading components, start the master server, start the other server.
Lord of The Pomelo in a script-based statistics, these components by running custom scripts information collection servers running data and generate reports.
![Monitor] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/monitor.png)
, Lord of The Pomelo startup also loaded areas of the configuration file used to create the mapping between the scene and the server.
![Area map] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/areaMap.png)
In order to be able to correct routing in the server of the plurality of scenes, LOP loaded custom routing components, use Back loaded scene mapping information between the service server to bail players can be routed to it in the scene on the server.
![Route] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/route.png)
In addition to the server generic configuration, app is also responsible for the initialization of the different services, such as global server initialization and the initialization of the scene, as well as wayfinding server initialization, the initialization will distinguish between different server, depending on the type of server initialization process.
![Area init] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/areaInit.png)
Wayfinding services and mysql initialization.
![Path mysql] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/path_mysql.png)
Lord of The Pomelo start with a start Pomelo framework, is about to master as a default component, the load after and app.js call app.setart () method, in which to start the master service.
The Master component responsible for starting all other services. The startup process is divided into two phases: the first phase, master via ssh command to start all other server after the server starts, the monitor component connected to the listening port on the master, indicating that the server is booted. The second stage, after all the server is booted, mater will call all the server on afterStart interface, to start processing.
- [Lord of The Pomelo code structure] (https://github.com/NetEase/pomelo/wiki/Lord-of-Pomelo-%E4%BB%A3%E7%A0%81%E7%BB%84%E7%BB%87)
- [Lord of The Pomelo server] (https://github.com/NetEase/pomelo/wiki/Lord-of-Pomelo-%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BB%8B%E7%BB%8D)