Sign In Register

How can we help you today?

Start a new topic
Answered

ListTeamChatResponse cannot retrieve messages

Hi,


I am currently trying to get team messages using the ListTeamChatRequest. I can successfully retrieve messages there through the test harness but with C# code, an error is being given to me by VisualStudio that messages is not a part of the response of the ListTeamChatRequest.


Here's a sample of the code:  

public void GetGlobalChat()
    {
        new ListTeamChatRequest()
        .SetEntryCount(0)
        .SetOffset(offset)
        .SetOwnerId("")
        .SetTeamId("global_chat_1")
        .SetTeamType("")
        .Send((response) => {
            GSEnumerable<ListTeamChatResponse> messages = response.messages;
            GSData scriptData = response.ScriptData;
        });
    }

  

And here's the error that VisualStudio is giving me:

Type `GameSparks.Api.Responses.ListTeamChatResponse' does not contain a definition for `messages' and no extension method `messages' of type `GameSparks.Api.Responses.ListTeamChatResponse' could be found. Are you missing an assembly reference?


Best Answer

Hi,


Thank you for replying. After inspecting stuff. I found out that there was an available update for the SDK. I am now using version 5.5.3.204 and the problem was fixed. 


Here's my working code now:

public void GetGlobalChat()
    {
        new ListTeamChatRequest()
        .SetEntryCount(20)
        .SetOffset(offset)
        .SetOwnerId("")
        .SetTeamId("global_chat_1")
        .SetTeamType("")
        .Send((response) => {
            GSEnumerable<ListTeamChatResponse._ChatMessage> messages = response.Messages;
            GSData scriptData = response.ScriptData;
            ProcessRetrievedChat();
        });
    }

 

Players in my game can now send messages. Thank you very much! 


Hi Christian,


1. I noticed that you set the Entry Count to 0. This will return no messages. Can you try setting this to a number greater than 0?


2. Using the Visual Studio debugger, can you inspect the structure of the GSData scriptData object?


-Pádraig

Answer

Hi,


Thank you for replying. After inspecting stuff. I found out that there was an available update for the SDK. I am now using version 5.5.3.204 and the problem was fixed. 


Here's my working code now:

public void GetGlobalChat()
    {
        new ListTeamChatRequest()
        .SetEntryCount(20)
        .SetOffset(offset)
        .SetOwnerId("")
        .SetTeamId("global_chat_1")
        .SetTeamType("")
        .Send((response) => {
            GSEnumerable<ListTeamChatResponse._ChatMessage> messages = response.Messages;
            GSData scriptData = response.ScriptData;
            ProcessRetrievedChat();
        });
    }

 

Players in my game can now send messages. Thank you very much! 

Login to post a comment