Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Assets/Talo Game Services/Talo/Runtime/APIs/ChannelsAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class ChannelsAPI: BaseAPI
public event Action<Channel, PlayerAlias> OnChannelLeft;
public event Action<Channel, PlayerAlias> OnOwnershipTransferred;
public event Action<Channel> OnChannelDeleted;
public event Action<Channel, string[]> OnChannelUpdated;

public ChannelsAPI() : base("v1/game-channels") {
Talo.Socket.OnMessageReceived += (response) => {
Expand Down Expand Up @@ -40,6 +41,11 @@ public ChannelsAPI() : base("v1/game-channels") {
var data = response.GetData<ChannelDeletedResponse>();
OnChannelDeleted?.Invoke(data.channel);
}
else if (response.GetResponseType() == "v1.channels.updated")
{
var data = response.GetData<ChannelUpdatedResponse>();
OnChannelUpdated?.Invoke(data.channel, data.changedProperties);
}
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TaloGameServices
{
[System.Serializable]
public class ChannelUpdatedResponse
{
public Channel channel;
public string[] changedProperties;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.