Game voice private chat method and device, storage medium and electronic equipment
By injecting configuration information into the voice room component in a multiplayer strategy game to create a private chat voice room and processing request commands in the message queue, the high cost of voice private chat and data consistency in the existing technology is solved, and the low cost is achieved , efficient voice private chat function.
Patent Information
- Application Number
- CN202410962224.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-19
AI Technical Summary
Existing multiplayer strategy games require a complex private chat system when implementing voice private chat functions, which increases the application cost of the game and has data consistency problems, making it difficult to ensure the correctness of message timing.
By injecting voice room configuration information into the voice room component when the game enters the discussion stage, create a private chat voice room, and save the request command in the message queue, read and process it one by one, to realize the voice private chat function and avoid using complex Private chat system.
It reduces the application cost of the game, ensures the correct timing of processing request commands, solves the problem of data consistency, and realizes the privacy and efficiency of voice private chat.
Smart Images

Figure CN118976258A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for private game voice chat, a storage medium and an electronic device. Background Art
[0002] Multiplayer strategy games are an important type of multiplayer games, emphasizing strategic thinking and intellectual confrontation between players. These games are usually highly strategic and challenging, attracting a large number of players who like to think and like challenges.
[0003] In multiplayer strategy games, communication between players is extremely important, and privacy in the communication process is crucial to the collaboration and strategic deployment between players. In order to ensure the privacy of communication, voice support for private chat is usually provided to players. In the process of implementing voice private chat, current multiplayer strategy games need to use a complex private chat system to implement the voice private chat function, which increases the application cost of the game. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a game voice private chat method and device, a storage medium and an electronic device. By applying the solution provided by the present invention, a private chat voice room is created through the connected voice room component, thereby realizing the game's voice private chat function without using a complex private chat system, thereby reducing the application cost of the game.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A game voice private chat method, comprising:
[0007] When the game enters the discussion phase, the voice room configuration information of the discussion phase is injected into the connected voice room component, so that the voice room component creates each private chat voice room;
[0008] Broadcasting the game public information of the game in the discussion phase and the room information of each private chat voice room to each player in the public voice hall of the game;
[0009] Reading each request command in the message queue of the game one by one, wherein the request command is an operation command generated when a player in the public voice room performs a game operation based on the room information and the game information;
[0010] Using the read request command as a target request command, and determining an operation type of the target request command;
[0011] When the operation type of the target request command is to obtain a private chat voice room, determining a target voice room of the target request command based on each of the private chat voice rooms;
[0012] Add the players corresponding to the target request command to the target voice room, so that the players in the target voice room can have a private voice chat in the voice room.
[0013] In the above method, optionally, determining the target voice room of the target request command based on each of the private chat voice rooms includes:
[0014] Obtaining room request information in the target request command;
[0015] Determining whether the room request information satisfies a preset random allocation condition;
[0016] When the random allocation condition is met, determining a target voice room for the target request command based on a random allocation strategy of the random allocation condition;
[0017] When the random assignment condition is not met, a target voice room is determined in each of the private chat voice rooms according to the room request information.
[0018] In the above method, optionally, the determining whether the room request information satisfies a preset random allocation condition includes:
[0019] Determining whether the room request information includes room designation information;
[0020] If the room request information does not include room designation information, the random allocation condition is met;
[0021] If the room request information includes room designation information, determining an entry condition for the private chat voice room corresponding to the room designation information;
[0022] Determining whether the player corresponding to the target request command meets the room entry condition;
[0023] When the player requesting the command with the target meets the room entry condition, the random assignment condition is not met;
[0024] When the player requesting the target command does not meet the room entry condition, the random assignment condition is met.
[0025] In the above method, optionally, the random allocation strategy based on the random allocation condition to determine the target voice room of the target request command includes:
[0026] Determine if there is a private voice chat room marked as randomly assigned;
[0027] If there is a private chat voice room marked as randomly assigned, any private chat voice room marked as randomly assigned is determined as the target voice room;
[0028] If there is no private chat voice room marked as randomly assigned, a private chat voice room is created for the target request command, and the created private chat voice room is used as the target voice room.
[0029] The above method may optionally further include:
[0030] When the operation type of the target request command is an invitation type, based on the invitation information in the target request command, determining the player corresponding to the invitation information as the first player;
[0031] For any first player, determine whether the first player meets the preset message receiving conditions; when the first player meets the message receiving conditions, send a voice invitation message to the first player, so that the first player can feedback an operation command including whether to receive the invitation based on the voice invitation message, and add the operation command to the message queue; when the first player does not meet the message receiving conditions, feedback an invitation failure message to the player who sent the target request command.
[0032] The above method may optionally further include:
[0033] When the discussion phase ends, determining whether all private chat voice rooms are empty;
[0034] When all private chat voice rooms are empty, all private chat voice rooms will be deleted;
[0035] When there are non-empty private chat voice rooms, after adding the players in the non-empty private chat voice rooms to the public voice lobby, all private chat voice rooms are deleted.
[0036] The above method may optionally further include:
[0037] When a status change event occurs in any private chat voice room, determine whether the status change event meets the preset disclosure conditions;
[0038] If the state change event meets the preset disclosure condition, the state change event is broadcast.
[0039] A game voice private chat device, comprising:
[0040] A creation unit, used for injecting the voice room configuration information of the discussion stage into the connected voice room component when the game enters the discussion stage, so that the voice room component creates each private chat voice room;
[0041] A broadcasting unit, configured to broadcast the game public information of the game in the discussion phase and the room information of each of the private chat voice rooms to each player in the public voice hall of the game;
[0042] A reading unit, used to read each request command in the message queue of the game one by one, wherein the request command is an operation command generated when a player in the public voice room performs a game operation based on the room information and the game information;
[0043] A first determining unit, configured to use the read request command as a target request command and determine an operation type of the target request command;
[0044] A second determining unit is configured to determine a target voice room of the target request command based on each of the private chat voice rooms when the operation type of the target request command is to obtain a private chat voice room;
[0045] The private chat unit is used to add the player corresponding to the target request command to the target voice room, so that the players in the target voice room can have a private voice chat in the voice room.
[0046] In the above device, optionally, the second determining unit includes:
[0047] An acquisition module, used for acquiring room request information in the target request command;
[0048] A first determination module, used to determine whether the room request information meets a preset random allocation condition;
[0049] The second determination module is used to determine the target voice room of the target request command based on the random allocation strategy of the random allocation condition when the random allocation condition is met; when the random allocation condition is not met, determine the target voice room in each of the private chat voice rooms according to the room request information.
[0050] In the above device, optionally, the first determining module includes:
[0051] A first determining subunit, configured to determine whether the room request information includes room designation information;
[0052] a second determining subunit, configured to satisfy the random allocation condition if the room request information does not include room designation information;
[0053] A third determining subunit is configured to determine an entry condition of a private chat voice room corresponding to the room specifying information if the room request information includes room specifying information;
[0054] A judging subunit, used for judging whether the player corresponding to the target request command meets the room entry condition;
[0055] The fourth determining subunit is used for not satisfying the random allocation condition when the player with the target request command satisfies the room entry condition; and satisfying the random allocation condition when the player with the target request command does not satisfy the room entry condition.
[0056] In the above device, optionally, the second determining module includes:
[0057] A fifth determining subunit is used to determine whether there is a private chat voice room marked as randomly assigned;
[0058] The sixth determination subunit is used to determine any private chat voice room marked as randomly assigned as a target voice room if there is a private chat voice room marked as randomly assigned; if there is no private chat voice room marked as randomly assigned, create a private chat voice room for the target request command, and use the created private chat voice room as the target voice room.
[0059] The above device may optionally further include:
[0060] A third determination unit is used for, when the operation type of the target request command is an invitation type, determining the player corresponding to the invitation information as the first player based on the invitation information in the target request command; for any first player, determining whether the first player meets a preset message receiving condition; when the first player meets the message receiving condition, sending a voice invitation message to the first player, so that the first player feeds back an operation command including whether to receive the invitation based on the voice invitation message, and adds the operation command to the message queue; when the first player does not meet the message receiving condition, feeding back an invitation failure message to the player who sent the target request command.
[0061] The above device may optionally further include:
[0062] A fourth determining unit, configured to determine whether all private chat voice rooms are empty when the discussion phase ends;
[0063] The deleting unit is used to delete all private chat voice rooms when all private chat voice rooms are empty; when there are private chat voice rooms that are not empty, add the players in the private chat voice rooms that are not empty to the public voice hall and then delete all private chat voice rooms.
[0064] The above device may optionally further include:
[0065] The fifth determining unit is used to determine whether a state change event meets a preset public condition when a state change event occurs in any private chat voice room; if the state change event meets the preset public condition, the state change event is broadcast.
[0066] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute a game voice private chat method as described above.
[0067] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform a game voice private chat method as described above.
[0068] Compared with the prior art, the present invention has the following advantages:
[0069] The present invention provides a method and device for game voice private chat, a storage medium and an electronic device, including: injecting the voice room configuration information of the discussion stage into the connected voice room component, so that the voice room component creates each private chat voice room; reading each request command in the message queue of the game one by one, the request command is an operation command generated when the player in the public voice room performs a game operation based on the broadcast room information and game information; using the read request command as the target request command; when the operation type of the target request command is to obtain a private chat voice room, adding the player corresponding to the target request command to the determined target voice room, so that the player in the target voice room can have a voice private chat in the voice room. The present application uses the connected voice room component to create a private chat voice room, thereby realizing the voice private chat function, thereby eliminating the need to use a complex private chat system to realize the voice private chat function, thereby reducing the application cost of the game. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0071] Figure 1 A flowchart of a method for private game voice chat provided by an embodiment of the present invention;
[0072] Figure 2 A flowchart of determining a target voice room for a target request command based on each private chat voice room provided in an embodiment of the present invention;
[0073] Figure 3 The structural intention of a game voice private chat device provided in an embodiment of the present application;
[0074] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0077] As can be seen from the background technology, in order to achieve privacy in multiplayer strategy game communication, a complex private chat system is currently used to implement the voice private chat function in the game, thereby increasing the implementation cost of the game.
[0078] In addition to the above problems, when players play multiplayer strategy games, they are involved in a variety of operation requests, such as exchanging props, purchasing props, inviting players to private chat, rejecting private chat requests, etc. For such operations, the current system has data consistency issues when processing these operation requests, and it is difficult to ensure the correctness of the message timing returned to the player's client.
[0079] In order to solve the above problems, the present invention provides a game voice private chat solution. When the game enters the discussion stage, the player has a need for voice private chat. The system intervenes in the voice room component and injects the voice room configuration information into the voice room component, so that the voice room component creates various private chat voice rooms. Players can chat privately in the private chat voice rooms. Therefore, voice private chat can be achieved without using a complex private chat system. In addition, this solution saves the request commands in the message queue, and then reads each request command in the message queue one by one in the order of time sequence, thereby solving the problem of data consistency and ensuring the correctness of the timing of processing the request commands.
[0080] The present application can be used in a game processing system, and the server (or service end) of the system can be used to implement the solution provided by the present application. The server of the system includes many general or special computing device environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.
[0081] Reference Figure 1 , which is a flow chart of a method for private game voice chat provided by an embodiment of the invention, and is specifically described as follows:
[0082] S101. When the game enters the discussion phase, the voice room configuration information of the discussion phase is injected into the connected voice room component, so that the voice room component creates various private chat voice rooms.
[0083] The game here can be a multiplayer strategy game, or any type of communication that requires private voice chat.
[0084] When the game enters the discussion phase, the players in the game have a need for private voice chat. At this time, the private voice chat function of the game can be realized by accessing the voice room component. The voice room component is a universal component and can be applied to servers of various games with private voice chat needs. Preferably, the discussion phase can be a free discussion phase in the game.
[0085] Preferably, the voice room component can be pre-connected to the server, or the server can connect to the voice room component when the game is started, or the server can connect to the voice room component when the game enters the discussion stage.
[0086] Preferably, there may be multiple discussion stages in the entire game process, and the configuration of the private chat voice room may be different in the discussion stages of different game processes. Therefore, each discussion stage has corresponding voice room configuration information; discussion stages with the same private chat voice room configuration can share the same voice room configuration information.
[0087] The voice room configuration information includes but is not limited to the number of private chat voice rooms that need to be created and the room information of each private chat voice room; the room information includes but is not limited to the room number, the conditions for joining the room, etc. Furthermore, the voice room configuration information also includes the Redis and Pulsar configurations used by the voice room component to implement private voice chat, and the information on calling various APIs according to business scenarios.
[0088] Preferably, a hook method is set in the voice room component, which can be used for initialization, and then the initialized voice room component is voice configured based on the injected voice room configuration information, and then the configured voice room component generates various private chat voice rooms.
[0089] By using the Voice Room component to create a private chat voice room, you can isolate the private chat voice from the main logic of the game, and you can use the hook method provided in the Voice Room component to initialize the component.
[0090] S102: Broadcast the game public information during the discussion phase and the room information of each private chat voice room to each player in the public voice hall of the game.
[0091] Game public information refers to information that can be made public at the current stage of the game, such as props that can be used in the current stage, props that can be purchased in the next stage, identity information of each player, faction information, etc. By publishing game public information, the progress of the game can be advanced and it is also helpful for players to formulate game strategies.
[0092] Broadcasting the room information of each private chat voice room to players is helpful for players to choose appropriate private chat voice rooms, formulate game strategies, etc.
[0093] When a player speaks in a public voice lobby, all players in the public voice lobby can hear it.
[0094] S103, reading each request command in the game message queue one by one, where the request command is an operation command generated when a player in the public voice room performs a game operation based on the room information and the game information.
[0095] The message queue is a first-in-first-out queue, and each request command in the message queue is sorted in chronological order.
[0096] S104: Use the read request command as a target request command and determine an operation type of the target request command.
[0097] The target request command is parsed to obtain an operation type identifier in the target request command, and the operation type of the target request command is determined based on the operation type identifier.
[0098] Preferably, the operation types include but are not limited to obtaining a private chat voice room (which can be understood as requesting a private chat voice room), inviting a private voice chat, rejecting a private voice chat, accepting a private voice chat, changing status, and the like.
[0099] Preferably, a command of the state change type indicates that a state change event has occurred. For an explanation of the state change event, refer to the following text and will not be repeated here.
[0100] S105. When the operation type of the target request command is to obtain a private chat voice room, determine a target voice room of the target request command based on each private chat voice room.
[0101] S106. Add the player corresponding to the target request command to the target voice room, so that the players in the target voice room can have a private voice chat in the voice room.
[0102] Preferably, the player corresponding to the target request command can be one player or multiple players; further, when there are multiple players corresponding to the target request command, one of the players is the player who sends the target request command, and the remaining players are the players who accept the private chat request of the player who sends the target request.
[0103] The voice content generated by the players in the target voice room is not shared with the players in other voice rooms or the players in the public voice lobby. In other words, the voice content in each voice room is independent and private, and will not be shared with other voice rooms.
[0104] The voice of any player in the target voice room will be broadcast to all remaining players in the target voice room. In other words, all players in the target voice room are in the same voice channel or channel, and players in the target voice room can share the voice information in the voice room.
[0105] Preferably, after entering the target voice room, the player can lock the target voice room to prevent other players from mistakenly entering the voice room, thereby ensuring the privacy of voice communication in the voice room.
[0106] In the embodiment provided by the present application, when the game enters the discussion stage, the voice room configuration information of the discussion stage is injected into the connected voice room component, so that the voice room component creates each private chat voice room; the game public information of the game in the discussion stage and the room information of each private chat voice room are broadcast to each player in the public voice hall of the game; each request command in the message queue of the game is read one by one, and the request command is an operation command generated when the player in the public voice room performs game operations based on the room information and game information; the read request command is used as the target request command to determine the operation type of the target request command; when the operation type of the target request command is to obtain a private chat voice room, the target voice room of the target request command is determined based on each private chat voice room; the player corresponding to the target request command is added to the target voice room, so that the player in the target voice room can have a private voice chat in the voice room. The present application uses the connected voice room component to create a private chat voice room, thereby realizing the voice private chat function, so that there is no need to use a complex private chat system to realize the voice private chat function, thereby reducing the application cost of the game.
[0107] Reference Figure 2 , which is a flow chart of determining a target voice room for a target request command based on each private chat voice room provided by an embodiment of the present invention, and is specifically described as follows:
[0108] S201. Obtain room request information in a target request command.
[0109] The target request command is only parsed to obtain the room request information in the target request command. The room request information contains relevant information about the player's request for the room, such as whether the player requests a specific room, information about the player requesting to join the room, and so on.
[0110] S202, determining whether the room request information satisfies a preset random allocation condition; when the random allocation condition is satisfied, executing S203; when the random allocation condition is not satisfied, executing S204.
[0111] The steps of determining whether the room request information meets the preset random allocation conditions in this application refer to S301-S304, and the relevant instructions are as follows:
[0112] S301, determine whether the room request information contains room specifying information; if the room request information does not contain room specifying information, execute S305; if the room request information contains room specifying information, execute S302.
[0113] When the room request information does not contain room designation information, it means that the player has not independently selected the private chat voice room. In this case, it means that the target request command meets the random allocation conditions, and S305 is executed; when the room request information contains room designation information, it means that the player has independently selected the private chat voice room. In this case, it is necessary to further determine whether the target request command meets the random allocation conditions, and S302 is executed.
[0114] S302: Determine the entry conditions of the private chat voice room corresponding to the room designation information.
[0115] Preferably, each private chat voice room has room entry conditions, and the room entry conditions of different private chat voice rooms may be the same or different.
[0116] The entry conditions are used to restrict players from entering the private chat voice room, which increases the various scenarios of the game and can be applied to various private chat voice rules. This can support games with more complex rules, allowing the game to launch a variety of game scenarios and gameplay, providing players with richer and more interesting games and improving the player's gaming experience.
[0117] Exemplarily, the room entry conditions may include one or more of the following:
[0118] Case 1: The private chat room is empty;
[0119] Case 2: The game level of the player requesting the voice room reaches the preset level;
[0120] Case 3: The player corresponding to the target request command belongs to the same camp;
[0121] Case 4: The number of players corresponding to the target request command is less than or equal to the preset number of players.
[0122] It should be noted that the above situation is only an example, and the room entry conditions of this application are not limited to the above situation.
[0123] S303, determine whether the player corresponding to the target request command meets the room entry conditions; when the player corresponding to the target request command meets the room entry conditions, execute S304; when the player corresponding to the target request command does not meet the room entry conditions, execute S305.
[0124] It should be noted that when determining whether the player corresponding to the target request command meets the room entry conditions, the player information of each player corresponding to the target request can be obtained to determine whether each player corresponding to the target request command meets the room entry conditions.
[0125] When the room entry condition is met, it is determined that the target request command does not meet the random allocation condition, that is, S304 is executed; when the room entry condition is not met, it is determined that the target request command meets the random allocation condition, that is, S305 is executed.
[0126] S304: The random allocation condition is not met. At this point, S204 may continue to be executed.
[0127] S305: The random allocation condition is met. At this point, S203 may continue to be executed.
[0128] This application determines whether to use the random allocation strategy to allocate a private chat voice room by judging whether the random allocation conditions are met. When a player requests a private chat voice room, this application provides players with multiple ways to obtain a private chat voice room, thereby improving the player's gaming experience, and supports multiple ways to determine a private chat voice room, increasing the playability of the game.
[0129] S203: Determine a target voice room for the target request command based on a random allocation strategy of the random allocation condition.
[0130] The process of determining the target voice room of the target request command based on the random allocation strategy of the random allocation condition refers to the contents of S401-S403, and the specific description is as follows:
[0131] S401. Determine whether there is a private chat voice room marked as randomly assigned; if there is a private chat voice room marked as randomly assigned, execute S402; if there is no private chat voice room marked as randomly assigned, execute S403.
[0132] Based on the room information of each private chat voice room, determine whether there is a private chat voice room marked as randomly assigned.
[0133] It should be noted that a private chat voice room marked as randomly assigned is empty, that is, there is no player in the private chat voice room; in other words, when there is a player in the private chat voice room, the mark of the private chat voice room is not randomly assigned.
[0134] S402: Determine any private chat voice room marked as randomly assigned as a target voice room.
[0135] One of the private chat voice rooms marked as randomly assigned may be randomly determined as the target voice room.
[0136] S403: Create a private chat voice room for the target request command, and use the created private chat voice room as the target voice room.
[0137] When there is no private chat voice room marked as randomly assigned, a private chat voice room can be created for the target request command, and the created private chat voice room can be used as the target voice room of the target request command.
[0138] When there is no private chat voice room marked as randomly assigned, a private chat voice room is created for the target request command. This ensures that when a player requests a private chat voice room and the initially created private chat voice rooms have been used, the player can successfully request a private chat voice room, thereby improving the player's gaming experience.
[0139] S204: Determine a target voice room in each private chat voice room according to the room request information.
[0140] When the random allocation conditions are not met, the target voice room can be determined using the room designation information in the room request information; exemplarily, if the room instruction information includes the room number selected by the player, the private chat voice room corresponding to the private chat room number is determined as the target voice room.
[0141] In the embodiments provided by the present application, when determining the target voice room of a target request command, when the random allocation condition is met, a random allocation strategy of the random allocation condition is used to determine the target voice room for the target request command, wherein, when using the random allocation strategy to determine the target voice room, multiple methods of random allocation and re-creation of voice rooms are supported, and when the random allocation condition is not met, the room request information is used to determine the target voice room in each private chat voice room; thus, different methods can be used to determine the target voice room in different situations, providing multiple scenarios for determining the target voice room, meeting complex game rules, and providing players with a good gaming experience.
[0142] In the embodiment provided by the present application, at the end of the discussion phase of the game, each private chat voice room can be deleted to reduce the resources occupied by the server. The process of deleting each private chat voice room is as follows: determining whether all private chat voice rooms are empty; when all private chat voice rooms are empty, deleting all private chat voice rooms; when there are private chat voice rooms that are not empty, adding the players in the non-empty private chat voice rooms to the public voice hall, and then deleting all private chat voice rooms.
[0143] Among them, if the private chat voice room is empty, it means there are no players in the private chat voice room. When the private chat voice room is not empty, the players are forced to exit the private chat voice room, the players in the private chat voice room are added to the public voice lobby, and then all private chat voice rooms are deleted.
[0144] It should be noted that when players are in a private voice chat room, status change events may occur. Status change events include but are not limited to events such as players obtaining prop cards, player identities changing, player attributes changing, and players using prop cards. Player attributes include but are not limited to: health points, player superiors and subordinates, etc.
[0145] When a status change event occurs in any private chat voice room, it is determined whether the status change event meets the preset public conditions; if the status change event meets the preset public conditions, the status change event is broadcast.
[0146] It should be noted that the occurrence of a state change event may be related to the player's game strategy, so it is necessary to determine whether the state change event meets the disclosure conditions. If so, the state change event will be broadcast, for example, to all players, such as players in the public voice hall and players in the private voice room; if not, the state change event will not be disclosed.
[0147] Preferably, when broadcasting information or data in the present application, the server can operate the message channel in the main process of the game through a callback function to broadcast information or data to players in the voice room.
[0148] Exemplarily, when a state change event includes a non-disclosure flag, the state change event will not be disclosed. The non-disclosure flag may be a flag that the player voluntarily chooses not to disclose the event, or may be a flag that the state change event includes information that is not disclosed in the game rules.
[0149] Whether the state change event is made public is closely related to the player's game strategy. By determining whether to make the state change event public, the progress of the game can be advanced, and the player's game strategy can be realized to the greatest extent, thereby improving the player's experience in the game.
[0150] It should be noted that there are multiple operation types of the target request command. When the operation type of the target request command is an invitation type, based on the invitation information in the target request command, the player corresponding to the invitation information is determined as the first player; for any first player, determine whether the first player meets the preset message receiving conditions; when the first player meets the message receiving conditions, send a voice invitation message to the first player, so that the first player can feedback an operation command including whether to receive the invitation based on the voice invitation information, and add the operation command to the message queue; when the first player does not meet the message receiving conditions, feedback an invitation failure message to the player who sent the target request command.
[0151] It should be noted that the invitation type can be an invitation for a private voice chat. Preferably, a player can invite one player or invite multiple players for a private voice chat at the same time. For example, player A can invite players B and C for a private voice chat at the same time, or player A can invite player B for a private voice chat alone. The invitation information includes information of at least one invited player.
[0152] Exemplarily, it is determined that the first player meets the preset message receiving condition, such as: the first player is located in a public voice hall, or the private voice chat room of the first player can receive the invitation information.
[0153] Exemplarily, it is determined that the first player does not meet the message receiving condition, for example, the first player is in a different position from the public voice lobby, or the private voice chat room where the first player is located cannot accept the invitation message.
[0154] In the scheme provided by the present application, the game processing system includes a client and a server, and the client can be understood as an intelligent device used by players when playing games. At the beginning of the game, the server calls the initialization method to initialize the game, and then accesses the voice room component, at which point the voice room component can be configured; after the game enters the game discussion stage, all players are pulled into the public voice room of the game (equivalent to the public voice hall above), and several private chat voice rooms are dynamically created according to the business scenario requirements (equivalent to the voice room configuration information above), and the voice room initialization information (equivalent to the room information above) and the game public information are issued through mqtt, and the client uses the player grouping data allocated by the server to establish the voice subscription relationship of each player in the group. After receiving the request commands such as creation, invitation, acceptance / rejection of invitation sent by the client to the server, the server writes the request command into the Pulsar message queue, and uses the sharding characteristics of pulsar to consume all the operation commands of the voice room in the same game in an orderly manner. The present invention can ensure that when multiple players operate the same event at the same time, the atomicity and timing correctness of the operation are ensured, and the free communication process of the game is promoted.
[0155] This application further illustrates this solution with a scenario example. The game processing system includes a client and a server. The game processing system performs a real-time voice private chat control process such as:
[0156] The server initializes the game, and during initialization, initializes the connected voice room component using the hook method of the component, configures the voice room component, and injects the voice room configuration information of the game's discussion phase into the voice room component, so that the voice room component dynamically creates several private chat voice rooms, and pulls each player of the game into the public voice hall. Each player performs operations such as inviting voice private chats, rejecting voice private chats, agreeing to voice private chats, requesting voice rooms, and changing status in the public voice hall to generate corresponding operation commands. The server saves all received operation commands in the Pulsar message queue in chronological order from first to last, and the server consumes the operation commands saved in the Pulsar message queue in an orderly manner. The Pulsar message queue is a first-in-first-out queue.
[0157] Exemplarily, for the currently consumed operation command, it is assumed that the operation command is a command sent by player 1.
[0158] When the operation command is a command to obtain a private chat voice room, determine whether player 1 specifies a private chat voice room. When player 1 does not specify a private chat voice room, determine whether there is an idle private chat voice room. If there is an idle private chat voice room, assign any idle private chat voice room to player 1. If there is no idle private chat voice room, create a private chat voice room for player 1. When player 1 specifies a private chat voice room and there are no other players in the specified private chat voice room, assign the private chat voice room specified by player 1 to player 1. When there are other players in the executed private chat voice room, create a private chat voice room for player 1. Player 1 enters the private chat voice room assigned to him.
[0159] When the operation command is an invitation command for a private voice chat, assuming that the invited player is player 2, when player 2 meets the inquiry condition (equivalent to the message receiving message above), the inquiry event is triggered to ask player 2 whether to agree to the private voice chat invitation. When player 2 agrees to the private voice chat, the information that player 2 agrees to the private voice chat is fed back to player 1, and when player 1 is already in the private voice chat room, player 2 is added to the private voice chat room where player 1 is located; and when player 1 is not in the private voice chat room, player 1 can issue an operation command to obtain the private voice chat room; when player 2 disagrees with the private voice chat, the information that rejects the private voice chat is fed back to player 1. Furthermore, player 1 can invite multiple players at the same time, and each player's feedback on the invitation can refer to the above-mentioned feedback on the invitation by the corresponding player 2, which will not be repeated here. Furthermore, when player 1 invites player 2, player 1 may invite player 2 to the same private chat room for a private chat in the public voice hall, or player 1 may invite player 2 to a private chat when already in the private chat room; for another example, when player 2 is invited to a private chat, player 2 may be invited while in the public voice hall, or player 2 may be already in a private chat room and be invited to a private chat by a player who is not in the same private chat room.
[0160] Preferably, the private chat voice room where players exist can be logically locked to ensure atomicity.
[0161] When the type of the operation command is state change, the state change event corresponding to the operation command is executed, and then the state information of the player corresponding to the operation command is changed. It should be noted that the state information includes but is not limited to the player's item card information, identity information, attributes, etc. Preferably, the state change operation command can occur in the private chat voice room.
[0162] Furthermore, the present application can operate the message channel in the main process of the game through a callback function to send corresponding messages to players in the private chat voice room; it can also broadcast the status of each private chat voice room to each player in the public voice hall, for example, a private chat semantic room is converted from a never-idle state to an idle state.
[0163] Preferably, the present application implements the voice private chat function in the game through the connected voice room component. The voice room component is highly reusable. When each business or scenario needs the voice private chat function, the component is introduced to implement it. The process of implementing the voice private chat function does not need to pay attention to the internal underlying logic implementation. The Redis and Pulsar configurations used in the service are injected during access, and each API is called according to the business scenario, which shortens the development time while streamlining the code.
[0164] This application introduces a voice room component in the game. After receiving the request commands such as creation, invitation, acceptance / rejection of invitation, etc. sent by the client to the server, the server writes the message to the Pulsar message queue, and uses the sharding characteristics of Pulsar to consume all the voice room operations in the same game in an orderly manner. The present invention can ensure the atomicity and timing correctness of the operation when multiple players operate the same event at the same time, ensure the perfection of game functions, ensure the timing correctness of messages sent to the client, orderly and accurately handle the scheduling of various events and data consistency, promote the free communication process of the game, and reduce the application cost of the game.
[0165] and Figure 1 Corresponding to the method shown, the present application provides a game voice private chat device, which is used to support Figure 1 For a specific implementation of the method shown, the device can be set at a service end or a server.
[0166] Reference Figure 3 , which is a structural intention of a game voice private chat device provided in an embodiment of the present application, and is specifically described as follows:
[0167] The creation unit 501 is used to inject the voice room configuration information of the discussion stage into the connected voice room component when the game enters the discussion stage, so that the voice room component creates each private chat voice room;
[0168] A broadcasting unit 502, configured to broadcast the game public information of the game in the discussion phase and the room information of each of the private voice chat rooms to each player in the public voice hall of the game;
[0169] A reading unit 503 is used to read each request command in the message queue of the game one by one, wherein the request command is an operation command generated when a player in the public voice room performs a game operation based on the room information and the game information;
[0170] A first determining unit 504 is configured to use the read request command as a target request command and determine an operation type of the target request command;
[0171] A second determining unit 505 is configured to determine a target voice room of the target request command based on each of the private chat voice rooms when the operation type of the target request command is to obtain a private chat voice room;
[0172] The private chat unit 506 is used to add the player corresponding to the target request command to the target voice room, so that the players in the target voice room can have a private voice chat in the voice room.
[0173] In the embodiment provided by the present application, when the game enters the discussion stage, the voice room configuration information of the discussion stage is injected into the connected voice room component, so that the voice room component creates each private chat voice room; the game public information of the game in the discussion stage and the room information of each private chat voice room are broadcast to each player in the public voice hall of the game; each request command in the message queue of the game is read one by one, and the request command is an operation command generated when the player in the public voice room performs game operations based on the room information and game information; the read request command is used as the target request command to determine the operation type of the target request command; when the operation type of the target request command is to obtain a private chat voice room, the target voice room of the target request command is determined based on each private chat voice room; the player corresponding to the target request command is added to the target voice room, so that the player in the target voice room can have a private voice chat in the voice room. The present application uses the connected voice room component to create a private chat voice room, thereby realizing the voice private chat function, so that there is no need to use a complex private chat system to realize the voice private chat function, thereby reducing the application cost of the game.
[0174] In another embodiment provided by the present application, the second determining unit 505 of the device includes:
[0175] An acquisition module, used for acquiring room request information in the target request command;
[0176] A first determination module, used to determine whether the room request information meets a preset random allocation condition;
[0177] The second determination module is used to determine the target voice room of the target request command based on the random allocation strategy of the random allocation condition when the random allocation condition is met; when the random allocation condition is not met, determine the target voice room in each of the private chat voice rooms according to the room request information.
[0178] In another embodiment provided by the present application, the first determining module of the device includes:
[0179] A first determining subunit, configured to determine whether the room request information includes room designation information;
[0180] a second determining subunit, configured to satisfy the random allocation condition if the room request information does not include room designation information;
[0181] A third determining subunit is configured to determine an entry condition of a private chat voice room corresponding to the room specifying information if the room request information includes room specifying information;
[0182] A judging subunit, used for judging whether the player corresponding to the target request command meets the room entry condition;
[0183] The fourth determining subunit is used for not satisfying the random allocation condition when the player with the target request command satisfies the room entry condition; and satisfying the random allocation condition when the player with the target request command does not satisfy the room entry condition.
[0184] In another embodiment provided by the present application, the second determining module of the device includes:
[0185] A fifth determining subunit is used to determine whether there is a private chat voice room marked as randomly assigned;
[0186] The sixth determination subunit is used to determine any private chat voice room marked as randomly assigned as a target voice room if there is a private chat voice room marked as randomly assigned; if there is no private chat voice room marked as randomly assigned, create a private chat voice room for the target request command, and use the created private chat voice room as the target voice room.
[0187] In another embodiment provided by the present application, the device further includes:
[0188] A third determination unit is used for, when the operation type of the target request command is an invitation type, determining the player corresponding to the invitation information as the first player based on the invitation information in the target request command; for any first player, determining whether the first player meets a preset message receiving condition; when the first player meets the message receiving condition, sending a voice invitation message to the first player, so that the first player feeds back an operation command including whether to receive the invitation based on the voice invitation message, and adds the operation command to the message queue; when the first player does not meet the message receiving condition, feeding back an invitation failure message to the player who sent the target request command.
[0189] In another embodiment provided by the present application, the device further includes:
[0190] A fourth determining unit, configured to determine whether all private chat voice rooms are empty when the discussion phase ends;
[0191] The deleting unit is used to delete all private chat voice rooms when all private chat voice rooms are empty; when there are private chat voice rooms that are not empty, add the players in the private chat voice rooms that are not empty to the public voice hall and then delete all private chat voice rooms.
[0192] In another embodiment provided by the present application, the device further includes:
[0193] The fifth determining unit is used to determine whether a state change event meets a preset public condition when a state change event occurs in any private chat voice room; if the state change event meets the preset public condition, the state change event is broadcast.
[0194] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned game voice private chat method.
[0195] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 4 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to execute the one or more instructions 602 to perform the above-mentioned game voice private chat method.
[0196] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0197] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.
[0198] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0199] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0200] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for private game voice chat, characterized in that: include: When the game enters the discussion phase, the voice room configuration information of the discussion phase is injected into the connected voice room component, so that the voice room component creates each private chat voice room; Broadcasting the game public information of the game in the discussion phase and the room information of each of the private chat voice rooms to each player in the public voice hall of the game; Reading each request command in the message queue of the game one by one, wherein the request command is an operation command generated when a player in the public voice room performs a game operation based on the room information and the game information; Using the read request command as a target request command, and determining an operation type of the target request command; When the operation type of the target request command is to obtain a private chat voice room, determining a target voice room of the target request command based on each of the private chat voice rooms; Add the players corresponding to the target request command to the target voice room, so that the players in the target voice room can have a private voice chat in the voice room.
2. The method according to claim 1, characterized in that: The determining the target voice room of the target request command based on each of the private chat voice rooms includes: Obtaining room request information in the target request command; Determining whether the room request information satisfies a preset random allocation condition; When the random allocation condition is met, determining a target voice room for the target request command based on a random allocation strategy of the random allocation condition; When the random assignment condition is not met, a target voice room is determined in each of the private chat voice rooms according to the room request information.
3. The method according to claim 2, characterized in that The determining whether the room request information satisfies a preset random allocation condition includes: Determining whether the room request information includes room designation information; If the room request information does not include room designation information, the random allocation condition is met; If the room request information includes room designation information, determining an entry condition for the private chat voice room corresponding to the room designation information; Determining whether the player corresponding to the target request command meets the room entry condition; When the player requesting the command with the target meets the room entry condition, the random assignment condition is not met; When the player requesting the target command does not meet the room entry condition, the random assignment condition is met.
4. The method according to claim 2, characterized in that: The random allocation strategy based on the random allocation condition, determining the target voice room of the target request command, comprises: Determine if there is a private voice chat room marked as randomly assigned; If there is a private chat voice room marked as randomly assigned, any private chat voice room marked as randomly assigned is determined as the target voice room; If there is no private chat voice room marked as randomly assigned, a private chat voice room is created for the target request command, and the created private chat voice room is used as the target voice room.
5. The method according to claim 1, characterized in that Also includes: When the operation type of the target request command is an invitation type, based on the invitation information in the target request command, determining the player corresponding to the invitation information as the first player; For any first player, determining whether the first player meets a preset message receiving condition; when the first player meets the message receiving condition, sending a voice invitation message to the first player, so that the first player feeds back an operation command including whether to receive the invitation based on the voice invitation message, and adding the operation command to the message queue; When the first player does not meet the message receiving condition, invitation failure information is fed back to the player who sent the target request command.
6. The method according to claim 1, characterized in that Also includes: When the discussion phase ends, determining whether all private chat voice rooms are empty; When all private chat voice rooms are empty, all private chat voice rooms will be deleted; When there are non-empty private chat voice rooms, after adding the players in the non-empty private chat voice rooms to the public voice lobby, all private chat voice rooms are deleted.
7. The method according to claim 1, characterized in that Also includes: When a status change event occurs in any private chat voice room, determine whether the status change event meets the preset disclosure conditions; If the state change event meets the preset disclosure condition, the state change event is broadcast.
8. A game voice private chat device, characterized in that: include: A creation unit, used for injecting the voice room configuration information of the discussion stage into the connected voice room component when the game enters the discussion stage, so that the voice room component creates each private chat voice room; A broadcasting unit, configured to broadcast the game public information of the game in the discussion phase and the room information of each of the private chat voice rooms to each player in the public voice hall of the game; A reading unit, used to read each request command in the message queue of the game one by one, wherein the request command is an operation command generated when a player in the public voice room performs a game operation based on the room information and the game information; A first determining unit, configured to use the read request command as a target request command and determine an operation type of the target request command; A second determining unit is configured to determine a target voice room of the target request command based on each of the private chat voice rooms when the operation type of the target request command is to obtain a private chat voice room; The private chat unit is used to add the player corresponding to the target request command to the target voice room, so that the players in the target voice room can have a private voice chat in the voice room.
9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute a game voice private chat method as described in any one of claims 1-7.
10. An electronic device, characterized in that: It includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform a game voice private chat method as described in any one of claims 1-7.
