Method for realizing game activities

By building the basic framework of game servers and activity servers, and using activity components to achieve cross-server data synchronization, the problem of complexity and resource waste in the development of cross-server game activities is solved, and the simplified development of cross-server activities and the integration of single-server activities with cross-server activities are realized. Coexistence of service activities.

CN119327102APending Publication Date: 2025-01-21SHENZHEN THUNDER DIGITAL ENTERTAINMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410548425.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing technology has difficulties in repeated development and maintenance when developing cross-server game activities, and the conversion of single-server activities to cross-server activities requires complete redevelopment, resulting in waste of resources and high time costs.

Method used

By constructing the basic framework of game clothes and activity clothes, cross -service data synchronization and layering are used to use activity components. The activity manager module is responsible for loading and pushing the activity module data to achieve the mapping of the activity body and mirror copy.

Benefits of technology

Simplified the development of gaming cross -service activities, reduced development complexity and waste of resources, and achieved coexistence and switching of single -service activities and cross -service activities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119327102A_ABST
    Figure CN119327102A_ABST
Patent Text Reader

Abstract

The invention relates to a method for realizing game activities. The method comprises an initialization step and a game data processing step, the initialization step comprises the steps that the activity suit receives one or more pieces of assignment information, the assignment information comprises activity module data and a game area suit list, and the activity suit loads an activity module according to the received activity module data; the activity service sends the activity module data to the corresponding game service, and the game service creates a mirror image copy of the cross-service activity module according to the received activity module data; the game data processing step comprises the following steps: when the game suit receives a data request, identifying a current end as a mirror image copy of the game suit, judging an execution end of the data request as the mirror image copy or an activity body, and if the execution end of the data request is the mirror image copy, processing the request by the mirror image copy of the game suit; if the execution end of the data request is a movable body, the data request is an rpc request; and the game service executes the rpc request. According to the invention, the development of game cross-server activities can be simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer games, and in particular to a method for realizing game activities. Background Art

[0002] When developing cross-server activities, there is usually an activity server and a game server. Technical personnel need to handle cross-server deployment, player request link processes and data synchronization, performance assurance, etc. This is much more complicated than developing single-server activities. Different cross-server activities repeatedly implement the above cross-server related functions, resulting in repeated development and difficult maintenance.

[0003] As the retention of single-server players decreases year by year, the number of players in a single server is not enough to support the normal progress of an activity, so there will be a need to convert single-server activities into cross-server activities. Usually, converting single-server activities into cross-server activities almost requires complete redevelopment, which wastes a lot of manpower, material resources and time costs.

[0004] In addition, the existing cross-server activity development is based on Unity's MirrorNetwork framework, which uses a similar dual-end shared code approach. When players from different servers enter the same dungeon map, a dungeon server node is started using the unity implementation code of the dungeon, called a dungeon server. Then the player's unity client also loads this dungeon, and the object structure and data of the player's dungeon are mirror copies of the object structure and data of the dungeon server. It adds header definition tags to the method, and the player client and dungeon server generate different behaviors when packaging. For example, if it is defined as server_cmd, the code generated by the player client is an rpc request to the dungeon server for execution, and the code generated by the dungeon server is to receive the rpc request. The dungeon server collects rpc requests in each frame, and then packages all modified data and synchronizes them to all player clients. The client updates the data first in each frame, and then processes notifications from the dungeon server and player requests. This solution is suitable for a small dungeon activity and has a limited scope of application because it synchronizes all data and has a low upper limit on synchronization capabilities in cross-server activities. For the same object, the client method and the dungeon server method are actually completely separated. Calling a cross-server method is equivalent to issuing a post request. The return value cannot be used directly. Instead, the next frame receives data updates and reverse rpc call notifications from the dungeon server. This cross-server request link optimization is not thorough enough, and it will split a call and return into two methods for separate execution. In addition, it is specially designed for multiplayer dungeons and only handles multiplayer interactions in the dungeon where the player is currently located. The player client can only be in one dungeon at a time. Summary of the invention

[0005] In view of the problems existing in the prior art, an object of the present invention is to provide a method for realizing game activities, which can simplify the development work of cross-server game activities.

[0006] To achieve the above object, the technical solution adopted by the present invention is: A method for realizing a game activity, the method comprising a basic framework construction step, an initialization step and a game data processing step; The basic framework construction steps are used to build the basic framework in the game server and activity server, as follows: Each function in the game server is an independent game function module, and all game function modules are selectively loaded; the activity server is a game server without any game function module loaded, and all game function modules that can be loaded by the game server can be loaded and run normally by the activity server; An activity manager module is provided in both the game server and the activity server; wherein the activity manager module in the game server is used to receive assignment information and load the activity module according to the activity responsibility; or is used to receive the activity module data pushed by the activity server and rebuild the mirror copy module through the received activity module data; the activity manager module in the activity server is used to receive assignment information and load the activity module as the activity subject according to the assignment information, and push the activity module data to the game server; The activity module is implemented by adding activity components to the game function module to obtain the functions of timed opening, multi-person participation or cross-server participation; The activity component can realize object type recognition on its own side, and the object categories include single-server activity objects, main body objects of cross-server activities, and mirror copy objects of cross-server activities; The activity component is used to package the configuration data access interface. When packaging the configuration data access interface, the data access interface of the cross-server activity module is packaged to be consistent with the data access interface of the non-cross-server activity module; The activity component is also used to configure data synchronization and stratification. When configuring data synchronization and stratification, the activity component is responsible for cross-server data synchronization. When the activity entity data of the activity server changes, it will synchronize the change to its mirror copy on the game server, so that the mirror copy data is synchronized with the activity entity. The activity entity has all the data, and the activity entity only synchronizes the required data to the game server. The game server then sends the public data and the data required only by the player to the data-related player from the data after stratification and filtering. The activity component provides the activity module with a unique entry interface that is called from the outside. All external requests to the activity body and mirror copy will pass the request method and parameters through this entry interface. The initialization step includes: The activity manager of the activity server receives one or more assignment information, the assignment information including activity module data and a game zone server list, the game zone server list including game servers of one zone and corresponding network addresses, or including two or more game servers belonging to different zones and corresponding network addresses; The activity manager of the activity server loads the activity module according to the received activity module data as the activity body. The activity module data in different assignment information are different, and the activity name of the corresponding activity body is different. The activity manager of the activity server sends the activity module data to the corresponding game server according to the network address in the game zone server list; The activity manager of the game server creates a mirror copy of the cross-server activity module according to the received activity module data. The activity name of the mirror copy is the same as the activity name of the corresponding activity body, and the functions and codes executed by the two are the same; The game data processing step includes a step of processing a data request received by a game server from a client, which includes: When the activity manager of the game server receives a data request, the activity component identifies the data request as a first-category data request according to the activity name in the data request; the activity component identifies the current end as a mirror copy of the game server, and determines whether the execution end of the data request is a mirror copy or an activity entity, wherein the data request includes an activity name, a calling method name, and parameters; If the execution end of the data request is a mirror copy, the activity manager of the game server finds the corresponding mirror copy according to the activity name, finds the corresponding method in the mirror copy according to the calling method name, passes parameters through the entry interface of the activity component and executes it; If the execution end of the data request is the activity entity, the data request is an RPC request; the game server executes the RPC request and sends the activity name, method name and parameters to the activity server through the activity manager; The activity manager of the activity server receives the RPC request, finds the activity body according to the activity name, finds the method on the activity body according to the method name, passes the parameters through the entry interface of the activity component and executes it; Before the activity server finishes executing and returns, the activity manager synchronizes the data modified during the activity body execution to the mirror copies of all game servers in the game zone server list; The activity manager of the activity server returns the RPC execution result to the corresponding game server in the original path; The game server's activity manager receives the returned result and the request is completed.

[0007] The game server loads zero or more game function modules, and the activity server does not load any game function modules.

[0008] The game server loads more than one game function modules. When the game server receives a data request, it identifies the data request as a second-category data request based on the activity name in the data request; the game server finds the corresponding game function module based on the activity name, passes parameters and executes the method corresponding to the calling method name in the game function module.

[0009] The activity names of the activity entity and the mirror copy are provided with a first mark. When the game server recognizes that the activity name has the first mark, it determines that the data request is a first-category data request.

[0010] The method for the active component of the game server to determine whether the execution end of the data request is a mirror copy or an active entity is as follows: for data requests where the execution end is in the active entity, the client adds a cross-server tag when generating the data request; for data requests where the execution end is in the mirror copy, the client adds a local tag when generating the data request; when the game server recognizes the cross-server tag in the data request, it determines that the execution end of the data request is the active entity, and when it recognizes the local tag in the data request, it determines that the execution end of the data request is the mirror copy.

[0011] A "GET" tag or a "POST" tag is set after the cross-server tag and the local tag. The "GET" tag indicates waiting for receiving the call result, and the "POST" tag indicates that there is no need to wait for the result.

[0012] The game processing step also includes: a step of processing a data request received by the game server from the active server, which includes the active server's active entity making an RPC call to the mirror copies of all game servers; specifically as follows: (1) The activity server determines the target ID list of the remote call based on the server_id parameter passed in when calling; (2) The activity manager of the activity server sends the activity name, method name and parameters to each game server in the above list respectively, and records the number of sends. When the number of sends reaches the set value, it ends or waits for all remote calls to return; (3) The activity manager of the game server receives the RPC request, finds the activity mirror copy according to the activity name, finds the method on the activity mirror copy according to the method name, passes parameters through the entry interface of the activity component, and executes it; (4) The game server's activity manager returns the RPC execution result by the original path; (5) After receiving the returned result, the activity manager of the activity server determines whether all requests have been returned; if so, it returns a list of all game server call results to indicate that the request is complete; otherwise, it continues to wait for other game servers to return.

[0013] After adopting the above scheme, after loading the activity module to create the activity body, the activity server will send the activity module data to the corresponding game server, and the game server will create a mirror copy corresponding to the activity body. Since the activity copy and the mirror copy perform the same function and use the same code, developers only need to develop one activity module when developing cross-server activities of the game. In the existing cross-server activity development process, it is usually necessary to develop a game server module for the activity and an activity server module for the activity. Therefore, compared with the existing cross-server activities, the development work of cross-server activities based on the method of the present invention will be greatly simplified. In the present invention, due to the mapping relationship between the activity body and the mirror copy, the development of rpc calls during the development process does not require the writing or generation of rpc interfaces on the caller, nor does it require the writing or production of receiving methods and the specific implementation of rewriting rpc interfaces on the receiver. In addition, the data request involving data modification in the present invention will be executed in the activity body, and will be directly synchronized to all game servers after the execution in the activity body is completed, so there is no need to write a special data synchronization process during the development process. Therefore, the method of the present invention can greatly simplify the development work of cross-server activities.

[0014] In addition, the present invention can also realize the coexistence of single-server activities and cross-server activities, as well as the switching between single-server activities and cross-server activities. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic diagram of the framework of the cross-server game activity (two game servers) of the present invention; Figure 2 This is a schematic diagram of the framework of the cross-server game activity (three game servers) of the present invention; Figure 3 A flowchart of the game data processing steps of the present invention; Figure 4 This is a schematic diagram of the rpc call of the present invention; Figure 5 A diagram for expanding a single-server game activity into a cross-server game activity. DETAILED DESCRIPTION

[0016] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.

[0017] The present invention discloses a method for implementing a game activity, which can simplify the development of cross-server game activities. To better illustrate the technical effects achieved by the present invention, specific embodiments will be listed below for illustration.

[0018] Embodiment 1 In this embodiment, the method for implementing game activities is used to implement cross-server game activities, which includes a basic framework construction step, an initialization step, and a game data processing step.

[0019] The basic framework construction step is used to build the basic framework in the game server and activity server. The details are as follows: Each function in the game server is an independent game function module, and all game function modules can be loaded selectively; the active server (cross-server server) is a game server that does not load any game function module, and all game function modules that can be loaded by the game server can be loaded and run normally by the active server.

[0020] An activity manager module is provided in both the game server and the activity server; wherein, the activity manager module in the game server is used to receive assignment information, and load the activity module according to the activity responsibilities; or is used to receive the activity module data pushed by the activity server, and rebuild the mirror copy module through the received activity module data; the activity manager module in the activity server is used to receive assignment information, and load the activity module as the activity subject according to the assignment information, and push the activity module data to the game server.

[0021] The activity module is implemented by adding activity components to the game function module to obtain the functions of timed opening, multi-player participation or cross-server participation. For example, the player equipment module is a game function module, but it is not an activity module; for example, the limited-time world boss activity is first a game function module and also an activity module; if this limited-time world boss activity allows cross-server participation, it is also a cross-server activity module.

[0022] The activity component can realize object type identification on its own side, and the object categories include single-server activity objects, main body objects of cross-server activities, and mirror copy objects of cross-server activities. The request of the single-server activity object is directly executed without restrictions and will not be executed across servers. The data modification request of the main body object of the cross-server activity can only be executed on the main body object. The data modification request of the mirror copy object of the cross-server activity, if the request is marked with a cross-server rpc, will be mapped to the cross-server local object corresponding to the mirror copy for execution. Because the data is modified directly, the request execution will be blocked and the developer will be notified of this error.

[0023] The activity component is used to package the configuration data access interface. When packaging the configuration data access interface, the data access interface of the cross-server activity module is packaged to be consistent with the data access interface of the non-cross-server activity module. This can reduce the incompatibility of the data access interface when a single-server activity is modified to a cross-server activity. While packaging the data access interface, a data change record is added to synchronize only the changed data when necessary.

[0024] The active component is also used to configure data synchronization and stratification. When configuring data synchronization and stratification, the active component is also responsible for cross-server data synchronization. When the active entity data of the active server changes, it will synchronize the change to its mirror copy on the game server, so that the mirror copy data is synchronized with the active entity. The active entity has all the data, and the active entity only synchronizes the data it needs to the game server. The game server then sends public data and data only needed by the player to the data-associated player from the data after layering and filtering. Each layer will not obtain data that it does not need, ensuring automatic synchronization while performance will not be reduced due to redundant synchronization.

[0025] The activity component provides the activity module with a unique entry interface that is called from the outside. All external requests to the activity body and mirror copy will pass the request method and parameters through this entry interface. The entry interface will record all data changes during the call process, and synchronize as needed before the external call ends to ensure that all modifications are synchronized to the game server and player client that need those data. At the end of the entry interface, the changes to the same data are counted and merged, and all changes are packaged and synchronized at once to avoid multiple requests to modify the same data and synchronize them repeatedly, greatly reducing the pressure of synchronizing data.

[0026] In order to ensure that data modifications are recorded and correctly synchronized, all external calls must be forwarded through this entry interface. External calls include: RPC calls from the game server; heartbeats created by the activity itself; events monitored by the activity are triggered and called; methods registered to other external modules are called. In this case, the callback method registered to the external needs to be shelled. When the callback is executed, the shelling process will go to this unique external interface, and then forward the call to the actual callback method.

[0027] Heartbeat: repeat a certain behavior at a fixed time. Event monitoring: the activity registers to monitor a certain behavior outside the function. When the behavior occurs, the method specified by this activity is called. External callback: similar to monitoring, it is to notify the external module to do something. After the external module is done, the method specified by this activity is called and the results of their execution are returned. These three situations are all behaviors that drive the operation of the activity except the RPC call within the activity.

[0028] In this embodiment, the game server and the activity server before the initialization step have not loaded the game function module. The game function module refers to a module that implements the game function of a single server, that is, if the game server loads the game function module, the execution of data processing is performed by the game function module of the game server, and does not involve other game servers or activity servers.

[0029] In this embodiment, the initialization step specifically includes the following steps: S0-11. The activity manager of the activity server receives an assignment information, which includes activity module data and a game zone server list, wherein the game zone server list includes more than two game servers belonging to different zones and corresponding network addresses.

[0030] S0-12. The activity manager of the activity server loads the activity module according to the received activity module data as the activity body, and the activity body has a unique activity name.

[0031] S0-13. The activity manager of the activity server sends the activity module data to the corresponding game server according to the network address in the game zone server list.

[0032] S0-14. The activity manager of the game server creates a mirror copy of the cross-server activity module based on the received activity module data. The activity name of the mirror copy is the same as the activity name of the corresponding activity body, and the functions and codes executed by the two are the same.

[0033] like Figure 1 As shown in the figure, when there are two game servers (game server in zone 1 and game server in zone 2) in the game zone server list, the activity server will send the activity module data to both game servers. Game server in zone 1 and game server in zone 2 will each create a mirror copy of the cross-server activity module. The activity names of the two mirror copies are the same as the activity name of the activity subject. The functions performed by the two mirror copies and the codes used are the same as those of the activity subject. Figure 2 As shown, the same process will be applied when there are more than three game servers in the game server list.

[0034] like Figure 3 and Figure 4 As shown, in this embodiment, the game data processing step includes a step of processing a data request received by a game server from a client, which includes: S0-21. The activity manager of the game server receives a data request, and the activity component identifies the data request as a first-category data request based on the activity name in the data request; the activity component identifies the current end as a mirror copy of the game server, and determines whether the execution end of the data request is a mirror copy or an activity entity.

[0035] Data requests are generally sent by the client to the game server, and the data request includes the activity name, calling method name and parameters.

[0036] For the activity names of the activity body and the mirror copy, a first mark may be added to the activity name. When the game server recognizes that the activity name has the first mark, it determines that the data request is a first-class data request.

[0037] The execution end of the data request is a mirror copy, which means that the data request is generally a query or other request that does not generate data modification; the execution end of the data request is an active entity, which means that the execution of the data request will generate data modification.

[0038] The method by which the active component of the game server determines whether the execution end of a data request is a mirror copy or an active entity is as follows: for a data request whose execution end is in the active entity, the client will add a cross-server tag, such as SVR_RPC, when generating the data request; for a data request whose execution end is in the mirror copy, the client will add a local tag, such as CLI_RPC, when generating the data request. When the game server recognizes the cross-server tag in the data request, it determines that the execution end of the data request is the active entity; when it recognizes the local tag in the data request, it determines that the execution end of the data request is the mirror copy.

[0039] You can add a "GET" tag or a "POST" tag after the cross-server tag and the local tag, such as SVR_RPC_GET, SVR_RPC_POST, CLI_RPC_GET, CLI_RPC_POST. The "GET" tag indicates that you will wait for the call result, and the "POST" tag indicates that you do not need to wait for the result.

[0040] S0-22. If the execution end of the data request is a game mirror copy, the activity manager of the game server finds the corresponding mirror copy according to the activity name, finds the corresponding method in the mirror copy according to the calling method name, passes parameters through the entry interface of the activity and executes it.

[0041] S0-23. If the execution end of the data request is the activity entity, the data request is an RPC request, and the following steps are executed: (1) The activity manager of the game server sends the activity name, method name and parameters to the activity server; (2) The activity manager of the activity server receives the RPC request, finds the activity body according to the activity name, finds the method on the activity body according to the method name, passes parameters through the entry interface of the activity component, and executes it; (3) Before the activity server returns after the execution ends, the activity manager synchronizes the data modified during the execution of the activity body to the mirror copies of all game servers in the game zone server list; (4) The activity manager of the activity server returns the RPC execution results to the corresponding game server; (5) The game server's activity manager receives the returned result and the request is completed.

[0042] The game processing step also includes: a step of processing a data request received by the game server from the active server, which includes the active server's active entity making an RPC call to the mirror copies of all game servers. The details are as follows: (1) The activity server determines the target ID list of the remote call based on the server_id parameter passed in when calling; The first parameter of all rpc interfaces is server_id, which is a mixed type (it allows passing empty values, "all", server id or a list of server ids); when this method is called remotely, the server_id parameter is the server id of the explicit call source (all game servers and activity servers have their own unique server_id); for the initiator of the rpc call, server_id is the id of the remote target server of the call, but when the game server initiates the call, it is sufficient to pass server_id as an empty value, because the mirror has only one entity; and when the activity server initiates the rpc call, when server_id is an empty value or "all", it indicates that the call target is all its own mirror copies (that is, all game servers in the game server list of its own service), and when server_id is a single server id or a list of server ids, it indicates that the target of the remote call is a single or multiple specified game server mirror copies.

[0043] (2) The activity manager of the activity server sends the activity name, method name and parameters to each game server in the above list respectively, and records the number of sends. When the number of sends reaches the set value, it ends or waits for all remote calls to return; (3) The activity manager of the game server receives the RPC request, finds the activity mirror copy according to the activity name, finds the method on the activity mirror copy according to the method name, passes parameters through the entry interface of the activity component, and executes it; (4) The game server's activity manager returns the RPC execution result by the original path; (5) After receiving the returned result, the activity manager of the activity server determines whether all requests have been returned. If so, it returns a list of all game server call results and the request is completed. Otherwise, it continues to wait for other game servers to return.

[0044] The above process is a GET call. If it is a POST call, the activity server does not need to wait and count the returned results and quantities. The task is completed after issuing the remote call. The game server does not need to return the results either.

[0045] The activity server calls the game server rpc interface, for example: (1) Asynchronous behavior: After the game server calls the activity server's RPC interface, the activity server is not required to execute immediately. After the activity server executes, it will reversely call the source game server's interface to respond.

[0046] (2) Because the status of the activity is managed by the activity server, after the activity server modifies the status, in addition to the game server monitoring the status changes and handling some transactions on its own, the activity server can also directly remotely call the mirror copy method of the game server to let the game server mirror copy execute those transactions. You can choose according to the business needs of the game. The latter is more flexible and easy to pass more information when calling. For example, the activity body regularly checks the status of the activity, makes RPC calls to the mirror copies of all game servers, and settles the activity rewards. Because the activity server only loads the activity and does not manage players and items, the award needs to be called to execute the mirror copy end.

[0047] As mentioned above, in this embodiment, after the activity server loads the activity module to create the activity body, it will send the activity module data to the corresponding game server, and the game server will create a mirror copy corresponding to the activity body. Since the activity copy and the mirror copy perform the same function and use the same code, developers only need to develop one activity module when developing cross-server activities. In the existing cross-server activity development process, it is usually necessary to develop a game server module for the activity and an activity server module for the activity. Therefore, compared with the existing cross-server activities, the development work of cross-server activities based on the method of the present invention will be greatly simplified. In the present invention, due to the mapping relationship between the activity body and the mirror copy, the development of rpc calls during the development process does not require the writing or generation of rpc interfaces on the caller, nor does it require the writing or production of receiving methods and the specific implementation of rewriting rpc interfaces on the receiver. In addition, the data request involving data modification in the present invention will be executed in the activity body, and will be directly synchronized to all game servers after the execution in the activity body is completed, so there is no need to write a special data synchronization process during the development process. Therefore, the method based on the present invention can greatly simplify the development work of cross-server activities.

[0048] Embodiment 2 In this embodiment, the method for realizing game activities can realize the coexistence of single-server game activities and cross-server game activities, which includes a basic framework construction step, an initialization step and a game data processing step.

[0049] The basic framework construction steps in this embodiment are the same as those in the first embodiment and will not be repeated here.

[0050] The initialization steps of this embodiment include the following: S1-11. The activity manager of the activity server receives two assignment information, namely, the first assignment information and the second assignment information, wherein the first assignment information includes the first activity module data and the first game zone server list, the first game zone server list contains a game server (hereinafter referred to as a zone one game server) and a corresponding network address; the second assignment information includes the second activity module data and the second game zone server list, the second zone server list contains game servers in two or more different zones and corresponding network addresses.

[0051] The game servers of two or more different zones in the second game zone server list may include a zone 1 game server or not. The following is an example in which the second zone server list includes game servers of two different zones (zone 1 game server and zone 2 game server).

[0052] S1-12, the activity manager of the activity server loads the first activity module as the first activity body according to the received first activity module data, and the activity manager of the activity server loads the second activity module as the second activity body according to the received second activity module data. The first activity body and the second activity body each have a unique activity name.

[0053] S1-13, the activity manager of the activity server sends the first activity module data to the zone 1 game server according to the network address in the first game zone server list. The activity manager of the activity server sends the second activity module data to the zone 1 game server and the zone 2 game server according to the network address in the second game zone server list.

[0054] S1-14, the activity manager of the zone one game server creates a first mirror copy of the first activity module based on the received first activity module data, the activity manager of the zone one game server creates a second mirror copy of the second activity module based on the received second activity module data; the activity manager of the zone two game server creates a second mirror copy of the second activity module based on the received second activity module data.

[0055] The activity name of the first mirror copy of the game server in zone 1 is the same as the activity name of the first activity body, and the functions and codes executed by the two are the same. The activity names of the second mirror copy of the game server in zone 1 and the second mirror copy of zone 2 are the same as the activity name of the second activity body, and the functions and codes executed by the three are the same.

[0056] In the initialization step, the activity manager of the activity server can receive the first assignment information and the second assignment information at the same time, and then initialize them at the same time. The activity manager of the activity server can also first receive one of the assignment information and initialize it, and then receive the other assignment information and initialize it.

[0057] In this embodiment, the game data processing step includes a step of processing a game server receiving a data request from a client and a step of processing a game server receiving a data request from an activity server. The step of processing a game server receiving a data request from an activity server is the same as that in the first embodiment and will not be described in detail here. Figure 1 As shown, the specific steps for the game server to receive the client's data request are as follows: S1-21. When the activity manager of the game server receives a data request, the activity component identifies the data request as a first-category data request based on the activity name in the data request, then identifies the current end as the mirror copy end of the game server, and determines whether the execution end of the data request is a mirror copy or an activity entity.

[0058] S1-22. If the execution end of the data request is a game mirror copy, the activity manager of the game server finds the corresponding mirror copy according to the activity name, finds the corresponding method in the mirror copy according to the calling method name, passes parameters through the entry interface of the activity component and executes it.

[0059] S1-23. If the execution end of the data request is the activity entity, the data request is an RPC request, and the following steps are performed: (1) The activity manager of the game server sends the activity name, method name and parameters to the activity server; (2) The activity manager of the activity server receives the RPC request, finds the corresponding activity entity according to the activity name, finds the method on the activity entity according to the method name, passes parameters through the entry interface of the activity component, and executes it; (3) Before the activity server returns after execution, the activity manager synchronizes the data modified during the execution of the activity body to all game servers; (4) The activity manager of the activity server returns the RPC execution results to the corresponding game server; (5) The game server's activity manager receives the returned result and the request is completed.

[0060] For example, when a player in zone 1 sends a data request to a zone 1 game server while participating in the first activity, the zone 1 game server identifies the data request as a first-class data request based on the activity name of the data request, identifies the current end as the game server mirror copy end, and then determines whether the execution end of the data request is a mirror copy or an activity entity. If the data request is a query data request, its execution end is the first mirror copy. At this time, the zone 1 game server finds the first mirror copy according to the activity name, finds the corresponding method in the first mirror copy according to the call method name, passes parameters and executes. If the data request is a request to modify data, its execution end is the first activity entity. At this time, the zone 1 game server will send the activity name, method name and parameters to the activity server, and the activity server will find the first activity entity according to the activity name, find the method on the first activity entity according to the method name, pass parameters and execute. Before the execution result is returned, the data modified during the execution of the first activity entity is synchronized to the first mirror copy of the zone 1 game server. Then, the activity server returns the execution result of the first activity entity to the first mirror copy of the zone 1 game server. Finally, the zone 1 game server will return the received execution results to the zone 1 players (i.e. the client).

[0061] When a player in zone 1 sends a data request to a zone 1 game server while participating in the second activity, the zone 1 game server identifies the data request as a first-class data request based on the activity name of the data request, identifies the current end as the game server mirror copy end, and then determines whether the execution end of the data request is a mirror copy or an activity entity. If the data request is a query data request, its execution end is the second mirror copy. At this time, the zone 1 game server finds the second mirror copy based on the activity name, finds the corresponding method in the second mirror copy based on the call method name, passes parameters and executes. If the data request is a request to modify data, its execution end is the second activity entity. At this time, the zone 1 game server will send the activity name, method name and parameters to the activity server, and the activity server will find the second activity entity based on the activity name, find the method on the second activity entity based on the method name, pass parameters and execute. Before the execution result is returned, the data modified during the execution of the second activity entity is synchronized to the second mirror copy of the zone 1 game server and the second mirror copy of the zone 2 game server. Then, the activity server returns the execution result of the second activity entity to the second mirror copy of the zone 1 game server. Finally, the zone 1 game server will return the received execution results to the zone 1 players (i.e. the client).

[0062] When the players in the second zone participate in the second activity and send a data request to the game server in the second zone, the game server in the second zone identifies the data request as a first-class data request based on the activity name of the data request, identifies the current end as the mirror copy end of the game server, and then determines whether the execution end of the data request is a mirror copy or an activity entity. If the data request is a query data request, its execution end is the second mirror copy. At this time, the game server in the second zone finds the second mirror copy according to the activity name, finds the corresponding method in the second mirror copy according to the call method name, passes parameters and executes. If the data request is a request to modify data, its execution end is the second activity entity. At this time, the game server in the second zone will send the activity name, method name and parameters to the activity server, and the activity server will find the second activity entity according to the activity name, find the method on the second activity entity according to the method name, pass parameters and execute. Before the execution result is returned, the data modified during the execution of the second activity entity is synchronized to the second mirror copy of the game server in the first zone and the second mirror copy of the game server in the second zone. Then, the activity server returns the execution result of the second activity entity to the second mirror copy of the game server in the second zone. Finally, the zone 2 game server will return the received execution results to the zone 2 players (i.e. the client).

[0063] In this embodiment, when players in a zone participate in the first activity, although the data modification operation is still performed in the first activity body of the activity server, when the data is synchronized, there is no data sharing with the game servers in other zones. Therefore, the first activity can be regarded as a single-server game activity.

[0064] For the second activity participated by players from Zone 1 or Zone 2, after the data modification operation is executed on the activity server, it will be synchronized to the Zone 1 game server and the Zone 2 game server. There is data sharing between the Zone 1 game server and the Zone 2 game server, so the second activity is a cross-server game activity.

[0065] It can be seen that compared with the first embodiment, this embodiment can not only simplify the development of cross-server activities of the game, but also realize the coexistence of cross-server activities and single-server activities.

[0066] In this embodiment, only the first activity module (corresponding to Figure 5 Activity module A in the game server can exist independently. When you need to expand a single-server activity to a cross-server activity, you only need to add a new game server and create a mirror copy of the first activity module in the new game server. Figure 5 shown.

[0067] Embodiment 3 On the basis of the above-mentioned embodiment 1 and embodiment 2, one or more game servers of this embodiment are loaded with a game function module. After the game function module is loaded, the player can participate in a new game activity (hereinafter referred to as the third activity) based on the game function module. When the player participates in the third activity, the generated data requests are all executed in the corresponding game server, and the activity server is not involved.

[0068] This embodiment is explained by taking the example of loading the game function module on the second zone game server based on the second embodiment.

[0069] When a player in zone 2 sends a data request to a game server in zone 2, the activity component of the game server in zone 2 identifies the data request as a first-category data request or a second-category data request based on the activity name of the data request; if it is identified as a first-category data request, the processing flow of embodiment 2 is performed. If it is identified as a second-category data request, the game server in zone 2 finds the corresponding game function module based on the activity name, passes parameters and executes the method corresponding to the calling method name in the game function module, and returns the corresponding data to the player in zone 2 after the execution is completed.

[0070] For the activity names of the activity body and the mirror copy, a first mark may be added to the activity name. When the game server recognizes that the activity name contains the first mark, it determines that the data request is a first-class data request. For the activity name corresponding to the game function module, a second mark may be added to the activity name. When the game server recognizes that the activity name contains the second mark, it determines that the data request is a second-class data request.

[0071] It can be seen that in this embodiment, in addition to realizing the functions of the first and second embodiments, it is also possible to realize single-server game activities that do not involve activity servers.

[0072] In the above embodiments 1 to 3, the same activity module can start multiple different activities with different names: for example, an activity named "Activity 1" can load three activity instances with specific names of "Activity 1 Zone 1 Single Server Competition", "Activity 1 1~4 Preliminary Competition" and "Activity 1 1~16 Final Competition". They are completely independent and do not interfere with each other. The only difference is the number of game servers they serve. Game servers and player clients can obtain specific activities by name respectively.

[0073] If a game server currently has an active single-server activity, remove it from the service server list of the activity, or delete the single-server activity, and then add it to the service server list of activities that already have one or more other servers participating, the game server of the game server will remove the mirror copy of the single-server activity, and create a mirror copy of the activity with multiple servers participating, and push it to the player client for synchronization, thus realizing the online dynamic switching from single-server gameplay to cross-server gameplay. Usage scenario example: an activity only has single-server gameplay at the beginning of the server opening, and leaves the single-server activity one month after the server opening, creates or joins a cross-server consisting of 4 servers close to the server opening time, leaves the current activity 3 months later, and joins a cross-server activity consisting of 16 nearby servers, and so on, you can start from a single server and continuously switch and expand the cross-server scope.

[0074] In summary, the present invention can simplify the development of cross-server activities and can also realize the coexistence of single-server activities and cross-server activities.

[0075] The above description is merely an embodiment of the present invention and does not limit the technical scope of the present invention. Therefore, any minor modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for implementing a game activity, characterized in that: The method comprises a basic framework construction step, an initialization step and a game data processing step; The basic framework construction steps are used to build the basic framework in the game server and activity server, as follows: Each function in the game server is an independent game function module, and all game function modules are selectively loaded; the activity server is a game server without any game function module loaded, and all game function modules that can be loaded by the game server can be loaded and run normally by the activity server; An activity manager module is provided in both the game server and the activity server; wherein the activity manager module in the game server is used to receive assignment information and load the activity module according to the activity responsibility; or is used to receive the activity module data pushed by the activity server and rebuild the mirror copy module through the received activity module data; the activity manager module in the activity server is used to receive assignment information and load the activity module as the activity subject according to the assignment information, and push the activity module data to the game server; The activity module is implemented by adding activity components to the game function module to obtain the functions of timed opening, multi-person participation or cross-server participation; The activity component can realize object type identification on its own side, and the object categories include single-server activity objects, main body objects of cross-server activities, and mirror copy objects of cross-server activities; The activity component is used to package the configuration data access interface. When packaging the configuration data access interface, the data access interface of the cross-server activity module is packaged to be consistent with the data access interface of the non-cross-server activity module; The activity component is also used to configure data synchronization and stratification. When configuring data synchronization and stratification, the activity component is responsible for cross-server data synchronization. When the activity entity data of the activity server changes, it will synchronize the change to its mirror copy on the game server, so that the mirror copy data is synchronized with the activity entity. The activity entity has all the data, and the activity entity only synchronizes the required data to the game server. The game server then sends the public data and the data required only by the player to the data-related player from the data after stratification and filtering. The activity component provides the activity module with a unique entry interface that is called from the outside. All external requests to the activity body and mirror copy will pass the request method and parameters through this entry interface. The initialization step includes: The activity manager of the activity server receives one or more assignment information, the assignment information including activity module data and a game zone server list, the game zone server list including game servers of one zone and corresponding network addresses, or including two or more game servers belonging to different zones and corresponding network addresses; The activity manager of the activity server loads the activity module according to the received activity module data as the activity body. The activity module data in different assignment information are different, and the activity name of the corresponding activity body is different. The activity manager of the activity server sends the activity module data to the corresponding game server according to the network address in the game zone server list; The activity manager of the game server creates a mirror copy of the cross-server activity module according to the received activity module data. The activity name of the mirror copy is the same as the activity name of the corresponding activity body, and the functions and codes executed by the two are the same; The game data processing step includes a step of processing a data request received by a game server from a client, which includes: When the activity manager of the game server receives a data request, the activity component identifies the data request as a first-category data request according to the activity name in the data request; the activity component identifies the current end as a mirror copy of the game server, and determines whether the execution end of the data request is a mirror copy or an activity entity, wherein the data request includes an activity name, a calling method name, and parameters; If the execution end of the data request is a mirror copy, the activity manager of the game server finds the corresponding mirror copy according to the activity name, finds the corresponding method in the mirror copy according to the calling method name, passes parameters through the entry interface of the activity component and executes it; If the execution end of the data request is the activity entity, the data request is an RPC request; the game server executes the RPC request and sends the activity name, method name and parameters to the activity server through the activity manager; The activity manager of the activity server receives the RPC request, finds the activity body according to the activity name, finds the method on the activity body according to the method name, passes the parameters through the entry interface of the activity component and executes it; Before the activity server finishes executing and returns, the activity manager synchronizes the data modified during the activity body execution to the mirror copies of all game servers in the game zone server list; The activity manager of the activity server returns the RPC execution result to the corresponding game server in the original path; The game server's activity manager receives the returned result and the request is completed.

2. A method for implementing a game activity according to claim 1, characterized in that: The game server loads zero or more game function modules, and the activity server does not load any game function modules.

3. A method for implementing a game activity according to claim 2, characterized in that: The game server loads more than one game function modules. When the game server receives a data request, it identifies the data request as a second-category data request based on the activity name in the data request; the game server finds the corresponding game function module based on the activity name, passes parameters and executes the method corresponding to the calling method name in the game function module.

4. A method for implementing a game activity according to any one of claims 1 to 3, characterized in that: The activity names of the activity entity and the mirror copy are provided with a first mark. When the game server recognizes that the activity name has the first mark, it determines that the data request is a first-category data request.

5. A method for implementing a game activity according to any one of claims 1 to 3, characterized in that: The method for the active component of the game server to determine whether the execution end of the data request is a mirror copy or an active entity is as follows: for the data request of the execution end in the active entity, the client adds a cross-server mark when generating the data request; For data requests from the execution end on the mirror copy, the client adds a local tag when generating the data request; When the game server recognizes the cross-server tag in the data request, it determines that the execution end of the data request is the active entity. When the game server recognizes the local tag in the data request, it determines that the execution end of the data request is a mirror copy.

6. A method for implementing a game activity according to claim 5, characterized in that: A "GET" tag or a "POST" tag is set after the cross-server tag and the local tag. The "GET" tag indicates waiting to receive the call result, and the "POST" tag indicates that there is no need to wait for the result.

7. A method for implementing a game activity according to claim 1, characterized in that: The game processing step also includes: a step of processing a data request received by the game server from the active server, which includes the active server's active entity making an RPC call to the mirror copies of all game servers; specifically as follows: (1) The activity server determines the target ID list of the remote call based on the server_id parameter passed in when calling; (2) The activity manager of the activity server sends the activity name, method name and parameters to each game server in the above list respectively, and records the number of sends. When the number of sends reaches the set value, it ends or waits for all remote calls to return; (3) The activity manager of the game server receives the RPC request, finds the activity mirror copy according to the activity name, finds the method on the activity mirror copy according to the method name, passes parameters through the entry interface of the activity component, and executes it; (4) The game server's activity manager returns the RPC execution result by the original path; (5) After receiving the returned result, the activity manager of the activity server determines whether all requests have been returned; if so, it returns a list of all game server call results to indicate that the request is complete; otherwise, it continues to wait for other game servers to return.