Disclosure of Invention
The embodiment of the invention provides a method and a device for team games, which are used for realizing the technical effect that a watching user plays a team with a main playing user in the process of watching live games.
In a first aspect, the present invention provides a method of team playing, comprising:
when the anchor terminal equipment plays the game directly, the team formation application information which is sent by the network direct broadcast server and represents a target watching user request and the team formation game of the anchor user is received; the main broadcasting terminal equipment runs a game process of the game and a live broadcasting process of the live broadcasting, and the team formation application information is sent to the network live broadcasting server by the target watching user through the watching terminal equipment receiving the live broadcasting;
acquiring a first game role identity through which the target watching user participates in the game in the live broadcasting process based on the team formation application information;
sending the first game role identity to the game process through a named pipeline between the live broadcast process and the game process;
establishing a game team comprising the anchor user and the target viewing user in the game progress based on the first game character identity.
Optionally, before sending the first game character identifier to the game process through a named pipe between the live process and the game process, the method further includes:
judging whether the target watching user meets a first preset condition contained in the same game team as the main player user or not based on the first game role identity;
when the target viewing user does not meet the first preset condition, generating a first request for enabling the target viewing user to meet the first preset condition in the game process through the named pipeline;
obtaining, by the named pipe, a pass response of the first request of the live process received by the game process; and if the pass response is obtained, the target viewing user meets the first preset condition.
Optionally, before sending the first game character identifier to the game process through a named pipe between the live process and the game process, the method further includes:
creating a server side of the named pipeline in the live broadcast process;
injecting a preset program for loading the client of the named pipe in the game process;
and running the preset program to load the client in the game process, wherein the client is connected with the server to finish the construction of the named pipeline.
Optionally, injecting a preset program for loading the client of the named pipe in the game process includes:
providing a disk path of the preset program for the game process;
and loading the preset program in the game process according to the disk path.
Optionally, establishing a game team including the anchor user and the target viewing user in the game process based on the first game character identity includes:
calling a function for establishing a game team in the game process through the named pipeline;
passing the first game character identification into the function for establishing a game team set;
and executing the function for establishing the game team set to construct the game team.
In a second aspect, the present invention provides an apparatus for a team game, comprising:
the first receiving module is used for receiving team formation application information which is sent by a network live broadcast server and represents a target watching user request and a team formation game of an anchor user when the anchor terminal equipment carries out game live broadcast; the main broadcasting terminal equipment runs a game process of the game and a live broadcasting process of the live broadcasting, and the team formation application information is sent to the network live broadcasting server by the target watching user through the watching terminal equipment receiving the live broadcasting;
an obtaining module, configured to obtain, in the live broadcast process, a first game role identity by which the target viewing user participates in the game based on the team formation application information;
the sending module is used for sending the first game role identity identification to the game process through a named pipeline between the live broadcast process and the game process;
and the establishing module is used for establishing a game team comprising the main player user and the target watching user in the game process based on the first game role identity.
Optionally, the apparatus further comprises:
the judging module is used for judging whether the target watching user meets a first preset condition contained in the same game team as the main broadcasting user based on the first game role identity before the first game role identity is sent to the game process through a named pipeline between the live broadcasting process and the game process;
the generating module is used for generating a first request for enabling the target watching user to meet the first preset condition in the game process through the named pipeline when the target watching user does not meet the first preset condition;
a second receiving module, configured to obtain, through the named pipe, a pass response of the first request of the live broadcast process received by the game process; and if the pass response is obtained, the target viewing user meets the first preset condition.
Optionally, the apparatus further includes a building module, configured to create a server of a naming pipe in the live broadcast process before sending the first game character identifier to the game process through the naming pipe between the live broadcast process and the game process; injecting a preset program for loading the client of the named pipe in the game process; and running the preset program to load the client in the game process, wherein the client is connected with the server to finish the construction of the named pipeline.
Optionally, the building module is configured to provide a disk path of the preset program to the game process; and loading the preset program in the game process according to the disk path.
Optionally, the establishing module is configured to call a function for establishing a game team in the game process through the named pipe; passing the first game character identification into the function for establishing a game team set; and executing the function for establishing the game team set to construct the game team.
One or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
in the technical scheme of the embodiment of the invention, when the anchor terminal equipment carries out game live broadcast, the team formation application information which is sent by a network live broadcast server and represents a target watching user request and the team formation game of the anchor user is received; the main broadcasting terminal equipment runs a game process of the game and a live broadcasting process of the live broadcasting, and the team formation application information is sent to the network live broadcasting server by the target watching user through the watching terminal equipment receiving the live broadcasting; acquiring a first game role identity through which the target watching user participates in the game in the live broadcasting process based on the team formation application information; sending the first game role identity to the game process through a named pipeline between the live broadcast process and the game process; establishing a game team comprising the anchor user and the target viewing user in the game progress based on the first game character identity. Therefore, when the team formation application information of the target watching user is received, the identification of the first game role of the target watching user is obtained, the identification of the first game role is sent to the game process through the live broadcast process and the named pipeline direct to the game process, and then the game team is created based on the identification of the first game role in the game process, so that the main broadcasting user and the target watching user can participate in the game in the same game team in the live broadcast game process. Therefore, the technical problem that the watching user cannot directly play with the main player in the watching process is solved. For the watching users, the team formation application information is sent in the network live broadcast, so that the watching users can play a game with a main play team while watching the live broadcast.
Detailed Description
The embodiment of the invention provides a method and a device for team games, which are used for realizing the technical effect that a watching user plays a team with a main playing user in the process of watching live games.
In order to solve the technical problems, the technical scheme provided by the invention has the following general idea:
when group application information of a target watching user is received, a first game role identity of the target watching user is obtained, the first game role identity is sent to a game process through a direct naming pipeline of the live broadcast process and the game process, and then the game group is created based on the first game role identity in the game process, so that the anchor user and the target watching user can participate in a game in the same game group in the live broadcast game process.
The technical solutions of the present invention are described in detail below with reference to the drawings and specific embodiments, and it should be understood that the specific features in the embodiments and examples of the present invention are described in detail in the technical solutions of the present application, and are not limited to the technical solutions of the present application, and the technical features in the embodiments and examples of the present application may be combined with each other without conflict.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In order to more clearly describe the method for team game in the embodiment of the present invention, a network architecture applied in the embodiment of the present invention is first described. Please refer to fig. 1, which is a schematic diagram of a possible network architecture. As shown in fig. 1, in one live webcast, there may be one anchor device and one or more viewing devices, and both the anchor device and the viewing device access a live webcast server through a network. The anchor terminal equipment is held by the anchor to collect images and audio, and the anchor terminal equipment sends the collected images and audio to the network live broadcast server. And the live network server analyzes and processes the images and the audio and then sends the images and the audio to all the watching terminal equipment.
In the embodiment of the present invention, the live webcast is specifically a live game, that is, the image and the audio at least include an image and an audio of a game, and further may include an image and an audio of a main webcast. The process of the network live broadcast and the process of the game are both operated in the main broadcast terminal equipment.
And each watching user watches the live game on the own watching terminal equipment. Moreover, each viewing user can send viewing information such as barrage, comments or gifts through the viewing end equipment.
Referring to fig. 2, a flow chart of a method for team formation game according to an embodiment of the present invention is shown. The method comprises the following steps:
s101: when the anchor terminal equipment plays the game directly, the team formation application information which is sent by the network direct broadcast server and represents a target watching user request and the team formation game of the anchor user is received;
s102: acquiring a first game role identity through which the target watching user participates in the game in the live broadcasting process based on the team formation application information;
s103: sending the first game role identity to the game process through a named pipeline between the live broadcast process and the game process;
s104: establishing a game team comprising the anchor user and the target viewing user in the game progress based on the first game character identity.
Specifically, in the live game of the embodiment of the present invention, a corresponding process runs in the anchor terminal device. Further, if the game is specifically a network game, the anchor terminal device may further access a game server different from the network live server. In addition, the anchor terminal device needs to live the game, so the anchor terminal device can also run a live process.
At any time when the anchor terminal device carries out live broadcast on the game, the anchor terminal device can receive team formation application information which is sent by a network live broadcast server and represents a target watching user request and a team formation game of the anchor user. Specifically, the target viewing user is a viewing user who views a live game. The target watching user generates team application information on the watching terminal device, the watching terminal device sends the team application information to the network live broadcast server, and then the network live broadcast server forwards the team application information to the anchor terminal device.
In a specific implementation process, the team formation application information may be sent in the form of a barrage, a comment, a gift, or the like, and the present invention is not particularly limited.
In a specific implementation process, in order to avoid too many viewing users participating in the game, a condition for becoming a target viewing user may be set in advance. In one embodiment, a target viewing user who is able to team with the anchor user may be set by the webcast server. Or in other embodiments, the anchor user may set a second preset condition for becoming the target viewing user by itself, where the second preset condition is, for example, that the user level reaches a preset level, or the stay time in the live broadcast room reaches a preset time, or the number of times of entering the live broadcast room reaches a preset number, and so on. Then, according to a second preset condition set by the anchor user, the live end device can filter out the target watching user in the live process.
Next, in S102, the anchor terminal device obtains the first game character identifier of the target viewing user in the live broadcast process based on the team formation application information. The first game character identity is an identity, such as an ID, a nickname, or an account, by which the target user participates in the game. In addition, the anchor user in the embodiment of the invention plays the game live broadcast, so the anchor user also participates in the game by the identity of the anchor user in the game, and the game identity of the anchor user is called as a second game role identity in the embodiment of the invention.
Named pipe Named Pipes is an inter-process communication mechanism that can support reliable, one-way or two-way data communication between different processes of the same computer or between different processes of different computers across a network. It shields the underlying network protocol details. In order to realize the team game of the watching user and the anchor user who watch the live broadcast, the embodiment of the invention constructs a naming pipeline in the live broadcast process and the game process, and in S103, the identity identification of the first game role in the live broadcast process is sent to the game process through the naming pipeline.
Since the anchor user is already playing the game itself, the game process has the second game character identity of the anchor user. Then, in S104, a game team is established in the game based on the first game character id, and both the first game character id and the second game character id are added to the game team, thereby allowing the target viewing user to play the game together with the anchor user in the same game team.
When the team application information of the target watching user is received, the identification of the first game role of the target watching user is obtained, the identification of the first game role is sent to the game process through a direct naming pipeline of the live broadcast process and the game process, and then the game team is established based on the identification of the first game role in the game process, so that the anchor user and the target watching user can participate in the game in the same game team in the live broadcast game process. Therefore, the technical problem that the watching user cannot directly play with the main player in the watching process is solved. For the watching users, the team formation application information is sent in the network live broadcast, so that the watching users can play a game with a main play team while watching the live broadcast.
How S101 receives the team application information is described below.
In an embodiment, the viewing user may generate the team application information by sending a barrage or a comment of the preset content, and the receiving, by the anchor device, the team application information specifically includes: receiving a plurality of barrages or comments sent by a watching user; judging whether the content of each barrage or the comment accords with the preset content or not; if the content of the barrage or the comment accords with the preset content, determining that the barrage or the comment is the team application information, and determining that the watching user who sends the barrage or the comment is the target watching user.
Specifically, the preset contents may be set by default or by the owner of the anchor user. The preset content is, for example, "team application @" or "open black together", etc., and the present invention is not particularly limited. And the anchor terminal equipment reads each bullet screen or comment from the anchor process and verifies whether the content of the bullet screen or comment is consistent with the preset content one by one. Taking the preset content as 'team application @' as an example, if the content of the barrage or the comment is 'team application @', determining that the barrage or the comment is team application information, and taking the watching user who sends the barrage or the comment as a target watching user; and if the content of the barrage or the comment is not 'team application @', determining that the barrage or the comment is not the information applied by the team.
In another embodiment, the creating, by the viewing user, group application information by purchasing a preset gift given to the anchor user, and the receiving, by the anchor device, the group application information specifically includes: receiving a virtual gift given by a viewing user; judging whether the virtual gift is the preset gift or not; and if the virtual gift is the preset gift, determining that the team application information is received, and determining that the viewing user presenting the preset gift is the target viewing user.
Similarly, the virtual gift may be set by the webcast server by default or by the anchor user, and the present invention is not limited in particular. After the network live broadcast server pushes the virtual gift purchased and presented by the watching user to the live broadcast process, the anchor terminal equipment judges that the virtual gift received in the live broadcast process is a preset gift, and then the anchor terminal equipment determines that team application information is received.
In addition, it is introduced above that, in order to avoid too many viewing users for the team game, in combination with the above two embodiments, in another embodiment, it is necessary to determine whether the content of the barrage or the comment is the preset content, or determine whether the virtual gift is the preset gift, and also determine whether the viewing user satisfies the second preset condition. And if the watching user meets a second preset condition, the content of the barrage or the comment simultaneously meets the preset content, or the virtual gift is the preset gift, determining that the team formation application information is received, and the watching user is a target watching user. If the watching user does not satisfy the second preset condition, even if the content of the barrage or the comment conforms to the preset content or the virtual gift is the preset gift, the team formation application information is not determined to be received, and the watching user is not the target watching user.
How to acquire the first game character identification in S102 will be described below.
If the first live broadcast identification relied on by the target watching user for watching live broadcast and the first game role identification relied on by the participating game can be shared, in an implementation mode, the anchor terminal equipment obtains the first live broadcast identification of the watching user corresponding to the team application information, and then obtains the first game role identification.
If the first live broadcast identification and the first game role identification cannot be shared, in another implementation manner, the target viewing user needs to submit the first game role identification in the network live broadcast server and bind the first game role identification with the first live broadcast identification of the target viewing user.
Further, if the target viewing user needs to form a team to participate in multiple games, multiple first game role identifiers and game identification identifiers (such as game numbers or game names) can be submitted to the webcast server, and each first game role identifier is bound with the game identification identifier and then bound with the own first live broadcast identifier.
For example, a viewing user submits the following information to a webcast server:
UID:000
game name 1: 1
Role name of game 1: 101
Game name 2: 2
Role name of game 3: 201
The above information indicates that the first direct broadcast id of the target viewing user is specifically UID 000. The viewing user participates in the game with the game name 1 by means of the first game character identifier 101, and participates in the game with the game name 2 by means of the first game character identifier 201. And, the game name 1 is bound with the role name 1 of the game, the game name 2 is bound with the role name 2 of the game, and the UID is bound with the bound game name 1 and the role name 1 of the game, and is bound with the bound game name 2 and the role name 2 of the game.
Then, in this embodiment, after receiving the team formation application information, the anchor device obtains the first live identity of the target viewing user, and then obtains the identity of the first game character bound to the first live identity.
Further, if the first live broadcast identity is bound with a plurality of first game role identities, the first game role identity bound with the game identity is obtained according to the game identity of the current live broadcast game. In the above example, if the team formation request information sent by the target viewing user with UID 000 is received in the process of live game 1, the first game character id 101 is obtained according to UID 000 and game name 1.
In addition, those skilled in the art will appreciate that the first direct broadcast identification and the first game character identification may be the same even though the first direct broadcast identification and the first game character identification may not be shared. And the plurality of first game character ids may be the same.
Next, how to transmit the first game character id through the naming pipe in S103 is described.
Specifically, in the embodiment of the present invention, both the live process and the game process run in the host device, as shown in fig. 3, which is a schematic diagram of the live process and the game process. To realize the establishment of a game team including a target viewing user and a main playing user from a live process control game process, a named pipe needs to be constructed between the two processes before S103. In the embodiment of the invention, the specific way for constructing the named pipeline is as follows:
creating a server side of the named pipeline in the live broadcast process;
injecting a preset program for loading the client of the named pipe in the game process;
and running the preset program to load the client in the game process, wherein the client is connected with the server to finish the construction of the named pipeline.
Specifically, the named pipe includes two ends, and the end that injects the live process and sends the first game character identifier is referred to as a "server end", and the end that injects the game process and receives the first game character identifier is referred to as a "client end".
Firstly, a live broadcast process calls a system function of a host end device for creating a named pipeline to create the named pipeline, and a server end of the created named pipeline is injected into the live broadcast process. Then, wait for the client to connect.
Taking the example that the host terminal device is specifically a PC running a Windows system, the live broadcast process calls a Windows api (Application Programming Interface) function to create a named pipe, namely, a CreateNamedPipe function. In the specific implementation process, the name of the named pipeline is defined by a unique name. Then, the connection named pipe ConnectNamedPipe function is called again to wait for the connection of the client.
When the anchor terminal device is another device operating another system, for example, a mobile phone operating an android system, the corresponding system function is called to create the named pipe, which is not described herein any more.
For the client of the named pipe, because the game program in the anchor terminal device is a published program, the client cannot be directly created, so the embodiment of the invention injects a preset program into the game process, and the logic of the preset program is to load the client. And running the preset program in the game process, loading the client by the preset program, and further injecting the client of the named pipeline into the game process. And then, the client connects with the server in the live broadcast process according to the name of the named pipeline, so that the named pipeline is constructed between the live broadcast process and the game process.
The method comprises the following steps of injecting a preset program into a game process:
providing a disk path of the preset program for the game process;
and loading the preset program in the game process according to the disk path.
More specifically, the injection of the preset program into the game progress is realized by the following processes:
allocating a preset space in the memory space of the game process;
writing the disk path of the preset program into the preset space;
creating a remote thread for injecting the preset program based on the disk path in the game process;
and running the remote thread.
Following the above example, the host device is a PC of a Windows system. And the live broadcast process allocates a preset memory in the memory space of the game process through a VirtualAllocEx function in the Windows API function. The function of the VirtualAllocEx function is to reserve or commit a memory area in a virtual space of a specified process. And then, writing the disk path of the preset program into the preset memory through a WriteProcessMemory function in the Windows API function. The function of the WriteProcessMemory function is to write into the memory area of a certain process. Then, the live program calls the create remote thread createremotetrashed function in the windows api function to create a remote thread in the game program. Where a remote thread represents a thread that is created in another thread by one thread. The logic executed by the remote thread in the embodiment of the invention is to call a LoadLibrary function to load a disk path written into a preset memory, and load a preset program in a game process according to the disk path, so that the preset program is injected into the game process. The LoadLibrary function is used to load a specified dynamic link library and map it to the address space used by the current process.
With the above embodiment, a preset program is injected into the game process. And then running a preset program in the game process, thereby loading the client in the game process and further injecting the client into the game process.
As can be seen from the above description, by injecting the preset program for loading the client into the game process, the client is indirectly injected into the game process, so that it is possible to group the game between the watching user and the anchor user.
The loaded client further needs to be connected with a server to be able to interact with the live broadcast process. Specifically, after the client finishes loading, according to the name of the named pipe known by the preset program, a server connected with the named pipe is searched in the system, and after the server is connected, the server is informed that the client finishes connecting, so that the live broadcast process sends information to the game process as required.
Following the above example, the host device is a PC of a Windows system. And the loaded client calls a create data CreateFile function to connect the named pipes, and calls a waitnamedPipe function to monitor the named pipes and wait for the response of the server. After connecting to the server according to the name of the named pipe, the client calls a write data WriteFile function to write data representing that the client completes the connection into the pipe of the server. Then, the read data ReadFile function is called to read the first game character id received in the naming channel. On the other hand, the server waits for the client connection of the named pipe through the ConnectNamedPipe function, calls ReadFile to read the data which is sent by the client and indicates that the client is connected, and then determines that the named pipe is constructed. Then, the server calls the WriteFile function to write all the first game role identifiers acquired in the S102 into the named pipeline.
Next, how to establish a game team including the target viewing user and the anchor user in S104 is described. In the embodiment of the present invention, S104 is implemented by the following processes:
calling a function for establishing a game team in the game process through the named pipeline;
passing the first game identification into the function for establishing a set of game teams;
and executing the function for establishing the game team set to construct the game team set.
Specifically, since the game team is established to play the game, specifically, by calling a function for establishing the game team in the game, it is necessary to determine a game function to be called for establishing the game team.
In one embodiment, all game functions may be obtained in advance, and a mapping relationship between each game function and a function may be established. Then, the live broadcast process receives the team application information, and determines the game function to be called by the game team by contrasting the mapping relation, so that the function for establishing the game team is called and executed in the game process through the named pipe.
As described above, the game program in the anchor device is a published program, and it is inconvenient to acquire the game function. Empirically, the game function exists at a specific address during the game play, and thus, in another embodiment, the game function is called by calling assembly language using disassembly.
Specifically, the embodiment of the invention finds the functions for establishing the game team through a dynamic debugging tool such as WinDbg and determines the parameters required to be transmitted by the game functions. Windbg is a debugging tool in a user mode and a kernel mode under a Windows platform. Compared with Visual Studio, it is a lightweight debugging tool. For example, a function for establishing a game team is determined and called by the following embedded assembly code.
The content in the asm { } is assembly code embedded in the code of the live application. The values of the 3 parameters of RoleNam, RoleThis and InviteFriends are memory addresses, and the 3 memory addresses are found through WinDbg dynamic debugging analysis. And then by passing into the address of the team object that has been instantiated by the ecx register bit in the CPU register. Finally, the function for establishing the game team is called by assembling the command call.
After a client of the naming pipeline calls a function for establishing a game team in a disassembled mode, the first game role identity is transmitted to the function for establishing the game team, and then the function for establishing the game team is executed, so that the game team comprising the first game role identity and the second game role identity is constructed.
Optionally, in a specific implementation process, the currently live game may require that users meet a first preset condition to play a game together in the same game team. The first preset condition is, for example, a friend relationship or a mutual authorization trust relationship, and the invention is not limited in particular. Therefore, before S103, the method may further include:
judging whether the target watching user meets a first preset condition contained in the same game team as the main player user or not based on the first game role identity;
when the target viewing user does not meet the first preset condition, generating a first request for enabling the target viewing user to meet the first preset condition in the game process through the named pipeline;
obtaining, by the named pipe, a pass response of the first request of the live process received by the game process; and if the pass response is obtained, the target viewing user meets the first preset condition.
For convenience of description, the first preset condition is specifically referred to as a friend relationship. Firstly, whether a friend relationship exists between the first game role identity and the second game role identity is judged based on the first game role identity.
In one embodiment, similar to the function for establishing the game team, the function for determining the friend relationship is determined by disassembling, and then the first game role identifier is transmitted to the game process through the named pipe, and the function for determining the friend relationship is specifically transmitted, so that the game process determines whether the target viewing user and the anchor user are in the friend relationship through the first game role identifier and the existing second game role identifier. And then sending a result returned by the function for judging the friend relationship back to the live broadcast process through the client of the named pipeline. If the returned result shows that the target watching user and the anchor user are not in friend relationship, executing the step of generating a first request for enabling the target watching user to meet the first preset condition in the game process through the named pipeline, otherwise, if the returned result shows that the target watching user and the anchor user are in friend relationship, not executing the step of generating the first request for enabling the target watching user to meet the first preset condition in the game process through the named pipeline.
Or, in another embodiment, the watching user having a friend relationship with the anchor user is recorded in the live broadcasting process, and then whether the target watching user has a friend relationship with the anchor user is determined by determining whether the target watching user is recorded. If a target viewing user is recorded in a viewing user having a friend relationship with an anchor user, not performing "generating a first request for the target viewing user to satisfy the first preset condition in the game progress through the named pipe"; on the contrary, if the target viewing user is not recorded in the viewing users having a friend relationship with the anchor user, "generating a first request for the target viewing user to satisfy the first preset condition in the game progress through the named pipe" is performed.
Next, when the target viewing user does not satisfy the first preset condition, that is, the target viewing user is not in a friend relationship with the anchor user, the live broadcast process generates a first request for enabling the target viewing user to satisfy the first preset condition in the game process through the named pipe. In the embodiment of the invention, a friend request for adding a target viewing user as a friend is generated in a game process through a named pipeline.
Specifically, similarly to the above-described embodiment, the address of the friend-added function in the game progress is determined by disassembling, and then the live broadcast progress calls the friend-added function in the address, so that the addition target viewing user is a friend. For example, the following code implementation
Through the codes, the live broadcast process calls an add friend function in the game process, and the identity of the first game role is transmitted to the add friend function. And further, a friend adding function is operated to generate a friend request of adding the target watching user as a friend, and the friend request is sent to the anchor terminal equipment of the target watching user.
Next, the target viewing user will receive a friend request on the viewing end device. And if the target watching user establishes a friend relationship with the anchor user, executing the operation requested by the friend. The watching end device generates and sends a pass response to the game process in the anchor end device.
Then, if a pass response is received in the game process, the client of the named pipe obtains the pass response and writes the pass response into the named pipe. In turn, the live process receives a pass-through response from the named pipe. In the embodiment of the invention, if the live broadcast process receives the pass response after sending the first request, the target watching user can be determined to establish the friend relationship with the anchor user. On the contrary, if the live broadcast process does not receive the pass response after sending the first request, it can be determined that the target watching user and the anchor user do not establish a friend relationship.
Further, after the target watching user meets the first preset condition, if the target watching user sends the team formation application information, the live broadcasting process can establish the game teams of the target watching user and the main broadcasting user by the method, so that the target watching user can play games with the main broadcasting user together while watching the live game, and the experience of the watching user is improved.
Based on the same inventive concept as the method for team game in the foregoing embodiment, a second aspect of the present invention further provides an apparatus for team game, as shown in fig. 4, comprising:
a first receiving module 101, configured to receive, when a anchor terminal device performs game live broadcast, team formation application information indicating a target viewing user request and a team formation game of an anchor user sent by a network live broadcast server; the main broadcasting terminal equipment runs a game process of the game and a live broadcasting process of the live broadcasting, and the team formation application information is sent to the network live broadcasting server by the target watching user through the watching terminal equipment receiving the live broadcasting;
an obtaining module 102, configured to obtain, in the live broadcast process, a first game role identifier by which the target viewing user participates in the game based on the team formation application information;
a sending module 103, configured to send the first game role identity to the game process through a named pipe between the live broadcast process and the game process;
a building module 104, configured to build a game team including the anchor user and the target viewing user in the game process based on the first game character identifier.
Further, the device for team game in the embodiment of the present invention further includes:
the judging module is used for judging whether the target watching user meets a first preset condition contained in the same game team as the main broadcasting user based on the first game role identity before the first game role identity is sent to the game process through a named pipeline between the live broadcasting process and the game process;
the generating module is used for generating a first request for enabling the target watching user to meet the first preset condition in the game process through the named pipeline when the target watching user does not meet the first preset condition;
a second receiving module, configured to obtain, through the named pipe, a pass response of the first request of the live broadcast process received by the game process; and if the pass response is obtained, the target viewing user meets the first preset condition.
Further, the apparatus for team game in the embodiment of the present invention further includes a building module, configured to create a server of a named pipe in the live broadcast process before sending the first game character identity to the game process through the named pipe between the live broadcast process and the game process; injecting a preset program for loading the client of the named pipe in the game process; and running the preset program to load the client in the game process, wherein the client is connected with the server to finish the construction of the named pipeline.
Further, the construction module is used for providing a disk path of the preset program for the game process; and loading the preset program in the game process according to the disk path.
The establishing module 104 is configured to call a function for establishing a game team in the game process through the named pipe; passing the first game character identification into the function for establishing a game team set; and executing the function for establishing the game team set to construct the game team.
Various changes and specific examples of the method for team formation game in the foregoing embodiments of fig. 1-3 are also applicable to the apparatus for team formation game in the present embodiment, and the detailed description of the method for team formation game is clear to those skilled in the art, so that the detailed description is omitted here for brevity.
One or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
in the technical scheme of the embodiment of the invention, when the anchor terminal equipment carries out game live broadcast, the team formation application information which is sent by a network live broadcast server and represents a target watching user request and the team formation game of the anchor user is received; the main broadcasting terminal equipment runs a game process of the game and a live broadcasting process of the live broadcasting, and the team formation application information is sent to the network live broadcasting server by the target watching user through the watching terminal equipment receiving the live broadcasting; acquiring a first game role identity through which the target watching user participates in the game in the live broadcasting process based on the team formation application information; sending the first game role identity to the game process through a named pipeline between the live broadcast process and the game process; establishing a game team comprising the anchor user and the target viewing user in the game progress based on the first game character identity. Therefore, when the team formation application information of the target watching user is received, the identification of the first game role of the target watching user is obtained, the identification of the first game role is sent to the game process through the live broadcast process and the named pipeline direct to the game process, and then the game team is created based on the identification of the first game role in the game process, so that the main broadcasting user and the target watching user can participate in the game in the same game team in the live broadcast game process. Therefore, the technical problem that the watching user cannot directly play with the main player in the watching process is solved. For the watching users, the team formation application information is sent in the network live broadcast, so that the watching users can play a game with a main play team while watching the live broadcast.
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, CD-ROM, 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.