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 AddDevice(DoneDelegate callback, string appType, string deviceToken, int timeout = 0) { return client.AddDevice((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, appType, deviceToken, null, timeout); } public bool RemoveDevice(DoneDelegate callback, string deviceToken, int timeout = 0) { return client.RemoveDevice((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, deviceToken, null, timeout); } public bool AddDevicePushOption(DoneDelegate callback, MessageCategory messageCategory, long targetId, HashSet mTypes = null, int timeout = 0) { return client.AddDevicePushOption((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, messageCategory, targetId, mTypes, timeout); } public bool RemoveDevicePushOption(DoneDelegate callback, MessageCategory messageCategory, long targetId, HashSet mTypes = null, int timeout = 0) { return client.RemoveDevicePushOption((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, messageCategory, targetId, mTypes, timeout); } public bool GetDevicePushOption(Action>, Dictionary>, int> callback, int timeout = 0) { return client.GetDevicePushOption((Dictionary> p2p, Dictionary> group, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(p2p, group, errorCode); }); }, timeout); } public bool DataGet(Action callback, string key, int timeout = 0) { return client.DataGet((string value, int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(value, errorCode); }); }, key, timeout); } public bool DataSet(DoneDelegate callback, string key, string value, int timeout = 0) { return client.DataSet((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, key, value, timeout); } public bool DataDelete(DoneDelegate callback, string key, int timeout = 0) { return client.DataDelete((int errorCode) => { RTMControlCenter.callbackQueue.PostAction(() => { callback(errorCode); }); }, key, timeout); } } }