CN109857439B - Game version updating method and device - Google Patents

Game version updating method and device Download PDF

Info

Publication number
CN109857439B
CN109857439B CN201910094186.4A CN201910094186A CN109857439B CN 109857439 B CN109857439 B CN 109857439B CN 201910094186 A CN201910094186 A CN 201910094186A CN 109857439 B CN109857439 B CN 109857439B
Authority
CN
China
Prior art keywords
game
version
old
client
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910094186.4A
Other languages
Chinese (zh)
Other versions
CN109857439A (en
Inventor
林国华
陈伟哲
程用远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910094186.4A priority Critical patent/CN109857439B/en
Publication of CN109857439A publication Critical patent/CN109857439A/en
Application granted granted Critical
Publication of CN109857439B publication Critical patent/CN109857439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of internet, in particular to a method and a device for updating a game version, which are used for achieving the purpose of updating the game version under the condition of not stopping the service of a game server, so that the user experience is improved. The method comprises the steps of determining an old version game client connected with an old version game server, and determining the current game state of the old version game client; if the game state is the role non-idle state, sending a reconnection instruction to the old version game client when the game state is monitored to be updated from the role non-idle state to the role idle state; the reconnection instruction is used for disconnecting the old version game client from the old version game server and establishing connection with the new version game server.

Description

Game version updating method and device
Technical Field
The invention relates to the technical field of internet, in particular to a method and a device for updating a game version.
Background
The online game is an instant online network service, in order to more quickly push new content to attract players, the updating of online game versions is frequent, at present, when the online game versions are updated, the game network service provided by a game server needs to be interrupted, and in order to reduce the influence on the players in the updating process of the online game versions, the updating is usually selected to be carried out at a specific time such as midnight.
Disclosure of Invention
The embodiment of the invention provides a method and a device for updating a game version, which are used for achieving the purpose of updating the game version under the condition of not stopping the service of a game server, so that the user experience is improved.
In one aspect, an embodiment of the present invention provides a method for updating a game version, including:
determining an old version game client that establishes a connection with an old version game server, an
Determining the current game state of the old version game client;
if the game state is the role non-idle state, sending a reconnection instruction to the old version game client when the game state is monitored to be updated from the role non-idle state to the role idle state;
the reconnection instruction is used for disconnecting the old version game client from the old version game server and establishing connection with the new version game server.
On the other hand, the embodiment of the invention also provides a method for updating the game version, which comprises the following steps:
acquiring a request for establishing connection with a new version game server, which is sent by a game client, wherein the request carries game version information of the game client;
and if the game client is determined to be the old version game client according to the game version information, sending game data corresponding to the old version game to the game client.
On the other hand, an embodiment of the present invention further provides an update apparatus for a game version, including:
the device comprises an obtaining unit, a processing unit and a processing unit, wherein the obtaining unit is used for obtaining a request for establishing connection with a new version game server, which is sent by a game client, and the request carries game version information of the game client;
and the sending unit is used for sending game data corresponding to the old version game to the game client if the game client is determined to be the old version game client according to the game version information.
In another aspect, an embodiment of the present invention further provides a computing apparatus, including at least one processor and at least one memory, where the memory stores a computer program, and when the program is executed by the processor, the processor is caused to execute the steps of the method for updating a game version in the embodiment of the present invention.
The embodiment of the invention provides a method for updating a game version, which is characterized in that after an old version game client end which is connected with an old version game server is determined, the current game state of the old version game client end is further determined, if the game state is a role non-idle state, namely, the game state is in a game battle, the game state is monitored, and when the game state of the old version game client end is monitored to be updated from the role non-idle state to the role idle state, namely, the game battle is finished, a reconnection instruction is sent to the old version game client end, so that the old version game client end is disconnected from the old version game server, and is connected with the new version game server, and the update of the game version is finished. Therefore, the purpose of completing the update of the game version without stopping the service of the game server is achieved. Therefore, the user experience is improved, and meanwhile, the flexibility of the updating time of the game version is increased because the method does not need to update the game version at a specific time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention.
Fig. 1A is a schematic view of an application scenario provided in an embodiment of the present invention;
FIG. 1B is a schematic diagram of a game server according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for updating a game version according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a game server and a game client according to an embodiment of the present invention;
FIG. 4 is a flow chart of another method for updating a game version according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of stored game data according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a game server competing for a distributed lock according to an embodiment of the present invention;
FIG. 7 is a flowchart of a distributed lock contention method according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a game version updating apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the technical solutions of the present invention. All other embodiments obtained by a person skilled in the art without any inventive work based on the embodiments described in the present application are within the scope of the protection of the technical solution of the present invention.
Some concepts related to the embodiments of the present invention are described below.
UE 4: the Unreal Engine 4 is a set of integrated tools specially provided for game development, design, construction and simulation.
And (2) DS: the Dedicated Server is a Dedicated Server generated based on the compilation of the UE4, which is the Server responsible for the combat logic in the game.
TGW: namely Tencent Gateway, is a system for realizing multi-network unified access and supporting automatic load balancing.
GameServer: namely a game server, a server for providing game service, and a game client for interacting with the game player to complete the game operation of the game player.
And RS: namely, Real Server, is a host that really provides game services, and in a game, RS generally refers to GameServer.
The LVS, namely the Linux Virtual Server, provides the function of the Directory of the load balancer, does not provide services per se, and only forwards a specific request to the corresponding RS, thereby realizing load balancing in the cluster environment.
TCP: namely, Transmission Control Protocol, is a connection-oriented, reliable transport layer communication Protocol based on byte streams.
UDP: the User Datagram Protocol is a connectionless transport layer Protocol in the OSI (Open System Interconnection) reference model, and provides a transaction-oriented simple unreliable information transfer service.
ZooKeeper: the Apache software foundation is a software project of the Apache software foundation and provides open-source distributed configuration service, synchronization service and naming registration for large-scale distributed computing.
The game version is as follows: refers to a collection of experienceable content that is built up at some stage of game development.
As described above, in the conventional art, in order to reduce the influence on the player in the course of updating the version of the network game, the player is selected to update at a specific time, for example, in the middle of the night, however, even in the middle of the night, the player who plays the game online inevitably affects the physical examination of the player if the service of the game server is stopped. For this reason, the inventor of the present invention considers that different game states have different requirements on timeliness of game operations, and a game state generally includes a state in which a character is not in an idle state and a character in an idle state, where a character refers to a character of a game player in a game. When the game state is the state that the character is not in the idle state, the game player is in the game battle, at the moment, the game player needs to perform real-time operation in the game, and the content related to the game battle needs to be updated in real time, so that the game client needs to perform high-time game data communication with the game server so as to present the latest battle state at the game client and guide the game player to continue the game battle. If the game client is switched from the old version server to the new version server, the game player is inevitably disconnected, the game player cannot continue the game battle, namely the game battle is terminated, and the experience of the game player is seriously influenced.
And when the game is in a role idle state, namely the game player is not in a game battle, for example, the game player is performing operations such as game equipment selection, game scene selection and the like in a game hall, at the moment, the timeliness requirement of the operations of the game player in the game hall is not high, for example, the game hall presents the game equipment to the game player for browsing, a certain time buffer exists until the game player finally selects the game equipment, the time buffer can be completely used for switching the game client from an old version server to a new version server, and the game client is difficult to perceive by the game player, so that the experience of the game player cannot be influenced.
Based on this, an embodiment of the present invention provides a method for updating a game version, where after an old-version game client connected to an old-version game server is determined, a current game state of the old-version game client needs to be further determined, and if the game state is a role non-idle state, i.e., during a game battle, the game state is monitored, and when it is monitored that the game state of the old-version game client is updated from the role non-idle state to the role idle state, i.e., the game battle is over, a reconnect instruction is sent to the old-version game client, so that the old-version game client disconnects from the old-version game server and establishes a connection with the new-version game server, thereby completing updating the game version. Therefore, the purpose of completing the update of the game version without stopping the service of the game server is achieved. Therefore, the user experience is improved, and meanwhile, the flexibility of the updating time of the game version is increased because the method does not need to update the game version at a specific time.
The game version updating method in the embodiment of the present invention may be applied to an application scenario as shown in fig. 1A, where the application scenario includes a game player 10, a terminal device 11, a game server 12, and a game server 13, where the terminal device 11 is installed with a client of an old version game, and the old version game is a game version to be updated. The game server 12 is a server supporting an old version game, and the game server 13 is a server supporting a new version game, and also has a service for the old version game, that is, the game server 13 can also support a service for the old version game. The new version game refers to an updated game version newly developed or released, and generally, the new version game is a product of updating functions of an old version game, and the updating of the functions includes solving bugs (problems) of the old version game, adding some functions, deleting some functions, and the like.
The game server 12 and the game server 13 may be one server, or may be a server cluster or a cloud computing center formed by a plurality of servers. In the application scenario shown in fig. 1A, game server 12 is a server cluster including a plurality of servers, and game server 13 is also a server cluster including a plurality of servers.
In practical application, considering the complicated logic of online games, the corresponding game server is usually composed of a plurality of functional modules, these function modules may be supported by one or more servers in a game server, and as shown in fig. 1B, a schematic diagram of a structure in the game server 13 in the application scenario shown in fig. 1A, includes a lobby service module for implementing a game lobby service function, i.e., the lobby service in fig. 1B, a matching service module that implements a game matching service, i.e., the matching service in fig. 1B, a tournament service module that implements a game tournament service, i.e., the tournament service in fig. 1B, a dsagent module for managing the combat server DS in the game, i.e., dsagenty in fig. 1B, and a combat server DS implementing game combat, among them, the DS includes DS1 supporting the old version game and DS2 supporting the new version game. Similarly, the game server 12 may also include a lobby service module, a matching service function module, a match service, a dsagent module, and a DS supporting an old version of game (excluding a DS supporting a new version of game).
In the application scenario shown in fig. 1A, the terminal device 11 and the game server 12 are connected via a network, which may be any one of communication networks such as a local area network, a wide area network, or a mobile internet. The game player 10 logs in the game server 12 to perform game operation through the client of the old version game in the terminal device 11, and when the game version needs to be updated, according to the method provided by the embodiment of the present invention, firstly, the old version game client connected to the game server 12, that is, the terminal device 11 in fig. 1A, is determined, then, the current game state of the old version game client is determined, if the current game state of the old version game client is a role non-idle state, that is, a fighting state in which the old version game client is in a role non-idle state, then, the game state of the old version game client can be monitored, when the game state is monitored to be updated from the role non-idle state to the role idle state, a reconnect instruction can be sent to the terminal device 11 in the old version game client, that is, in fig. 1A, so that the old version game client is disconnected from the game server 12, and establishes a connection with the game server 13, thereby realizing that the update of the game version is completed under the condition of stopping the service of the game server, thereby reducing the influence on the game player and improving the physical examination of the game player.
It should be noted that the above-mentioned application scenarios are only presented to facilitate understanding of the spirit and principles of the present invention, and the present invention is not limited in this respect. Rather, embodiments of the present invention may be applied in any scenario where applicable.
It should be noted that the method in the embodiment of the present invention may be applied to any type of game version update scenario of an online game, and is particularly suitable for being applied to a game version update scenario of an online game edited based on the UE 4.
The following describes a game version updating method provided by an embodiment of the present invention in conjunction with the application scenario described above.
As shown in fig. 2, the method for updating a game version provided in the embodiment of the present invention includes:
step 201: an old version game client that establishes a connection with an old version game server is determined.
The old-version game client in step 201 described above may be regarded as a client installed with an old-version game in the terminal device 11 in the application scenario shown in fig. 1A, and the old-version game server may be regarded as the game server 12 in the application scenario shown in fig. 1A.
In the embodiment of the present invention, when the game version needs to be updated, the old-version game server may determine the old-version game client currently connected to the old-version game server, in practical applications, one or more old-version game clients connected to the old-version game server may be determined, and one or more old-version game clients correspondingly determined to be connected to the old-version game server may also be determined.
Step 202: the routing address of the old version game client is changed into the address of the new version game server from the address of the old version game server.
In the embodiment of the present invention, as shown in fig. 3, a game client generally needs to implement connection with a game server through an access layer, the game server may also be referred to as a service logic layer, and the access layer records routing information from the game client to the game server, in fig. 3, the access layer may be further divided into a first access device responsible for routing an old version game client to an old version game server and a second access device responsible for routing a new version game client to a new version game server, and correspondingly, the first access device records a routing address of the old version game client as an address of the old version game server, and the second access device records a routing address of the new version game client as an address of the new version game server.
In practical applications, the first access device and the second access device may be a gateway TGW, or may be other types of relay proxy devices responsible for routing the game client to the game server, such as an open source LVS. Therefore, in the embodiment of the present invention, after determining the old-version game client that establishes a connection with the old-version game server, the routing address of the old-version game client in the first access device may be changed from the address of the old-version game server to the address of the new-version game server, for example, when the address of the old-version game server is: com, the address of the new version game server is: b.qq.com, then a.qq.com in the first access device may be changed by b.qq.com.
It should be noted that, although the routing information is changed in the first access device, the game data, i.e., the game request packet, still flows to the old version game server for the connection between the established old version game client and the old version game server. Therefore, in the embodiment of the present invention, the steps described below need to be further performed to close the currently established connection between the old-version game client and the old-version game server, and to create a connection with the new-version game server.
Step 203: and determining the current game state of the old version game client.
In the embodiment of the present invention, the game state of the game client refers to the game progress when the game player logs in the game server through the game client to perform the game operation, for example, the game state includes a character non-idle state and a character idle state.
The role non-idle state refers to that a game Player is in a game battle, the game battle refers to an interaction formed by using a game resource attack, wherein the game battle includes a PVP (Player over Player) mode, that is, players compete with each other, and a PVE (Player VS Environment) mode, and in some online network games, the role non-idle state may also be referred to as a game single-play state, that is, a state in which the game Player is in one-play game battle.
The character idle state refers to other states except for a state in which the character is not idle, such as a state in which the character is in a game hall, a state in which the character is in a team, and the like, and the state in the game hall refers to a state in which preparation is made for one game battle, and at this time, information related to the game, such as information of battle device selection, battle scene selection, battle partner matching, and the like, may be displayed in the game hall.
In the embodiment of the present invention, considering that, under the condition that the service of the game server is not stopped, the game clients in different game states are switched to the new version game service, and the influences on the game clients are different, in order to reduce the influences, in the embodiment of the present invention, different switching manners are performed on the old version game clients in different game states, so as to reduce the influences on the game players and improve the physical examination of the game players while completing the update of the game versions, and therefore, after the old version game client connected to the old version game server is determined, the current game state of the old version game client needs to be determined.
It should be noted that the step 203 may be executed after the step 202, before the step 202, or simultaneously with the step 202.
Step 204: if the game state is the role non-idle state, sending a reconnection instruction to the old version game client when the game state of the old version game client is monitored to be updated from the role non-idle state to the role idle state;
the reconnection instruction is used for disconnecting the old version game client from the old version game server and establishing connection with the new version game server.
In this embodiment of the present invention, a new version game server may be regarded as the game server 13 in the application scenario shown in fig. 1A, where the new version game server is a server that supports a new version game, and also considers the service of an old version game, that is, the service that can also support an old version game, and then the game server includes DS1 that supports an old version game and DS2 that supports a new version game.
In the embodiment of the invention, considering that the information communication timeliness between the game client and the game server is higher when the game player is in a fighting state, namely in a non-idle state of a character, the game player needs to perform real-time operation in the game, and the relevant content of the game fighting needs to be updated in real time, so that the game client needs to perform high-timeliness game data communication with the game server so as to present the latest fighting condition at the game client and guide the game player to continue the game fighting. If the game client is switched into the new version server from the old version server, the game player is disconnected, the game player cannot continue the game battle, namely the game battle is terminated, and the game client cannot receive the game battle settlement information, so that the experience of the game player is greatly influenced.
Therefore, in the embodiment of the present invention, when the determined game state of the old version game client is the role non-idle state, that is, the game player is in the game fighting state, the switching of the new version game server is not performed immediately, but the game state of the old version game client in the game fighting state is monitored. When the game state of the old version game client is updated from the role non-idle state to the role idle state, namely after one game is finished, a reconnect instruction is sent to the old version game client, meanwhile, the reconnect instruction can carry the settlement information of the game, so that after the old version game client receives the reconnect instruction, the fighting result of the game is presented according to the settlement information carried by the old version game client, the connection with the current old version server is disconnected according to the reconnect instruction, and the connection with the new version server is established.
In the embodiment of the present invention, the reconnecting instruction may specifically be a silent reconnecting instruction, or may be a regenerated instruction for disconnecting the old version game client from the old version game server and establishing a connection with the new version game server.
Step 205: and if the game state is the role idle state, sending a reconnection instruction to the old version game client.
In the embodiment of the present invention, considering that the game player is in the non-combat state, i.e., the role idle state, such as the state in the game lobby described above, at this time, the timeliness of the operation of the game player on the game is not high, and correspondingly, the timeliness requirement of the information exchange between the game client and the game server is not high, i.e., the game player does not need to operate in real time, so that, when the game state of the old version client is detected to be the role idle state, the old version game server can directly send the reconnection instruction to the old version game client so as to disconnect the connection with the current old version server and establish the connection with the new version server.
Therefore, by the above method, in the embodiment of the present invention, after determining the old version game client connected to the old version game server, the method further needs to determine the current game state of the old version game client, monitor the game state if the game state is a role non-idle state, i.e., during one game battle, and send a reconnect instruction to the old version game client when monitoring that the game state of the old version game client is updated from the role non-idle state to the role idle state, i.e., when a single game is finished, so as to disconnect the old version game client from the old version game server and establish a connection with the new version game server, thereby completing the update of the game version. Therefore, the purpose of completing the update of the game version without stopping the service of the game server is achieved. Therefore, the user experience is improved, and meanwhile, the flexibility of the updating time of the game version is increased because the method does not need to update the game version at a specific time.
As an alternative, in the embodiment of the present invention, after the old-version game client establishes a connection with the new-version game server, the new-version game server may execute the process shown in fig. 4:
the process shown in fig. 4 includes:
step 401: and obtaining a request for establishing connection with the new version game server sent by the game client, wherein the request carries the game version information of the game client.
Step 402: and determining the game client as the old version game client according to the game version information.
In the embodiment of the present invention, as described above, in consideration of the problem of compatibility of game versions, a fighting server, i.e., DS, corresponding to an old version of game is still deployed in a new version of game server, for example, as shown in fig. 1B above, the fighting server in the new version of game server includes a fighting server DS1 supporting the old version of game and a fighting server DS2 supporting the new version of game.
Therefore, as described above, after disconnecting from the old version game server, the old version game client may send a request for establishing connection to the new version game server, and may also carry game version information of the game client in the request, and after receiving the request, the new version game server may first establish a TCP connection with the old version game client, and then, after determining that the game client is the old version game client according to the game version information carried in the request, acquire game data corresponding to the old version game and send the game data to the old version game client, where a process of acquiring the game data corresponding to the old version game is as shown in steps 403 to 407.
Step 403: and acquiring the new version game data.
Step 404: deleting the newly added data of the new version game data; the new data is the data added by the new version game data compared with the old version game data.
Step 405: and sending the new version game data after the new data is deleted to the game client.
In the embodiment of the present invention, after the new version game server establishes the TCP connection with the old version game client, it is usually necessary to first acquire the data of the game lobby so that the old version game client logs in the game lobby, that is, the game lobby is presented at the game client, at this time, the new version game data in step 403 may be specifically the data of the new version game lobby, in the embodiment of the present invention, in the lobby service in the new version game server, the data of the new version game lobby is deployed, as shown in the process of data reading shown in fig. 5, the data of the game lobby of the old version game includes: the fields a, B and C, and the lobby data of the new version game includes the fields a, B, C and D, then the field D is the new addition data described above.
Therefore, after the new version game server acquires the lobby data of the new version game in the lobby service, the new data needs to be deleted, and then the new version game lobby data of which the new data is deleted is sent to the old version game client.
In practical applications, after the new version game server establishes a TCP connection with the old version game client, there is also a case where the old version game client writes data to the new version game server, for example, after the game client presents the game hall, the game player will operate in the game hall, such as selecting combat gear, combat mode, etc., the data generated by these operations performed by the game player in the lobby is fed back to the new version game server, that is, the data writing process shown in fig. 5, since the data storage format at the new version game server is stored in the corresponding field of the new version game, and the data fed back is generated based on the old version game hall, therefore, the new field of the new version game is missing, and at this time, the new field can be set as a default value and stored as a binary stream.
Step 406: a combat service corresponding to the game version information is determined.
Step 407: and sending the address information of the combat service to the game client, so that the game client establishes connection with the combat service to enter a role non-idle state.
In the embodiment of the invention, after a game client presents a game hall for operation, a game player enters the next game stage, such as a team formation stage, at the moment, a matching service can be called, team formation of the game player and other players in the game is completed, a further new version game server calls a match-making service to prepare for entering a single-game, at the moment, the new version game server can start a corresponding old version game fighting service DS, namely DS1 shown in figure 1B, according to version information of the old version game client, such as a game version number, based on a dsagent management module, and send an IP and a port number of DS1 to the old version game client, and the old version game client can be connected to a correct fighting server DS based on a UDP protocol through the IP and the port number of DS1, and further can enter a role non-idle state, namely game fighting.
As an alternative method, in the embodiment of the present invention, before the old-version game client disconnects from the old-version game server, the old-version game server may further perform the following steps: firstly, obtaining stored effective game data corresponding to an old version game client from a game database; the valid game data is then merged with the newly generated game data of the old version of the game client and is restored to the game database.
That is, in the embodiment of the present invention, after the routing information is changed in the access layer, new game data is still generated before the old-version game client is disconnected from the old-version game server, and the generated new game data still flows to the old-version game server. The valid game data refers to game data with the storage duration in the valid time period, and in practical application, the valid time period in the game database can be flexibly set, such as one week, three days and the like.
In the embodiment of the invention, after the stored effective game data corresponding to the old-version game client is obtained, the effective game data and the game data newly generated by the old-version game client can be merged in the old-version game server, and then the merged game data is stored in the game database again by the old-version game server, so that the data error condition is avoided in the process of updating the game version.
The game database is used for storing game data generated by the game client during game playing, and considering that the game data is usually huge, the game database can be a DB storage device which can be respectively in communication connection with an old version game server and a new version game server.
As an alternative, in the embodiment of the present invention, considering that there may be a situation that a game player of the old-version game client and a game player of the new-version game client play games simultaneously before the old-version game client disconnects from the old-version game server, then, in addition to the fact that the old-version game server stores the generated new game data in the game database in the manner described above, the new-version game server writes data into the game database, at this time, in order to ensure consistency of data states and avoid data errors, the new-version game server and the old-version game server may acquire the distributed lock by way of competing for the distributed lock as shown in fig. 6, so as to obtain the right to read and write game data in the game database, obtain the party of the distributed lock, pull valid game data of the existing DB to merge with local data, and finally written back to the DB, wherein OldServer represents an old version game server and NewServer represents a new version game server in FIG. 6.
The distributed lock may adopt Zookeeper, and a mode that a new version game server and an old version game server compete for the Zookeeper distributed lock is introduced below with reference to fig. 7:
first, when a new version game server and an old version game server need to write game data in a game database, the new version game server and the old version game server can respectively use a Lock directory in a Zookeeper to respectively use nodes nodldx according to a creation sequence.
Further, the new version game server and the old version game server set their respective counts iCount to zero, for example, the new version game server creation sequence node nodiddx is 1, and set their counts iCount to zero, and the old version game server creation sequence node nodiddx is 2 (since the new version game server has created the sequence node nodiddx to 1, the old version game server can only create the node nodiddx in order to be 2), and set their counts iCount to zero.
The second step is that: the new version game server and the old version game server respectively judge whether the value of the created sequence node nodidx is the same as the value of the sequence node nodidx with the minimum current value in the Lock directory.
In the embodiment of the invention, the sequence nodes respectively created by the new version game server and the old version game server are stored in the Lock directory, so that the sequence nodes respectively created by the new version game server and the old version game server are compared with the value of the sequence node noddx with the minimum current value in the Lock directory.
And thirdly, determining that the game server with the value which is the same as the current value of the minimum sequence node Noeldx in the Lock directory competes to obtain the distributed Lock, and storing the valid game data in the game database DB again after the valid game data is pulled to the game database DB and the valid game data is merged with the locally generated new data.
For example, if the value of the sequence node ldx with the minimum current value in the current Lock directory is 1, the new version game server may determine that the value of the node ldx is the same as the value of the sequence node noddx with the minimum current value in the current Lock directory, and at this time, the new version game server may compete to obtain the distributed Lock, and the new version game server, as described above, extracts data (valid game data) from the game database DB, merges the data with new data generated locally, and stores the data in the game database DB again. Then, deleting the sequential node again unlocks the sequential node (Nodeldx with value 1).
And fourthly, determining a game server with a value different from the node ldx value of the sequence node with the minimum current value in the Lock directory, caching the generated new data into a local cache, setting the iCount value of the game server to be added with 1, monitoring whether a node with the value of subtracting the iCount value from the node ldx value of the game server in the Lock directory exists, returning to the second step for re-competition of the distributed Lock if the node does not exist, and notifying the change of the node with the value of subtracting the iCount value from the node ldx value of the game server if the node exists.
As described above, since the value 2 of the nodldx of the old version game server is different from the value 1 of the sequence node nodldx with the minimum current value in the Lock directory, the old version game server does not compete for the distributed Lock, at this time, the old version game server may cache the new data generated by the old version game server in the local cache, then set its iCount value plus 1, so that the corresponding iCount value becomes 1, and monitor whether the value 2 of the nodldx of the old version game server minus the iCount value 1 in the Lock directory exists, that is, whether the sequence node with the value 1 exists or not, if not (indicating that the sequence node with the value 1 is unlocked), return to the second step above, re-compete for the distributed Lock, and if so (indicating that the sequence node with the value 1 is not unlocked), wait for the notification of the change of the sequence node with the value 1 in the Lock directory.
Based on the same inventive concept, the embodiment of the invention provides a game version updating device, which comprises:
the system comprises a determining unit, a judging unit and a processing unit, wherein the determining unit is used for determining an old version game client which establishes connection with an old version game server and determining the current game state of the old version game client;
the device comprises a sending unit, a role-free state updating unit and a role-free state updating unit, wherein the sending unit is used for sending a reconnection instruction to an old version game client when the game state is the role-non-idle state and the game state is updated from the role-non-idle state to the role-free state;
the reconnection instruction is used for disconnecting the old version game client from the old version game server and establishing connection with the new version game server.
Optionally, if the game state is a role idle state, the sending unit is further configured to:
and sending a reconnecting instruction to the old version game client.
Optionally, the apparatus further comprises a changing unit, configured to:
the routing address of the old version game client is changed into the address of the new version game server from the address of the old version game server.
Optionally, the apparatus further includes an obtaining unit, configured to:
obtaining stored effective game data corresponding to the old version game client from a game database;
and merging the effective game data with the game data newly generated by the old version game client, and storing the merged effective game data and the newly generated game data in the game database.
Based on the same inventive concept, the embodiment of the invention provides a game version updating device, which comprises:
the obtaining unit is used for obtaining a request for establishing connection with a new version game server sent by a game client and carrying game version information of the game client;
and the sending unit is used for sending the game data corresponding to the old version game to the game client if the game client is determined to be the old version game client according to the game version information.
Optionally, the sending unit is further configured to:
acquiring new version game data;
deleting the newly added data of the new version game data;
sending new version game data after the new data is deleted to the game client;
the new data is the data added by the new version game data compared with the old version game data.
Optionally, the apparatus further includes a determining unit, configured to:
determining a combat service corresponding to the game version information;
and sending the address information of the combat service to the game client, so that the game client establishes connection with the combat service to enter a role non-idle state.
Based on the same inventive concept, a computing apparatus is provided in the present embodiment, as shown in fig. 8, and includes at least one processor 80 and at least one memory 81, where the memory 81 stores a computer program, and when the program is executed by the processor 80, the processor 80 is caused to perform the steps of the game version service updating method as provided in the present embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for updating a game version, comprising:
determining an old version game client that establishes a connection with an old version game server, an
Determining the current game state of the old-version game client, wherein the game state is the game progress of a game player logging in the old-version game server through the old-version game client to perform game operation;
if the game state is the role non-idle state, sending a reconnection instruction to the old version game client when the game state is monitored to be updated from the role non-idle state to the role idle state;
the reconnect instruction is used for disconnecting the old version game client from the old version game server and establishing connection with the new version game server, the role non-idle state comprises the game progress of high-time game data communication between the old version game client and the old version game server when the game player is in game battle, and the role idle state comprises the game progress outside the role non-idle state.
2. The method of claim 1, wherein the reconnect instruction is sent to the old version game client if the game state is a character idle state.
3. The method of claim 1 or 2, wherein after determining an old version game client that establishes a connection with an old version game server, the method further comprises:
and changing the routing address of the old version game client from the address of the old version game server to the address of the new version game server.
4. The method of claim 3, wherein prior to the old version game client establishing a connection with the new version game server, the method further comprises:
obtaining the stored effective game data corresponding to the old version game client from a game database;
and merging the effective game data with the game data newly generated by the old version game client, and storing the effective game data and the game data to the game database again.
5. A method for updating a game version, comprising:
acquiring a request for establishing connection with a new version game server, which is sent by a game client, wherein the request carries game version information of the game client;
and if the game client is determined to be the old-version game client according to the game version information, sending game data corresponding to the old-version game to the game client, wherein the game data corresponding to the old-version game are generated when the old-version game client plays the game.
6. The method of claim 5, wherein sending game data corresponding to the old version of the game to the game client comprises:
acquiring new version game data;
deleting the newly added data of the new version game data;
sending the new version game data after the new data is deleted to the game client;
the new version game data is added to the new version game data compared with the old version game data.
7. The method of claim 6, wherein after sending the new version of game data to the game client after deleting the new addition of data, the method further comprises:
determining a combat service corresponding to the game version information;
and sending the address information of the combat service to the game client, so that the game client establishes connection with the combat service to enter a role non-idle state.
8. An apparatus for updating a game version, comprising:
the system comprises a determining unit, a judging unit and a processing unit, wherein the determining unit is used for determining an old version game client end which establishes connection with an old version game server and determining the current game state of the old version game client end, and the game state is the game progress of a game player when the game player logs in the old version game server through the old version game client end to perform game operation;
a sending unit, configured to send a reconnect instruction to the old version game client when it is monitored that the game state is updated from a role non-idle state to a role idle state when the game state is the role non-idle state;
the reconnect instruction is used for disconnecting the old version game client from the old version game server and establishing connection with the new version game server, the role non-idle state comprises the game progress of high-time game data communication between the old version game client and the old version game server when the game player is in game battle, and the role idle state comprises the game progress outside the role non-idle state.
9. An apparatus for updating a game version, comprising:
the device comprises an obtaining unit, a processing unit and a processing unit, wherein the obtaining unit is used for obtaining a request for establishing connection with a new version game server, which is sent by a game client, and the request carries game version information of the game client;
and a sending unit, configured to send, to the game client, game data corresponding to an old version game if the game client is determined to be an old version game client according to the game version information, where the game data corresponding to the old version game is data generated when the old version game client plays a game.
10. A computing device comprising at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 7.
CN201910094186.4A 2019-01-30 2019-01-30 Game version updating method and device Active CN109857439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910094186.4A CN109857439B (en) 2019-01-30 2019-01-30 Game version updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910094186.4A CN109857439B (en) 2019-01-30 2019-01-30 Game version updating method and device

Publications (2)

Publication Number Publication Date
CN109857439A CN109857439A (en) 2019-06-07
CN109857439B true CN109857439B (en) 2020-11-20

Family

ID=66896951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910094186.4A Active CN109857439B (en) 2019-01-30 2019-01-30 Game version updating method and device

Country Status (1)

Country Link
CN (1) CN109857439B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221878A (en) * 2019-06-17 2019-09-10 北京金山安全软件有限公司 Game service updating method and device, electronic equipment and storage medium
CN110585725A (en) * 2019-09-08 2019-12-20 北京智明星通科技股份有限公司 Mobile game user feedback information request method, device and server
CN113426137B (en) * 2021-07-02 2024-09-20 网易(杭州)网络有限公司 Account cleaning method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100232A (en) * 2015-07-14 2015-11-25 焦点科技股份有限公司 Smooth upgrade method for server end program without interrupting service
CN106528225A (en) * 2016-11-03 2017-03-22 北京像素软件科技股份有限公司 Hot update method and apparatus for game server
CN106815083A (en) * 2016-12-20 2017-06-09 微梦创科网络科技(中国)有限公司 A kind of client asynchronous processing method and client based on Memcache agreements
CN107153560A (en) * 2017-05-25 2017-09-12 微梦创科网络科技(中国)有限公司 Version upgrading method, server and system
CN107637052A (en) * 2017-08-02 2018-01-26 福建联迪商用设备有限公司 A kind of business data processing method, client, service end and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8622816B2 (en) * 2008-06-12 2014-01-07 Wms Gaming, Inc Living wagering games
CN101739263A (en) * 2008-11-11 2010-06-16 英业达股份有限公司 Method and device for realizing operating system update in multi-computer cluster system
CN103888523A (en) * 2014-03-11 2014-06-25 北京京东尚科信息技术有限公司 Method, device and system for confirming download link of software version upgrade file
CN105045636A (en) * 2015-08-11 2015-11-11 广东欧珀移动通信有限公司 Method and apparatus for updating software
CN105897744B (en) * 2016-05-26 2018-08-21 广州多益网络股份有限公司 A kind of game server update method and its system
CN107158705B (en) * 2017-05-18 2018-09-18 腾讯科技(深圳)有限公司 The update method and device of service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100232A (en) * 2015-07-14 2015-11-25 焦点科技股份有限公司 Smooth upgrade method for server end program without interrupting service
CN106528225A (en) * 2016-11-03 2017-03-22 北京像素软件科技股份有限公司 Hot update method and apparatus for game server
CN106815083A (en) * 2016-12-20 2017-06-09 微梦创科网络科技(中国)有限公司 A kind of client asynchronous processing method and client based on Memcache agreements
CN107153560A (en) * 2017-05-25 2017-09-12 微梦创科网络科技(中国)有限公司 Version upgrading method, server and system
CN107637052A (en) * 2017-08-02 2018-01-26 福建联迪商用设备有限公司 A kind of business data processing method, client, service end and system

Also Published As

Publication number Publication date
CN109857439A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN109857439B (en) Game version updating method and device
US8764567B2 (en) System and method for implementing turn-based online games
US20120311036A1 (en) Friend recommendation system and method
CN102104600B (en) Distributed pluggable game server platform and cooperative working method thereof
US9792311B2 (en) System and method for managing a partitioned database of user relationship data
CN110034972B (en) Server pressure testing method and device
RU2015106840A (en) METHOD (OPTIONS) AND SYSTEM (OPTIONS) OF PREVENTING AN UNAUTHORIZED ACCESS CONTAINING A LOT OF SERVER NODES
CN111617487B (en) Account access method and device in game application, storage medium and electronic equipment
CN102594876B (en) The mixing accelerating system of game real time data and more new data
CN106534345B (en) A kind of message forwarding method and device
CN112121413B (en) Response method, system, device, terminal and medium for function service
CN110808857B (en) Network intercommunication method, device, equipment and storage medium for realizing Kubernetes cluster
US20140228129A1 (en) Server data update method and system
CN113824723A (en) End-to-end system solution applied to audio and video data transmission
CN108023736A (en) Communication means, server device, client device, apparatus and system
CN103002019A (en) Browser and method for sending webpage game message for browser
CN112187532A (en) Node control method and system
CN115794139A (en) Mirror image data processing method, device, equipment and medium
CN114363402A (en) Target range interconnection method, system and electronic equipment
CN112199176A (en) Service processing method, device and related equipment
CN111416849B (en) Disconnection reconnection method, device and system and computer equipment
CN101072233B (en) Method and system for stimulating stateful connection based on stateless network protocol
CN114070853A (en) Immersive activity system, application method thereof and electronic device
CN106161051B (en) Custom end intelligent route selection
KR101874590B1 (en) Method for providing communication middleware service using universal game network library

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Lin Guohua

Inventor after: Chen Weizhe

Inventor after: Cheng Yongyuan

Inventor before: Lin Guohua

Inventor before: Chen Weizhe

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant