State synchronization-based game online method, online server, system and medium
By creating rooms and broadcasting synchronized messages in online games, the problem of excessive pressure on a single client or server is solved, achieving consistency of game status and efficient resource management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN YIHAI MUTUAL ENTERTAINMENT INFORMATION TECH CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, performing logical operations through a single client or server leads to excessive pressure on the client or server in online games, making it difficult to effectively manage the operation commands of multiple clients.
By receiving room creation requests from online clients, creating rooms, and recording the entity attribute information of each client, the game state is updated using broadcast synchronization messages to reduce server pressure, and the master party is switched when a client disconnects to maintain game state consistency.
It effectively reduces the pressure on the client or server in online games, ensures game status synchronization, and avoids disconnections affecting game scene updates.
Smart Images

Figure CN115779403B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and in particular to a game online method, online server, system and medium based on state synchronization. Background Technology
[0002] State synchronization refers to all clients sending operation command data to a single client or server. After the single client or server processes the logical operations, it synchronizes the corresponding object state data in the game scene to other clients through the server, ensuring that the content displayed on each client's screen is the same. However, in online games, multiple clients are often involved, and the number of operation commands sent by these clients is enormous. If only a single client or server performs the logical operations, it will put a huge burden on that single client or server. Summary of the Invention
[0003] The main objective of this invention is to provide a game online method, online server, system, and medium based on state synchronization, aiming to solve the technical problem of excessive client or server pressure caused by performing logical operations through a single host or server in the prior art.
[0004] To achieve the above objectives, the present invention provides a game online method based on state synchronization, the method comprising the following steps:
[0005] Receive a room creation request sent by a network client, and create a room according to the room creation request, wherein the room is used for the at least two network clients to play online games;
[0006] After receiving the room access request sent by the at least two online clients, the at least two online clients are connected to the room, and the attribute information of the entity created by each of the at least two online clients is recorded. The entity's master controller is the online client that created the entity, and the master controller is the online client that controls the entity.
[0007] Upon receiving synchronization messages from various online clients, the synchronization messages are verified, and after successful verification, the attribute information of the corresponding entity is updated according to the synchronization messages. The synchronization messages are generated by each online client based on its own or other online clients' operation instructions on the entity it controls.
[0008] The synchronization message is broadcast to other online clients in the room to synchronize the game status in the online game.
[0009] Optionally, the game online method based on state synchronization further includes:
[0010] When any online client in the room is detected to have gone offline, the master control of all entities controlled by that online client is switched to other online clients in the room, and the switching of master control is broadcast.
[0011] Optionally, after switching the master control of all entities controlled by the online client to other online clients in the room and broadcasting the switching action, the method further includes:
[0012] After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities;
[0013] If the creation strategy is a strategy of disconnecting and reconnecting to switch back to the master control side.
[0014] Switch the control of the entity back to the disconnected online client.
[0015] Optionally, after switching the master control of all entities controlled by the online client to other online clients in the room and broadcasting the switching action, the method further includes:
[0016] After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities;
[0017] If the creation strategy is one that allows disconnection and reconnection without switching back to the controlling party, the current controlling party of the entity will remain unchanged.
[0018] Optionally, the step of validating the synchronization message and updating the attribute information of the corresponding entity based on the synchronization message after the validation passes includes:
[0019] Verify whether the synchronization message was sent by the entity's controller;
[0020] After confirming that the synchronization message was sent by the entity's controlling party, the verification of the synchronization message passed;
[0021] After successful verification, the attribute information of the corresponding entity is updated according to the synchronization message.
[0022] Optionally, the game online method based on state synchronization further includes:
[0023] Netty is used to receive or send information.
[0024] Furthermore, to achieve the above objectives, the present invention also proposes an online server, the online server comprising: a memory, a processor, and a state-synchronized game online program stored on the memory and executable on the processor, the state-synchronized game online program being configured to implement the steps of the state-synchronized game online method described above.
[0025] Furthermore, to achieve the above objectives, this invention also proposes a state-synchronization-based online game system, which includes an online server and at least two online clients; wherein,
[0026] The online server is used to receive room creation requests sent by online clients and create rooms according to the room creation requests, wherein the rooms are used for online gaming by the at least two online clients;
[0027] The online server is configured to, upon receiving an access request for the room from the at least two online clients, connect the at least two online clients to the room and record the attribute information of the entity created by each of the at least two online clients, wherein the controlling party of the entity is the online client that created the entity, and the controlling party is the online client that controls the entity.
[0028] The online server is used to verify the synchronization message when it receives the synchronization message sent by each online client, and update the attribute information of the corresponding entity according to the synchronization message after the verification is successful. The synchronization message is generated by each online client according to the operation instructions of itself or other online clients on the entity controlled by itself.
[0029] The online server is used to broadcast synchronization messages to other online clients in the room to achieve game state synchronization in online games.
[0030] Optionally, the online client is used to determine the corresponding roles of all entities it controls;
[0031] When the online client receives an operation instruction from itself or another online client for the corresponding role, it performs logical operations based on the operation instruction to generate a synchronization message, wherein the logical operations of the entity run on the entity's master controller.
[0032] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a state-synchronized game online program, wherein when the state-synchronized game online program is executed by a processor, it implements the steps of the state-synchronized game online method described above.
[0033] This invention proposes a game online method based on state synchronization. It receives room creation requests from online clients and creates rooms accordingly, whereby the rooms are used for online gaming by at least two online clients. Upon receiving access requests from the at least two online clients, the method connects them to the room and records the attribute information of the entities created by each client. The entity's master controller is the online client that created the entity. Upon receiving synchronization messages from each online client, the method verifies the messages and updates the corresponding entity's attribute information based on the synchronization messages. These synchronization messages are generated by each online client based on its own or other online clients' operation instructions on the entities it controls. The synchronization messages are broadcast to other online clients within the room to achieve game state synchronization in the online game. Through this method, each player's online client can run the logic of its controlled entity, effectively reducing the pressure on the client or server in the online game. Attached Figure Description
[0034] Figure 1 This is a schematic diagram of the structure of the online server in the hardware operating environment involved in the embodiments of the present invention;
[0035] Figure 2 This is a flowchart illustrating the first embodiment of the game online method based on state synchronization of the present invention;
[0036] Figure 3 This is a schematic diagram illustrating the verification between the online server and the online client in the first embodiment of the game online method based on state synchronization of the present invention;
[0037] Figure 4 This is a schematic diagram illustrating the interaction between the online server and the online client in the first embodiment of the game online method based on state synchronization of the present invention;
[0038] Figure 5 This is a flowchart illustrating the second embodiment of the game online method based on state synchronization of the present invention;
[0039] Figure 6This is a schematic diagram of the first switching strategy between the online server and the online client in the second embodiment of the game online method based on state synchronization of the present invention;
[0040] Figure 7 This is a schematic diagram of the second switching strategy between the online server and the online client in the second embodiment of the game online method based on state synchronization of the present invention;
[0041] Figure 8 This is a structural block diagram of the first embodiment of the game online system based on state synchronization of the present invention.
[0042] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0043] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0044] Reference Figure 1 , Figure 1 This is a schematic diagram of the online server structure of the hardware operating environment involved in the embodiments of the present invention.
[0045] like Figure 1 As shown, the online server may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0046] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the online server and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0047] like Figure 1As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a game online program based on state synchronization.
[0048] exist Figure 1 In the online server shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the online server of the present invention can be set in the online server. The online server calls the state-synchronized game online program stored in the memory 1005 through the processor 1001 and executes the state-synchronized game online method provided in the embodiment of the present invention.
[0049] Based on the above hardware structure, an embodiment of the game online method based on state synchronization of the present invention is proposed.
[0050] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of a game online method based on state synchronization according to the present invention.
[0051] In this embodiment, the game online method based on state synchronization includes the following steps:
[0052] Step S10: Receive a room creation request sent by the online client, and create a room according to the room creation request, wherein the room is used for the at least two online clients to play online games.
[0053] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a mobile phone, tablet computer, or personal computer, or an electronic device or online server capable of performing the above functions. The following description uses the online server as an example to illustrate this embodiment and the subsequent embodiments.
[0054] It should be noted that a room is a collection of online clients. The online clients and the state synchronization of the game scene in different rooms do not interfere with each other. Each room maintains its own online clients and the entities created by the online clients.
[0055] It should be noted that state synchronization in online games refers to the use of synchronization mechanisms to ensure the consistency of the game interface among various online clients within the same room.
[0056] In practice, after player A logs into the online game through online client A, they can send a room creation request to the online server. After receiving the room creation request, the online server can create the room. After the room is created, other players can apply to join the room through other online clients to play the game online.
[0057] Step S20: After receiving the access request for the room sent by the at least two online clients, connect the at least two online clients to the room and record the attribute information of the entity created by each of the at least two online clients. The main controller of the entity is the online client that created the entity, and the main controller is the online client that controls the entity.
[0058] It should be noted that an entity can be considered a synchronization unit. Each online client joining a room can create one or more entities, and each entity is bound to one or more game characters. For example, character A is bound to entity A. When character A needs to synchronize its state, the entity A bound to character A is first determined, and then the controller of entity A, i.e., the online client corresponding to entity A, is determined. During the online game, all actions or command messages for character A are logically calculated by the online client corresponding to entity A, and then the online client sends the synchronization message generated by the logical calculation to the online server.
[0059] Understandably, the entity's controller refers to the online client that can perform logical operations on the command messages of the game character bound to the entity. Only the entity's controller can modify the entity's attribute information, while non-entity controllers cannot modify the entity's attribute information.
[0060] It should be noted that the attribute information of an entity includes, but is not limited to, the entity's name and type, the entity's controlling party, the game character bound to the entity, the game character's health points, and the game character's coordinates, speed, direction data, etc.
[0061] Step S30: Upon receiving a synchronization message from each online client, the synchronization message is verified, and after the verification passes, the attribute information of the corresponding entity is updated according to the synchronization message. The synchronization message is generated by each online client based on its own or other online clients' operation instructions on the entity it controls.
[0062] It should be noted that synchronization messages refer to data generated after the online client performs logical operations on command messages. The purpose of the online server verifying synchronization messages is to confirm that the synchronization message was sent by the entity's controlling party.
[0063] It should be noted that operation instructions include, but are not limited to, actions or instruction messages. The entity that controls itself refers to the entity's controlling party.
[0064] In the specific implementation, the online server records that the main controller of entityA is the online client A, and also records that entityA is bound to character A. During the online game, all actions or command messages targeting character A are generated into synchronization messages by the online client A after logical calculation. For example, an action or command message targeting character A could be that player B attacked character A, or that player A controlled the character to move forward, etc.
[0065] In one embodiment, the step of validating the synchronization message and updating the attribute information of the corresponding entity based on the synchronization message after the validation passes includes:
[0066] Verify whether the synchronization message was sent by the entity's controller;
[0067] After confirming that the synchronization message was sent by the entity's controlling party, the verification of the synchronization message passed;
[0068] After successful verification, the attribute information of the corresponding entity is updated according to the synchronization message.
[0069] In specific implementations, such as Figure 3 As shown, the online server needs to verify the entity's controlling party before updating the previously recorded entity attribute information.
[0070] In this embodiment, verifying synchronization messages through an online server can effectively ensure that the logic of each entity only runs on its own master server.
[0071] Step S40: Sync the synchronization message to other online clients in the room via broadcast to achieve game state synchronization in the online game.
[0072] It should be noted that after receiving operations on an entity from other online clients, the controlling online client executes the corresponding logic to generate a synchronization message and then sends the synchronization message to the online server. The online server then broadcasts the synchronization message to synchronize the data. Online clients that are not the controlling online client only need to save the synchronization message or display it in the UI after receiving it.
[0073] In specific implementations, such as Figure 4 As shown, the online server records that the controller of entityA is online client A, and that entityA is bound to character A. During the online game, player B attacks character A. Essentially, the online server first sends a message to the controller of entityA: "Character A bound to entityA is being attacked by player B." After receiving this attack instruction, the controller of entityA, i.e., online client A, will calculate and obtain a synchronization message according to the game's own logic (the synchronization message can be entityA's health [attribute] deducting the corresponding value). The synchronization message is then sent to the online server. After verifying that the controller of entityA is online client A, the online server updates the previously recorded attribute information of entityA and broadcasts the synchronization message to other online clients in the room. After receiving the synchronization message, other online clients can make corresponding UI displays and update their local data, thus achieving synchronization of the game status of all online clients in the room.
[0074] In one embodiment, the game online method based on state synchronization further includes:
[0075] Netty is used to receive or send information.
[0076] It should be noted that at the server network level, the online server uses Netty to protect TCP connections and send and receive messages. At the same time, the online server's own message processing logic can be placed in Netty's worker thread for non-blocking asynchronous processing.
[0077] In this implementation, the online server uses Netty to send and receive messages, which enables the single-threaded online server to still have good performance under the pressure of a large number of synchronous messages.
[0078] This embodiment receives room creation requests from online clients and creates rooms based on these requests. These rooms are used for online gaming by at least two online clients. Upon receiving access requests from the at least two online clients, the system connects them to the room and records the attribute information of the entities created by each client. The entity's master controller is the online client that created the entity. Upon receiving synchronization messages from each online client, the system verifies these messages and updates the corresponding entity's attribute information based on the verification. These synchronization messages are generated by each online client based on its own or other online clients' operation instructions on the entities it controls. The synchronization messages are broadcast to other online clients within the room to synchronize the game state. Through this method, each player's online client can run the logic of its controlled entity, effectively reducing the load on the client or server in the online game.
[0079] refer to Figure 5 , Figure 5 This is a flowchart illustrating a second embodiment of a game online method based on state synchronization according to the present invention.
[0080] Based on the first embodiment described above, this embodiment's game online method based on state synchronization further includes, after step S40:
[0081] Step S50: When any online client in the room is detected to be offline, the master control of all entities controlled by that online client is switched to other online clients in the room, and the switching of master control is broadcast.
[0082] It should be noted that the online server will monitor the online status of online clients in the room in real time.
[0083] In the specific implementation, the online client corresponding to player A controls entityA and entityB. That is, the main controller of entityA and entityB is the online client A. When player A disconnects during the online game, the online server switches the main controller of entityA and entityB to other online clients in the room. The online server will then update the previously recorded entity attribute information and broadcast the action of switching the main controller.
[0084] Understandably, after the entity's control is switched to another online client in the room, the other online clients take over the responsibilities of the disconnected online client. For example, if entityA is bound to character A, and online client A disconnects, the online server switches the control of entityA to online client B in the room. Then, in the online game, actions and command messages for character A are processed by online client B to generate synchronization messages.
[0085] In one embodiment, after switching the master control of all entities controlled by the online client to other online clients in the room and broadcasting the switching action, the method further includes:
[0086] After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities;
[0087] If the creation strategy is to reconnect after disconnection and switch back to the master controller, then the master controller of the entity will be switched back to the disconnected online client.
[0088] It should be noted that after detecting a disconnected online client and initiating a reconnection, the system determines the entity previously controlled by the disconnected client and then determines the creation strategy for these entities. The strategy of switching back to the controlling entity upon reconnection means that when a disconnected online client reconnects, the controlling entity of that entity is switched from the current online client back to the disconnected online client, and this is broadcast through the online server.
[0089] In specific implementations, such as Figure 6 As shown, when player A's online client A disconnects and reconnects, since entityA was created with the strategy of switching back to the host after disconnection and reconnection, the server will automatically switch entityA back to player A's online client A and broadcast this switchback action.
[0090] In one embodiment, after switching the master control of all entities controlled by the online client to other online clients in the room and broadcasting the switching action, the method further includes:
[0091] After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities;
[0092] If the creation strategy is one that allows disconnection and reconnection without switching back to the controlling party, the current controlling party of the entity will remain unchanged.
[0093] It should be noted that after detecting a disconnected online client and initiating a reconnection, the system determines the entities previously controlled by the disconnected client and then determines the creation strategy for these entities. The strategy of not switching back to the controlling entity upon reconnection means that when a disconnected online client reconnects, the current controlling entity of that entity remains unchanged.
[0094] In specific implementations, such as Figure 7 As shown, when the online client corresponding to player A disconnects and reconnects, the controlling entity of entityA will remain unchanged because the creation strategy set when entityA was created is to not switch back to the controlling entity after disconnection and reconnection.
[0095] This embodiment switches the control of all entities controlled by any online client in the room to another online client in the room when the online client is detected to have disconnected, and broadcasts the switch. This avoids the impact of client disconnection on the updating of entity attribute information, and consequently, on the updating of the game scene in the online game.
[0096] Furthermore, this embodiment of the invention also proposes a storage medium storing a state-synchronized game online program, which, when executed by a processor, implements the steps of the state-synchronized game online method described above.
[0097] Reference Figure 8 , Figure 8 This is a structural block diagram of the first embodiment of the game online system based on state synchronization of the present invention.
[0098] like Figure 8 As shown, the game online system based on state synchronization proposed in this embodiment of the invention includes an online server 10 and at least two online clients 20; wherein,
[0099] The online server 10 is used to receive room creation requests sent by online clients and create rooms according to the room creation requests, wherein the rooms are used for online games by the at least two online clients.
[0100] The online server 10 is configured to, upon receiving an access request for the room from the at least two online clients, connect the at least two online clients to the room and record the attribute information of the entity created by each of the at least two online clients, wherein the main controller of the entity is the online client that created the entity, and the main controller is the online client that controls the entity.
[0101] The online server 10 is used to verify the synchronization message when it receives the synchronization message sent by each online client, and update the attribute information of the corresponding entity according to the synchronization message after the verification is successful. The synchronization message is generated by each online client according to the operation instructions of itself or other online clients on the entity it controls.
[0102] The online server 10 is used to broadcast synchronization messages to other online clients in the room to achieve game state synchronization in the online game.
[0103] The online client 20 is used to determine the corresponding role of all entities it controls; when it receives an operation instruction from itself or other online clients for the corresponding role, the online client performs logical operations according to the operation instruction and generates a synchronization message, wherein the logical operations of the entity run on the main controller of the entity.
[0104] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0105] This embodiment receives room creation requests from online clients and creates rooms based on these requests. These rooms are used for online gaming by at least two online clients. Upon receiving access requests from the at least two online clients, the system connects them to the room and records the attribute information of the entities created by each client. The entity's master controller is the online client that created the entity. Upon receiving synchronization messages from each online client, the system verifies these messages and updates the corresponding entity's attribute information based on the verification. These synchronization messages are generated by each online client based on its own or other online clients' operation instructions on the entities it controls. The synchronization messages are broadcast to other online clients within the room to synchronize the game state. Through this method, each player's online client can run the logic of its controlled entity, effectively reducing the load on the client or server in the online game.
[0106] In one embodiment, the online server 10 is further configured to:
[0107] When any online client in the room is detected to have gone offline, the master control of all entities controlled by that online client is switched to other online clients in the room, and the switching of master control is broadcast.
[0108] In one embodiment, the online server 10 is further configured to:
[0109] After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities;
[0110] If the creation strategy is to reconnect after disconnection and switch back to the master controller, then the master controller of the entity will be switched back to the disconnected online client.
[0111] In one embodiment, the online server 10 is further configured to:
[0112] After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities;
[0113] If the creation strategy is one that allows disconnection and reconnection without switching back to the controlling party, the current controlling party of the entity will remain unchanged.
[0114] In one embodiment, the online server 10 is further configured to:
[0115] Verify whether the synchronization message was sent by the entity's controller;
[0116] After confirming that the synchronization message was sent by the entity's controlling party, the verification of the synchronization message passed;
[0117] After successful verification, the attribute information of the corresponding entity is updated according to the synchronization message.
[0118] In one embodiment, the online server 10 is further configured to:
[0119] Netty is used to receive or send information.
[0120] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0121] In addition, for technical details not described in detail in this embodiment, please refer to the game online method based on state synchronization provided in any embodiment of the present invention, which will not be repeated here.
[0122] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0123] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0125] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A game online method based on state synchronization, characterized in that, The state-synchronization-based online game method includes: Receive a room creation request sent by a network client, and create a room according to the room creation request, wherein the room is used for at least two network clients to play online games; After receiving access requests to the room from at least two online clients, the at least two online clients are connected to the room, and the attribute information of the entities created by each of the at least two online clients is recorded. The entity's master controller is the online client that created the entity. The master controller is the online client that controls the entity. The master controller is responsible for performing logical operations on the entities it controls and generating synchronization messages based on its own or other online clients' operation instructions for the entity. Upon receiving synchronization messages from various online clients, the synchronization messages are verified, and after successful verification, the attribute information of the corresponding entity is updated according to the synchronization messages. The synchronization messages are generated by each online client based on its own or other online clients' operation instructions on the entity it controls. The synchronization message is broadcast to other online clients in the room to achieve game state synchronization in online games; The step of validating the synchronization message and updating the corresponding entity's attribute information based on the synchronization message after successful validation includes: Verify whether the synchronization message was sent by the entity's controller; after confirming that the synchronization message was sent by the entity's controller, the verification of the synchronization message passes; after the verification passes, update the corresponding entity's attribute information according to the synchronization message.
2. The method as described in claim 1, characterized in that, The state synchronization-based online gaming method also includes: When any online client in the room is detected to have gone offline, the master control of all entities controlled by that online client is switched to other online clients in the room, and the switching of master control is broadcast.
3. The method as described in claim 2, characterized in that, After switching the master control of all entities controlled by the online client to other online clients in the room and broadcasting the master control switching action, the process also includes: After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities; If the creation strategy is to reconnect after disconnection and switch back to the master controller, then the master controller of the entity will be switched back to the disconnected online client.
4. The method as described in claim 2, characterized in that, After switching the master control of all entities controlled by the online client to other online clients in the room and broadcasting the master control switching action, the process also includes: After detecting a disconnected online client and reconnecting, determine the creation strategy for all entities; If the creation strategy is one that allows disconnection and reconnection without switching back to the controlling party, the current controlling party of the entity will remain unchanged.
5. The method as described in claim 1, characterized in that, The state synchronization-based online gaming method also includes: Netty is used to receive or send information.
6. An online server, characterized in that, The online server includes: a memory, a processor, and a state-synchronized game online program stored on the memory and executable on the processor, the state-synchronized game online program being configured to implement the steps of the state-synchronized game online method as described in any one of claims 1 to 5.
7. A game online system based on state synchronization, characterized in that, The state-synchronization-based online game system includes an online server and at least two online clients; wherein... The online server is used to receive room creation requests sent by online clients and create rooms according to the room creation requests, wherein the rooms are used for online gaming by the at least two online clients; The online server is configured to, upon receiving access requests for the room from at least two online clients, connect the at least two online clients to the room and record the attribute information of the entities created by each of the at least two online clients. The entity's master controller is the online client that created the entity. The master controller is the online client that controls the entity and is responsible for performing logical operations on the entities it controls and generating synchronization messages based on its own or other online clients' operation instructions for the entity. The online server is configured to verify the synchronization messages received from each online client, and update the attribute information of the corresponding entity based on the verification message after successful verification. The synchronization messages are generated by each online client based on operation instructions from itself or other online clients to the entity it controls. The verification process includes checking whether the synchronization message was sent by the entity's controlling party; if it is confirmed that the synchronization message was sent by the entity's controlling party, the verification of the synchronization message is successful; and after successful verification, the attribute information of the corresponding entity is updated based on the synchronization message. The online server is used to broadcast synchronization messages to other online clients in the room to achieve game state synchronization in online games.
8. The system as described in claim 7, characterized in that, The online client is used to determine the corresponding role of all entities it controls; When the online client receives an operation instruction from itself or another online client for the corresponding role, it performs logical operations based on the operation instruction to generate a synchronization message, wherein the logical operations of the entity run on the entity's master controller.
9. A storage medium, characterized in that, The storage medium stores a state-synchronized game online program, which, when executed by a processor, implements the steps of the state-synchronized game online method as described in any one of claims 1 to 5.