using System; using System.Collections; using System.Collections.Generic; using com.fpnn.rtm; using UnityEngine; namespace com.fpnn.livedata { public partial class RTM { public bool GetGroupMemberCount(Action callback, long groupId, int timeout = 0) { return client.GetGroupCount((int count, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(count, errorCode); }); }, groupId, timeout); } public bool GetGroupMembers(Action, HashSet, int> callback, long groupId, bool online = true, int timeout = 0) { if (online) { return client.GetGroupMembers((HashSet members, HashSet onlineMembers, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(members, onlineMembers, errorCode); }); }, groupId, timeout); } else { return client.GetGroupMembers((HashSet members, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(members, null, errorCode); }); }, groupId, timeout); } } public bool AddGroupMembers(DoneDelegate callback, long groupId, HashSet uids, int timeout = 0) { return client.AddGroupMembers((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, groupId, uids, timeout); } public bool DeleteGroupMembers(DoneDelegate callback, long groupId, HashSet uids, int timeout = 0) { return client.DeleteGroupMembers((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, groupId, uids, timeout); } public bool GetGroupInfo(Action callback, long groupId, int timeout = 0) { return client.GetGroupInfo((string publicInfo, string privateInfo, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(publicInfo, privateInfo, errorCode); }); }, groupId, timeout); } public bool GetGroupsPublicInfo(Action, int> callback, HashSet groupIds, int timeout = 0) { return client.GetGroupsPublicInfo((Dictionary infos, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(infos, errorCode); }); }, groupIds, timeout); } public bool SetGroupInfo(DoneDelegate callback, long groupId, string publicInfo = null, string privateInfo = null, int timeout = 0) { return client.SetGroupInfo((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, groupId, publicInfo, privateInfo, timeout); } public bool GetUserGroups(Action, int> callback, int timeout = 0) { return client.GetUserGroups((HashSet groupIds, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(groupIds, errorCode); }); }, timeout); } } }