(1) Function Description
This background is divided into three parts: Server Management, single server data statistics, and support account management.
1. Server Management:
This section displays the names and IP addresses of all servers, the Service start time and status. The server enabling and disabling functions are not yet available. In the drop-down list behind the operator and server, you can select the corresponding game server for management as needed.
2. Server-specific data statistics:
Similarly, You must select the corresponding server from the drop-down list after the carrier and server to view the information of the corresponding server.
This part is divided into two parts: the detailed data of a single day and the total data. In the previous single-day data, we can clearly view various detailed information, such as the number of new registrations on the day, the number of login roles, the number of people paying, payment rate, retention rate, and other information that everyone cares about. The data goes from the back to the front row by date, and the button on the next page can view the data in the front. The following figure shows the total data of a single server, the total number of registrars, the total number of created persons, the total number of paid users, and the total payment amount. The information is clear at a glance.
3. Support account management:
You can perform various operations on all accounts that have created roles on the server. Similarly, You must select the corresponding server from the drop-down list after the carrier and server to operate the account of the corresponding server.
The operation is very simple. enter your account and select the operation you want to perform (currently open operations include adding money, experience, drilling (the game currency you get by recharging RMB), vigor, and modifying the character level ),
Enter the value to be changed and click execute!
(2) Implementation Method
The management background is implemented based on Django (a Python web framework. The process is as follows:
The front-end page will pass the user's selection in the form of parameters to the Django background
The backend identifies different URLs and transmits the passed parameters to the corresponding method.
The method combines the parameters into a new URL to request the game server interface.
After receiving the parameters, the game server also sends them to the corresponding method for execution to obtain the data required by the user.
Interface to return data to the Django background
Method to return the data to the front-end page
The entire process is roughly divided into three parts: the previous day page, the Django backend and the game server, each of which must have a corresponding interface so that users can correctly obtain the desired data.
(3) construction steps
Prerequisites:
Install Python and Django
Install the MySQL database (you can also use other databases, which can be configured in the setting. py file of Django. You can search by yourself for the general steps)
Procedure:
1.Operation Management Background.
Open the command line window, go to the gameadmin folder, and run Python manage. py runserver.
This means that the manager has been started. If http: // 127.0.0.1: 8000/is entered in the address bar of the browser, the start is successful.
2.Synchronize Databases.
Create a new database in the MySQL database. The database name is gameadmin, for example:
Click create. Then open a command line window, enter the same directory, and enter Python manage. py syncdb,
This is a complete database synchronization process. During this process, you will be asked whether to create a management account, enter yes, then the user name, Administrator email address, password, and confirm the password. In this case, enter http: // 127.0.0.1: 8000/admin/in the address bar of the browser to go to the following page:
Enter the account and password used to synchronize the database to log on. Login Page:
3. configure and manage the background database.
A. click "Administrator information" to go to the page and click "add administrator information" (enter the account information for logging on to the management background later, which is separated from the account information when the database is just synchronized ), save the settings.
B. Return to the home page, click carrier information, enter the page, and click Add carrier information. after entering the information, save it.
C. return to the home page, click server information, enter the page, and click Add Server Information (when entering server information, the login port refers to the port of NETServer in the game server, this game (dark Three Kingdoms) the logon port is 11009, the Web port is the port number connecting the game server to the management background, and the Web port of the game (dark Three Kingdoms) is 2012. Fill in the port number and save it.
D. return to the home page, click the white list information, enter the page, and click Add white list information (the white list information refers to the information of the person who can log on to the management background, if the user's IP address is not in the white list, you cannot log on even if you know the Administrator's account and password. Be careful with this information.) after entering the information, save it.
In this case, enter http: // 127.0.0.1: 8000/in the address bar of the browser. The following page appears:
Log On with the Administrator account and password you just added, and you can use the management background.