Sign In Register

How can we help you today?

Start a new topic
Answered

Multiple Chat Room Implementation

Hi there,


Does the Chat features support multiple chat rooms kind of environment? 

If yes, is there any technical reference/sample implementation/resources that I can refer to. 


Thanks.


Best Answer
Hi Chiew Chee Foong

Do you want to have multiple chat rooms with different players in them or have a single player be able to be in multiple chat rooms at the same time.

To create a chat room you can use challenges and teams.

The first player to enter a room will create a new Challenge and a new Party/Team. The challenge will have a ChallengeInstanceID and the Party/Team will have an ownerID and teamID, we’ll need these for other users joining.

So when the next player enters the room we can use the SendRequestAs function to perform a JoinChallengeRequest with the ChallengeInstanceID to Join the challenge and a JoinTeamRequest with the ownerID and teamID to have the entering player join the party, automating the process.


Players can join a challenge after creation, if set to Public anyone can join, if set to Friends, only current party members/friends can join. You can set your Party to only allow a certain amount of members, you can also set this in the Challenge too which might be helpful depending on the room type or game the party will be undertaking.


You could also invite a player after a Challenge has been created by using a custom event to trigger a popup in game asking would the player like to Join ? If they choose to join use a JoinChallengeRequest with the ChallengeInstanceID of the already created room/challenge to have them join.


Players can leave the Party be sending a LeaveTeamRequest when they leave the challenge room, you could again use SendRequestAs here. A TeamChatMessage will be useful for sending message between players in the current party. The Player Disconnected Cloud Code event will run silently in the background every time a player disconnects from the game.


Thanks

Katie


 

1 Comment

Answer
Hi Chiew Chee Foong

Do you want to have multiple chat rooms with different players in them or have a single player be able to be in multiple chat rooms at the same time.

To create a chat room you can use challenges and teams.

The first player to enter a room will create a new Challenge and a new Party/Team. The challenge will have a ChallengeInstanceID and the Party/Team will have an ownerID and teamID, we’ll need these for other users joining.

So when the next player enters the room we can use the SendRequestAs function to perform a JoinChallengeRequest with the ChallengeInstanceID to Join the challenge and a JoinTeamRequest with the ownerID and teamID to have the entering player join the party, automating the process.


Players can join a challenge after creation, if set to Public anyone can join, if set to Friends, only current party members/friends can join. You can set your Party to only allow a certain amount of members, you can also set this in the Challenge too which might be helpful depending on the room type or game the party will be undertaking.


You could also invite a player after a Challenge has been created by using a custom event to trigger a popup in game asking would the player like to Join ? If they choose to join use a JoinChallengeRequest with the ChallengeInstanceID of the already created room/challenge to have them join.


Players can leave the Party be sending a LeaveTeamRequest when they leave the challenge room, you could again use SendRequestAs here. A TeamChatMessage will be useful for sending message between players in the current party. The Player Disconnected Cloud Code event will run silently in the background every time a player disconnects from the game.


Thanks

Katie


 

Login to post a comment