question

terrypapamarkou avatar image
terrypapamarkou asked

Create a chat using an Entity group

Hi,

I'm trying to create a clan chat using the Entity Groups. I've managed to create a group and send off a test message using this:

 var data = new Dictionary<string, object>()

            {

                {"Name", playerName},

                {"Message", clanChatInputField.text}

            };

            var dataList = new List<SetObject>()

            {

                new SetObject()

                {

                    ObjectName = "MessageData",

                    DataObject = data

                },

            };

            EntityKey entityKey = ClanManager.EntityKeyMaker(clanID);

            PlayFab.PlayFabEntityAPI.SetObjects(new SetObjectsRequest()

                {

                    Entity = entityKey, 

                    Objects = dataList,

                }, (setResult) => {

                    Debug.Log("send message result "+setResult.ProfileVersion);

                }, OnPlayFabError);

But it looks like I can only create 3 of these objects so I'm not sure what approach I should take for sending multiple chat messages from multiple users.

So that's question 1.

2. What is the best way to keep the chat up to date so messages appear for all members of the group soon after they are sent?

3. How can I load a list of all entity groups to be displayed to a player (so they can find an existing clan and ask to join it)?

Thanks in advance

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

terrypapamarkou avatar image terrypapamarkou commented ·

PS I'm using Unity 2017 and the latest PlayFab sdk.

0 Likes 0 ·

1 Answer

·
pfnathan avatar image
pfnathan answered

This might sting you, first of all, you shouldn't be doing this and this was not how groups were designed. Groups cannot be a chat system.

The only thing that groups can provide here is membership, you need to bring your own chat system (ie. photon chat).

Once that's in place, yes, you can use the IsMember api to control the membership of the chat, but this is not what you are going to get using SetObject, and you will run into API limits instantly if you try to use group data as a chat storage

The 3rd item is something we are working on, so, there isn't a way right now

8 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

terrypapamarkou avatar image terrypapamarkou commented ·

That is disappointing. Is there a tutorial or example project for integrating photon chat?

0 Likes 0 ·
brendan avatar image brendan terrypapamarkou commented ·

Yes, you can find full documentation for Photon Chat in the Exit Games site, here: https://doc.photonengine.com/en-us/chat/current/getting-started/chat-intro.

0 Likes 0 ·
buvuxngz avatar image buvuxngz commented ·

@Brendan Would it be possible to use this server for chat? How would it work to connect chat with users in the entities groups stuff? /cc @TerryPapamarkou

0 Likes 0 ·
brendan avatar image brendan buvuxngz commented ·

We can't really speak to other folks' technologies. Their description says it can be used as a chat server, but we can't confirm. You'd need to talk to the Nakama team directly to get more info on their product.

0 Likes 0 ·
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·

@Brendan

Is there any update on this? Have you guys supported chat system in groups/clans without using third-party plugins?

0 Likes 0 ·
brendan avatar image brendan Muhammad Roshaan Tariq commented ·

Yes, we now provide the PlayFab Party system (https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/networking/), which can be used for text chat and/or voice chat.

0 Likes 0 ·
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq brendan commented ·

@Brendan

The system you mentioned for chatting also supports chat in clans? Because what I wanna do is to enable clan members to chat with each other without really joining the multiplayer match. And it looks like that what you have suggested is for the real-time multiplayer games.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.