备份CatanBuilding瘦身独立工程
This commit is contained in:
8
LocalPackages/rtm-sdk-unity-2.7.20/Runtime.meta
Normal file
8
LocalPackages/rtm-sdk-unity-2.7.20/Runtime.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c0a0287a92dd7d408fe9c1b778f9bb1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
LocalPackages/rtm-sdk-unity-2.7.20/Runtime/Plugins.meta
Normal file
8
LocalPackages/rtm-sdk-unity-2.7.20/Runtime/Plugins.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3f8a9a28cef9b446bb81c024e3896de
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11dd24199ab6e48e8a537988894360b4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5b371e578c6f466e9609d9905f216af
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8a50a9a9fe254988948787ec3f469e7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a436eb89b70a48dab7cc585cbc02c55
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8079306bef4214c33813d26889ed17de
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: ARM64
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 732f1a8eb5cff4d818ef0b682b4f6c92
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca5eaeb664ffb4458b7489bfe09eff7e
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89d5ae31ce2bd41109289891f9abd908
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51afea19be6ef49ef811e6028dcef43e
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae2f5e684998a405cb91c755e30120b8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 068bedb82e7e145ceade11a7a4c02967
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bdb12b364ce3bcb43b24a58011e8ec45
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,160 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool SendChatMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, string message, string attrs = "", int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendChat((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupChat((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomChat((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static List<byte> chatMtype = new List<byte>(){(byte)MessageType.Chat};
|
||||
|
||||
public bool GetHitoryChatMessage(HistoryMessageDelegate callback, MessageCategory messageCategory, long id, bool desc, int count, long beginMsec = 0, long endMsec = 0, long lastId = 0, List<byte> mtypes = null, int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.GetP2PMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, chatMtype, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.GetGroupMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, chatMtype, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.GetRoomMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, chatMtype, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.BroadcastMessage)
|
||||
{
|
||||
return client.GetBroadcastMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, desc, count, beginMsec, endMsec, lastId, chatMtype, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, 0, 0, 0, null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetHitoryChatMessageByMessageId(HistoryMessageDelegate callback, MessageCategory messageCategory, long id, bool desc, int count, long messageId, long beginMsec = 0, long endMsec = 0, List<byte> mtypes = null, int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.GetP2PMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, messageId, beginMsec, endMsec, chatMtype, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.GetGroupMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, messageId, beginMsec, endMsec, chatMtype, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.GetRoomMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, messageId, beginMsec, endMsec, chatMtype, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.BroadcastMessage)
|
||||
{
|
||||
return client.GetBroadcastMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, desc, count, messageId, beginMsec, endMsec, chatMtype, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, 0, 0, 0, null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 069040d130a0dc84ab77a651b92c7bbb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool GetConversation(Action<List<Conversation>, int> callback, ConversationType conversationType, HashSet<byte> mTypes = null, long startTime = 0, int timeout = 0)
|
||||
{
|
||||
if (conversationType == ConversationType.P2P)
|
||||
{
|
||||
return client.GetP2PConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else if (conversationType == ConversationType.GROUP)
|
||||
{
|
||||
return client.GetGroupConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetAllUnreadConversation(Action<List<Conversation>, List<Conversation>, int> callback, bool clear = true, HashSet<byte> mTypes = null, long startTime = 0, int timeout = 0)
|
||||
{
|
||||
return client.GetUnreadConversationList((List<Conversation> groupConversationList, List<Conversation> p2pConversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(groupConversationList, p2pConversationList, errorCode);
|
||||
});
|
||||
}, clear, mTypes, startTime, timeout);
|
||||
}
|
||||
|
||||
public bool GetUnreadConversation(Action<List<Conversation>, int> callback, ConversationType conversationType, HashSet<byte> mTypes = null, long startTime = 0, int timeout = 0)
|
||||
{
|
||||
if (conversationType == ConversationType.P2P)
|
||||
{
|
||||
return client.GetP2PUnreadConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else if (conversationType == ConversationType.GROUP)
|
||||
{
|
||||
return client.GetGroupUnreadConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ClearUnread(DoneDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.ClearUnread((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool RemoveP2PConversation(DoneDelegate callback, long uid, bool oneway = false, int timeout = 0)
|
||||
{
|
||||
return client.RemoveSession((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uid, oneway, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e188a3177202d0d4aa1cb73d363a5704
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public delegate void IMLIB_PushFriendChangedDelegate(long uid, int changeType, string attrs);
|
||||
public delegate void IMLIB_PushAddFriendApplyDelegate(long uid, string msg, string attrs);
|
||||
public delegate void IMLIB_PushAcceptFriendApplyDelegate(long uid, string attrs);
|
||||
public delegate void IMLIB_PushRefuseFriendApplyDelegate(long uid, string attrs);
|
||||
|
||||
public delegate void IMLIB_PushEnterGroupApplyDelegate(long groupId, long from, long invitedUid, string attrs);
|
||||
public delegate void IMLIB_PushAcceptEnterGroupApplyDelegate(long groupId, long from, string attrs);
|
||||
public delegate void IMLIB_PushRefuseEnterGroupApplyDelegate(long groupId, long from, string attrs);
|
||||
public delegate void IMLIB_PushInvitedIntoGroupDelegate(long groupId, long from, string attrs);
|
||||
public delegate void IMLIB_PushAccpetInvitedIntoGroupDelegate(long groupId, long from, string attrs);
|
||||
public delegate void IMLIB_PushRefuseInvitedIntoGroupDelegate(long groupId, long from, string attrs);
|
||||
public delegate void IMLIB_PushGroupChangedDelegate(long groupId, int changType, string attrs);
|
||||
public delegate void IMLIB_PushGroupMemberChangedDelegate(long groupId, int changeType, long from);
|
||||
public delegate void IMLIB_PushGroupOwnerChangedDelegate(long groupId, long oldOwner, long newOwner);
|
||||
public delegate void IMLIB_PushGroupManagerChangedDelegate(long groupId, int changeType, List<long> managers);
|
||||
|
||||
public delegate void IMLIB_PushEnterRoomApplyDelegate(long roomId, long from, long invitedUid, string attrs);
|
||||
public delegate void IMLIB_PushAcceptEnterRoomApplyDelegate(long roomId, long from, string attrs);
|
||||
public delegate void IMLIB_PushRefuseEnterRoomApplyDelegate(long roomId, long from, string attrs);
|
||||
public delegate void IMLIB_PushInvitedIntoRoomDelegate(long roomId, long from, string attrs);
|
||||
public delegate void IMLIB_PushAccpetInvitedIntoRoomDelegate(long roomId, long from, string attrs);
|
||||
public delegate void IMLIB_PushRefuseInvitedIntoRoomDelegate(long roomId, long from, string attrs);
|
||||
public delegate void IMLIB_PushRoomChangedDelegate(long roomId, int changType, string attrs);
|
||||
public delegate void IMLIB_PushRoomMemberChangedDelegate(long roomId, int changeType, long from);
|
||||
public delegate void IMLIB_PushRoomOwnerChangedDelegate(long roomId, long oldOwner, long newOwner);
|
||||
public delegate void IMLIB_PushRoomManagerChangedDelegate(long roomId, int changeType, List<long> managers);
|
||||
|
||||
public delegate void IMLIB_GetGroupListDelegate(HashSet<long> groupList, int errorCode);
|
||||
public delegate void IMLIB_GetGroupInfosDelegate(List<IMLIB_GroupInfo> groupInfos, int errorCode);
|
||||
public delegate void IMLIB_GetGroupMembersDelegate(List<IMLIB_GroupMemberInfo> groupMemberList, int errorCode);
|
||||
public delegate void IMLIB_GetGroupMemberCountDelegate(int memberCount, int errorCode);
|
||||
public delegate void IMLIB_GetGroupApplyListDelegate(List<IMLIB_GroupApply> applyList, int errorCode);
|
||||
public delegate void IMLIB_GetGroupInviteListDelegate(List<IMLIB_GroupInvite> inviteList, int errorCode);
|
||||
public delegate void IMLIB_GetGroupRequestListDelegate(List<IMLIB_GroupRequest> requestList, int errorCode);
|
||||
|
||||
public delegate void IMLIB_GetRoomListDelegate(HashSet<long> roomList, int errorCode);
|
||||
public delegate void IMLIB_GetRoomInfosDelegate(List<IMLIB_RoomInfo> roomInfos, int errorCode);
|
||||
public delegate void IMLIB_GetRoomMembersDelegate(List<IMLIB_RoomMemberInfo> roomMemberList, int errorCode);
|
||||
public delegate void IMLIB_GetRoomMemberCountDelegate(int memberCount, int errorCode);
|
||||
public delegate void IMLIB_GetRoomInviteListDelegate(List<IMLIB_RoomInvite> inviteList, int errorCode);
|
||||
|
||||
public delegate void IMLIB_GetUserInfosDelegate(List<IMLIB_UserInfo> userInfos, int errorCode);
|
||||
public delegate void IMLIB_GetFriendApplyListDelegate(List<IMLIB_FriendApply> applyList, int errorCode);
|
||||
public delegate void IMLIB_GetFriendRequestListDelegate(List<IMLIB_FriendRequest> requestList, int errorCode);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79438d829bfda5548bed672ae3aba9b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,222 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool SendImageFile(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.ImageFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.ImageFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.ImageFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendAudioFile(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.VoiceFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.VoiceFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.VoiceFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendVideoFile(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.VideoFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.VideoFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.VideoFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendAudioMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.AudioFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.AudioFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.AudioFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendNormalFile(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.NormalFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.NormalFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, MessageType.NormalFile, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1a9923200f0c904bbf7fa660c6a6a6e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool AddFriend(DoneDelegate callback, long uid, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AddFriend((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uid, extra, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool AckAddFriend(DoneDelegate callback, long uid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AckAddFriend((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uid, agree, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool DeleteFriends(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.DeleteFriends((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetFriendList(GetFriendListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.GetFriends((HashSet<long> friendList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(friendList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool AddBlackList(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.AddBlacklist((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool DeleteBlackList(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.DeleteBlacklist((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetBlackList(GetBlackListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.GetBlacklist((HashSet<long> uids, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(uids, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool GetFriendApplyList(IMLIB_GetFriendApplyListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetFriendApplyList((List<IMLIB_FriendApply> applyList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(applyList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool GetFriendRequestList(IMLIB_GetFriendRequestListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetFriendRequestList((List<IMLIB_FriendRequest> requestList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(requestList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b276d24978d94e4c9ce2c184cab1873
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool JoinGroup(DoneDelegate callback, long groupId, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_JoinGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, extra, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool AckJoinGroup(DoneDelegate callback, long groupId, long fromUid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AckJoinGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, fromUid, agree, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool InviteIntoGroup(DoneDelegate callback, long groupId, HashSet<long> uids, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_InviteIntoGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, uids, extra, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool AckInviteIntoGroup(DoneDelegate callback, long groupId, long fromUid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AckInviteIntoGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, fromUid, agree, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupList(IMLIB_GetGroupListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.GetUserGroups((HashSet<long> groupList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(groupList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool LeaveGroup(DoneDelegate callback, long groupId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_LeaveGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
|
||||
public bool DismissGroup(DoneDelegate callback, long groupId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_DismissGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupInfos(IMLIB_GetGroupInfosDelegate callback, HashSet<long> groupIds, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetGroupInfos((List<IMLIB_GroupInfo> groupInfos, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(groupInfos, errorCode);
|
||||
});
|
||||
}, groupIds, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupMembers(IMLIB_GetGroupMembersDelegate callback, long groupId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetGroupMembers((List<Dictionary<string, string>> groupMembersInfo, int errorCode) => {
|
||||
List<IMLIB_GroupMemberInfo> memberList = new List<IMLIB_GroupMemberInfo>();
|
||||
if (groupMembersInfo != null)
|
||||
{
|
||||
foreach (var member in groupMembersInfo)
|
||||
{
|
||||
IMLIB_GroupMemberInfo memberInfo = new IMLIB_GroupMemberInfo();
|
||||
member.TryGetValue("uid", out string uid);
|
||||
memberInfo.userId = Convert.ToInt64(uid);
|
||||
member.TryGetValue("role", out string role);
|
||||
memberInfo.role = (IMLIB_GroupRoomMemberRole)Convert.ToInt32(role);
|
||||
member.TryGetValue("online", out string online);
|
||||
memberInfo.online = (online == "1");
|
||||
}
|
||||
}
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(memberList, errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupMemberCount(IMLIB_GetGroupMemberCountDelegate callback, long groupId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetGroupMemberCount((int memberCount, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(memberCount, errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
|
||||
public bool RemoveGroupMembers(DoneDelegate callback, long groupId, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_RemoveGroupMembers((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool TransferGroup(DoneDelegate callback, long groupId, long targetUid, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_TransferGroup((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, targetUid, timeout);
|
||||
}
|
||||
|
||||
public bool AddGroupManagers(DoneDelegate callback, long groupId, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AddGroupManagers((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool RemoveGroupManagers(DoneDelegate callback, long groupId, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_RemoveGroupManagers((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupApplyList(IMLIB_GetGroupApplyListDelegate callback, long groupId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetGroupApplyList((List<IMLIB_GroupApply> applyList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(applyList, errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupInviteList(IMLIB_GetGroupInviteListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetGroupInviteList((List<IMLIB_GroupInvite> inviteList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(inviteList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupRequestList(IMLIB_GetGroupRequestListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetGroupRequestList((List<IMLIB_GroupRequest> requestList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(requestList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05cb5ee34c2880f4689dae74f71831b6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool JoinRoom(DoneDelegate callback, long roomId, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_JoinRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, extra, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool AckJoinRoom(DoneDelegate callback, long roomId, long fromUid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AckJoinRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, fromUid, agree, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool InviteIntoRoom(DoneDelegate callback, long roomId, HashSet<long> uids, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_InviteIntoRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, uids, extra, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool AckInviteIntoRoom(DoneDelegate callback, long roomId, long fromUid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AckInviteIntoRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, fromUid, agree, attrs, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomList(IMLIB_GetRoomListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.GetUserRooms((HashSet<long> roomList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(roomList, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool LeaveRoom(DoneDelegate callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_LeaveRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool DismissRoom(DoneDelegate callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_DismissRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomInfos(IMLIB_GetRoomInfosDelegate callback, HashSet<long> roomIds, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetRoomInfos((List<IMLIB_RoomInfo> roomInfos, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(roomInfos, errorCode);
|
||||
});
|
||||
}, roomIds, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomMembers(IMLIB_GetRoomMembersDelegate callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetRoomMembers((List<Dictionary<string, string>> roomMembersInfo, int errorCode) => {
|
||||
List<IMLIB_RoomMemberInfo> memberList = new List<IMLIB_RoomMemberInfo>();
|
||||
if (roomMembersInfo != null)
|
||||
{
|
||||
foreach (var member in roomMembersInfo)
|
||||
{
|
||||
IMLIB_RoomMemberInfo memberInfo = new IMLIB_RoomMemberInfo();
|
||||
member.TryGetValue("uid", out string uid);
|
||||
memberInfo.userId = Convert.ToInt64(uid);
|
||||
member.TryGetValue("role", out string role);
|
||||
memberInfo.role = (IMLIB_GroupRoomMemberRole)Convert.ToInt32(role);
|
||||
}
|
||||
}
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(memberList, errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomMemberCount(IMLIB_GetRoomMemberCountDelegate callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetRoomMemberCount((int memberCount, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(memberCount, errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool RemoveRoomMembers(DoneDelegate callback, long roomId, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_RemoveRoomMembers((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool TransferRoom(DoneDelegate callback, long roomId, long targetUid, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_TransferRoom((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, targetUid, timeout);
|
||||
}
|
||||
|
||||
public bool AddRoomManagers(DoneDelegate callback, long roomId, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_AddRoomManagers((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool RemoveRoomManagers(DoneDelegate callback, long roomId, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_RemoveRoomManagers((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomInviteList(IMLIB_GetRoomInviteListDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetRoomInviteList((List<IMLIB_RoomInvite> inviteList, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(inviteList, errorCode);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6b79476490d44640ba6cb33fc94c527
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public class IMLIB_FriendApply
|
||||
{
|
||||
public long uid;
|
||||
public long createTime;
|
||||
public int status;
|
||||
public string extra;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_FriendRequest
|
||||
{
|
||||
public long uid;
|
||||
public long createTime;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_GroupRequest
|
||||
{
|
||||
public long gid;
|
||||
public long createTime;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_GroupApply
|
||||
{
|
||||
public long uid;
|
||||
public long inviteUid;
|
||||
public long createTime;
|
||||
public int status;
|
||||
public string extra;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_GroupInvite
|
||||
{
|
||||
public long gid;
|
||||
public long fromUid;
|
||||
public long createTime;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_RoomRequest
|
||||
{
|
||||
public long rid;
|
||||
public long createTime;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_RoomApply
|
||||
{
|
||||
public long uid;
|
||||
public long inviteUid;
|
||||
public long createTime;
|
||||
public int status;
|
||||
public string extra;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_RoomInvite
|
||||
{
|
||||
public long rid;
|
||||
public long fromUid;
|
||||
public long createTime;
|
||||
public string attrs;
|
||||
}
|
||||
|
||||
public class IMLIB_UserInfo
|
||||
{
|
||||
public long uid;
|
||||
public string name;
|
||||
public string portraitUrl;
|
||||
public string profile;
|
||||
public string attrs;
|
||||
public IMLIB_ApplyGrant applyGrant;
|
||||
}
|
||||
|
||||
public class IMLIB_GroupInfo
|
||||
{
|
||||
public long groupId;
|
||||
public string name;
|
||||
public string portraitUrl;
|
||||
public string profile;
|
||||
public string attrs;
|
||||
public long ownerUid;
|
||||
public List<long> managerUids;
|
||||
public IMLIB_ApplyGrant applyGrant;
|
||||
public IMLIB_InviteGrant inviteGrant;
|
||||
}
|
||||
|
||||
public class IMLIB_GroupMemberInfo
|
||||
{
|
||||
public long userId;
|
||||
public IMLIB_GroupRoomMemberRole role;
|
||||
public bool online;
|
||||
}
|
||||
|
||||
public class IMLIB_RoomInfo
|
||||
{
|
||||
public long roomId;
|
||||
public string name;
|
||||
public string portraitUrl;
|
||||
public string profile;
|
||||
public string attrs;
|
||||
public string extra;
|
||||
public long ownerUid;
|
||||
public List<long> managerUids;
|
||||
public IMLIB_ApplyGrant applyGrant;
|
||||
public IMLIB_InviteGrant inviteGrant;
|
||||
}
|
||||
|
||||
public class IMLIB_RoomMemberInfo
|
||||
{
|
||||
public long userId;
|
||||
public IMLIB_GroupRoomMemberRole role;
|
||||
}
|
||||
|
||||
public enum IMLIB_ApplyGrant
|
||||
{
|
||||
NONE = -1,
|
||||
ALL = 0,
|
||||
VERIFY = 1,
|
||||
DENYALL = 2,
|
||||
}
|
||||
|
||||
public enum IMLIB_InviteGrant
|
||||
{
|
||||
NONE = -1,
|
||||
DENY = 0,
|
||||
ALL = 1,
|
||||
}
|
||||
|
||||
public enum IMLIB_GroupRoomMemberRole
|
||||
{
|
||||
OWNER = 0,
|
||||
MANAGER = 1,
|
||||
MEMBER = 2,
|
||||
}
|
||||
|
||||
public enum IMLIB_PushAppType
|
||||
{
|
||||
FCM = 0,
|
||||
APNS = 1,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6c6deea781e9984bb0b48b80fa1cd7f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
public bool GetUserInfos(IMLIB_GetUserInfosDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.IMLIB_GetUserInfos((List<IMLIB_UserInfo> userInfos, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(userInfos, errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool AddDevice(DoneDelegate callback, IMLIB_PushAppType appType, string deviceToken, int timeout = 0)
|
||||
{
|
||||
string type = appType == IMLIB_PushAppType.FCM ? "fcm" : "apns";
|
||||
return client.AddDevice((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, type, 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<byte> 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<byte> mtypes = null, int timeout = 0)
|
||||
{
|
||||
return client.RemoveDevicePushOption((int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(errorCode);
|
||||
});
|
||||
}, messageCategory, targetId, mtypes, timeout);
|
||||
}
|
||||
|
||||
public bool GetDevicePushOption(GetDevicePushOptionDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.GetDevicePushOption((Dictionary<long, HashSet<byte>> p2p, Dictionary<long, HashSet<byte>> group, int errorCode) => {
|
||||
DevicePushOption option = new DevicePushOption();
|
||||
option.p2p = p2p;
|
||||
option.group = group;
|
||||
RTMControlCenter.callbackQueue.PostAction(() => {
|
||||
callback(option, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 179e09072107dd64789d955439270c80
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class IM
|
||||
{
|
||||
RTMClient client;
|
||||
|
||||
public IM(in RTMClient client)
|
||||
{
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public bool Login(AuthDelegate callback, string token, int timeout = 0)
|
||||
{
|
||||
return client.Login((long projectId, long uid, bool successful, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(projectId, uid, successful, errorCode);
|
||||
});
|
||||
}, token, timeout);
|
||||
}
|
||||
|
||||
public bool LoginV2(AuthDelegate callback, string token, long ts, int timeout = 0)
|
||||
{
|
||||
return client.Login((long projectId, long uid, bool successful, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(projectId, uid, successful, errorCode);
|
||||
});
|
||||
}, token, ts, timeout);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbda6beb88f5d1d4582740f0a5c787e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class LDEngine
|
||||
{
|
||||
internal RTMClient rtmClient;
|
||||
static private ErrorRecorder errorRecorder;
|
||||
|
||||
public RTM RTM { get; }
|
||||
public IM IM { get; }
|
||||
public ValueAdded ValueAdded { get; }
|
||||
|
||||
static public LDEngine CreateEngine(string endpoint, long pid, long uid)
|
||||
{
|
||||
return new LDEngine(endpoint, pid, uid);
|
||||
}
|
||||
|
||||
public LDEngine(string endpoint, long pid, long uid)
|
||||
{
|
||||
processor = new RTMQuestProcessor();
|
||||
rtmClient = RTMClient.getInstance(endpoint, pid, uid, processor);
|
||||
RTM = new RTM(rtmClient);
|
||||
IM = new IM(rtmClient);
|
||||
ValueAdded = new ValueAdded(rtmClient);
|
||||
}
|
||||
|
||||
public void SetErrorRecorder(ErrorRecorder errorRecorder)
|
||||
{
|
||||
LDEngine.errorRecorder = errorRecorder;
|
||||
}
|
||||
|
||||
string GetRTMEndpoint(RTMENDPOINT endpointType)
|
||||
{
|
||||
if (endpointType == RTMENDPOINT.RTMENDPOINT_NX)
|
||||
return LDEngineConfig.RTMEndpoint_NX;
|
||||
else
|
||||
return LDEngineConfig.RTMEndpoint_INTL;
|
||||
}
|
||||
|
||||
static internal void ErrorLog(string message)
|
||||
{
|
||||
LDEngine.errorRecorder?.RecordError(message);
|
||||
}
|
||||
|
||||
public RTMClient GetRTMClient() { return rtmClient; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20e18118797914c4884004253f6e20a9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,134 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using com.fpnn.rtm;
|
||||
using com.fpnn;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using System.IO;
|
||||
using System;
|
||||
using com.fpnn.msgpack;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
static public class LDEngineFile
|
||||
{
|
||||
static string persistentDataPath;
|
||||
static readonly string LDEngineRootFolder = "/com.fpnn.ldengine/";
|
||||
static readonly string LDEngineFileName = "LDEngineCache";
|
||||
|
||||
internal static void Init()
|
||||
{
|
||||
persistentDataPath = Application.persistentDataPath;
|
||||
InitDirectory();
|
||||
}
|
||||
|
||||
private static void CheckDirecotry(string path)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LDEngine.ErrorLog("Create path for LDEngine failed. Path = " + path + ", exctption = " + e.ToString());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitDirectory()
|
||||
{
|
||||
string path = persistentDataPath + LDEngineRootFolder;
|
||||
try
|
||||
{
|
||||
CheckDirecotry(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LDEngine.ErrorLog("Init path for LDEngine failed. Path = " + path + ", excetption = " + e.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] LoadBinaryFile(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.ReadAllBytes(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e is FileNotFoundException)
|
||||
return null;
|
||||
|
||||
LDEngine.ErrorLog("Load binary file failed. Path = " + path + ", exception = " + e.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool SaveBinaryFile(string path, byte[] data)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(path, data);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LDEngine.ErrorLog("Save binary file failed. Path = " + path + ", exception = " + e.ToString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool DeleteFile(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(path);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SaveCacheFile(string path, Dictionary<object, object> values)
|
||||
{
|
||||
byte[] rawData;
|
||||
try
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
MsgPacker.PackDictionary(stream, values);
|
||||
rawData = stream.ToArray();
|
||||
}
|
||||
SaveBinaryFile(path, rawData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LDEngine.ErrorLog("Save cache file failed. Exception = " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
internal static Dictionary<object, object> LoadCacheFile(string path)
|
||||
{
|
||||
byte[] data = LoadBinaryFile(path);
|
||||
if (data == null)
|
||||
return null;
|
||||
try
|
||||
{
|
||||
object obj = MsgUnpacker.Unpack(data);
|
||||
if (obj is Dictionary<object, object> dict)
|
||||
return dict;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LDEngine.ErrorLog("Load cache file failed. Exception = " + e.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3b283613e103c24bb6e77accd747b25
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,507 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class LDEngine
|
||||
{
|
||||
RTMQuestProcessor processor;
|
||||
BasePushProcessor basePushProcessor;
|
||||
RTMPushProcessor rtmPushProcessor;
|
||||
IMPushProcessor imPushProcessor;
|
||||
|
||||
public void SetBasePushProcessor(BasePushProcessor processor)
|
||||
{
|
||||
if (processor == null)
|
||||
return;
|
||||
basePushProcessor = processor;
|
||||
this.processor.SessionClosedCallback = processor.SessionClosedCallback;
|
||||
this.processor.ReloginWillStartCallback = processor.ReloginWillStartCallback;
|
||||
this.processor.ReloginCompletedCallback = processor.ReloginCompletedCallback;
|
||||
this.processor.KickoutCallback = processor.KickoutCallback;
|
||||
}
|
||||
|
||||
public void SetRTMPushProcessor(RTMPushProcessor processor)
|
||||
{
|
||||
if (processor == null)
|
||||
return;
|
||||
if (imPushProcessor != null)
|
||||
{
|
||||
errorRecorder?.RecordError("imPushProcessor has been setted.");
|
||||
return;
|
||||
}
|
||||
rtmPushProcessor = processor;
|
||||
this.processor.KickoutRoomCallback = processor.KickoutRoomCallback;
|
||||
this.processor.PushMessageCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushBasicMessageCallback?.Invoke(MessageCategory.P2PMessage, message);
|
||||
};
|
||||
this.processor.PushGroupMessageCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushBasicMessageCallback?.Invoke(MessageCategory.GroupMessage, message);
|
||||
};
|
||||
this.processor.PushRoomMessageCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushBasicMessageCallback?.Invoke(MessageCategory.RoomMessage, message);
|
||||
};
|
||||
this.processor.PushBroadcastMessageCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushBasicMessageCallback?.Invoke(MessageCategory.BroadcastMessage, message);
|
||||
};
|
||||
this.processor.PushChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.P2PMessage, message);
|
||||
};
|
||||
this.processor.PushGroupChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.GroupMessage, message);
|
||||
};
|
||||
this.processor.PushRoomChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.RoomMessage, message);
|
||||
};
|
||||
this.processor.PushBroadcastChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.BroadcastMessage, message);
|
||||
};
|
||||
this.processor.PushCmdCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushCmdMessageCallback?.Invoke(MessageCategory.P2PMessage, message);
|
||||
};
|
||||
this.processor.PushGroupCmdCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushCmdMessageCallback?.Invoke(MessageCategory.GroupMessage, message);
|
||||
};
|
||||
this.processor.PushRoomCmdCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushCmdMessageCallback?.Invoke(MessageCategory.RoomMessage, message);
|
||||
};
|
||||
this.processor.PushBroadcastCmdCallback = (RTMMessage message) =>
|
||||
{
|
||||
rtmPushProcessor?.PushCmdMessageCallback?.Invoke(MessageCategory.BroadcastMessage, message);
|
||||
};
|
||||
|
||||
this.processor.PushFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
if (message.messageType == (byte)MessageType.AudioFile)
|
||||
{
|
||||
rtmPushProcessor?.PushAudioMessageCallback(MessageCategory.P2PMessage, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
rtmPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.P2PMessage, message);
|
||||
}
|
||||
};
|
||||
this.processor.PushGroupFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
if (message.messageType == (byte)MessageType.AudioFile)
|
||||
{
|
||||
rtmPushProcessor?.PushAudioMessageCallback(MessageCategory.GroupMessage, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
rtmPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.GroupMessage, message);
|
||||
}
|
||||
};
|
||||
this.processor.PushRoomFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
if (message.messageType == (byte)MessageType.AudioFile)
|
||||
{
|
||||
rtmPushProcessor?.PushAudioMessageCallback(MessageCategory.RoomMessage, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
rtmPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.RoomMessage, message);
|
||||
}
|
||||
};
|
||||
this.processor.PushBroadcastFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
if (message.messageType == (byte)MessageType.AudioFile)
|
||||
{
|
||||
rtmPushProcessor?.PushAudioMessageCallback(MessageCategory.BroadcastMessage, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
rtmPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.BroadcastMessage, message);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void SetIMPushProcessor(IMPushProcessor processor)
|
||||
{
|
||||
if (processor == null)
|
||||
return;
|
||||
if (rtmPushProcessor != null)
|
||||
{
|
||||
errorRecorder?.RecordError("rtmPushProcessor has been setted.");
|
||||
return;
|
||||
}
|
||||
imPushProcessor = processor;
|
||||
this.processor.KickoutRoomCallback = processor.KickoutRoomCallback;
|
||||
|
||||
this.processor.PushChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.P2PMessage, message);
|
||||
};
|
||||
this.processor.PushGroupChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.GroupMessage, message);
|
||||
};
|
||||
this.processor.PushRoomChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.RoomMessage, message);
|
||||
};
|
||||
this.processor.PushBroadcastChatCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushChatMessageCallback?.Invoke(MessageCategory.BroadcastMessage, message);
|
||||
};
|
||||
|
||||
this.processor.PushFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.P2PMessage, message);
|
||||
};
|
||||
this.processor.PushGroupFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.GroupMessage, message);
|
||||
};
|
||||
this.processor.PushRoomFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.RoomMessage, message);
|
||||
};
|
||||
this.processor.PushBroadcastFileCallback = (RTMMessage message) =>
|
||||
{
|
||||
imPushProcessor?.PushFileMessageCallback?.Invoke(MessageCategory.BroadcastMessage, message);
|
||||
};
|
||||
|
||||
this.processor.PushMessageCallback = (RTMMessage message) =>
|
||||
{
|
||||
if (message.messageType != (int)MessageType.SystemNotification)
|
||||
return;
|
||||
IMLIB_Push(message);
|
||||
};
|
||||
this.processor.PushGroupCmdCallback = (RTMMessage message) =>
|
||||
{
|
||||
IMLIB_GroupPush(message);
|
||||
};
|
||||
this.processor.PushRoomCmdCallback = (RTMMessage message) =>
|
||||
{
|
||||
IMLIB_RoomPush(message);
|
||||
};
|
||||
}
|
||||
|
||||
void IMLIB_Push(RTMMessage msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> attrsDict = Json.ParseObject(msg.attrs);
|
||||
if (attrsDict == null)
|
||||
return;
|
||||
|
||||
if (attrsDict.TryGetValue("type", out object type))
|
||||
{
|
||||
int messageType = Convert.ToInt32(type);
|
||||
if (messageType == (int)IMLIB_MessageType.AddFriendApply)
|
||||
{
|
||||
if (attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushAddFriendApplyCallback?.Invoke(Convert.ToInt64(from), msg.stringMessage, attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.AcceptFriendApply)
|
||||
{
|
||||
if (attrsDict.TryGetValue("userId", out object userId))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushAcceptFriendApplyCallback?.Invoke(Convert.ToInt64(userId), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.RefuseFriendApply)
|
||||
{
|
||||
if (attrsDict.TryGetValue("userId", out object userId))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRefuseFriendApplyCallback?.Invoke(Convert.ToInt64(userId), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.EnterGroupApply)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("from", out object from)
|
||||
&& attrsDict.TryGetValue("invitedUid", out object invitedUid))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushEnterGroupApplyCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(from), Convert.ToInt64(invitedUid), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.AcceptEnterGroupApply)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushAcceptEnterGroupApplyCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(from), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.RefuseEnterGroupApply)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRefuseEnterGroupApplyCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(from), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.InvitedIntoGroup)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushInvitedIntoGroupCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(from), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.AcceptInvitedIntoGroup)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushAccpetInvitedIntoGroupCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(from), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.RefuseInvitedIntoGroup)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRefuseInvitedIntoGroupCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(from), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.FriendChanged)
|
||||
{
|
||||
if (attrsDict.TryGetValue("userId", out object userId)
|
||||
&& attrsDict.TryGetValue("changeType", out object changeType))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushFriendChangedCallback?.Invoke(Convert.ToInt64(userId), Convert.ToInt32(changeType), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.GroupChanged)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("changeType", out object changeType))
|
||||
{
|
||||
bool hasAttrs = attrsDict.TryGetValue("custom", out object attrs);
|
||||
string attrsStr = hasAttrs ? Convert.ToString(attrs) : null;
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushGroupChangedCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt32(changeType), attrsStr);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
errorRecorder?.RecordError("Parse message attrs error. Full msg: " + msg.attrs, e);
|
||||
}
|
||||
}
|
||||
|
||||
void IMLIB_GroupPush(RTMMessage msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> attrsDict = Json.ParseObject(msg.attrs);
|
||||
if (attrsDict == null)
|
||||
return;
|
||||
|
||||
if (attrsDict.TryGetValue("type", out object type))
|
||||
{
|
||||
int messageType = Convert.ToInt32(type);
|
||||
if (messageType == (int)IMLIB_MessageType.GroupMemberChanged)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("changeType", out object changeType)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushGroupMemberChangedCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt32(changeType), Convert.ToInt64(from));
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.AddGroupManagers)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("managers", out object managers))
|
||||
{
|
||||
List<long> managerList = new List<long>();
|
||||
List<object> originalList = (List<object>)managers;
|
||||
foreach (object obj in originalList)
|
||||
managerList.Add((long)Convert.ChangeType(obj, TypeCode.Int64));
|
||||
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushGroupManagerChangedCallback?.Invoke(Convert.ToInt64(groupId), 0, managerList);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.RemoveGroupManagers)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("managers", out object managers))
|
||||
{
|
||||
List<long> managerList = new List<long>();
|
||||
List<object> originalList = (List<object>)managers;
|
||||
foreach (object obj in originalList)
|
||||
managerList.Add((long)Convert.ChangeType(obj, TypeCode.Int64));
|
||||
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushGroupManagerChangedCallback?.Invoke(Convert.ToInt64(groupId), 1, managerList);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.GroupOwnerChanged)
|
||||
{
|
||||
if (attrsDict.TryGetValue("groupId", out object groupId)
|
||||
&& attrsDict.TryGetValue("oldOwner", out object oldOwner)
|
||||
&& attrsDict.TryGetValue("newOwner", out object newOwner))
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushGroupOwnerChangedCallback?.Invoke(Convert.ToInt64(groupId), Convert.ToInt64(oldOwner), Convert.ToInt64(newOwner));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
errorRecorder?.RecordError("Parse message attrs error. Full msg: " + msg.attrs, e);
|
||||
}
|
||||
}
|
||||
|
||||
void IMLIB_RoomPush(RTMMessage msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> attrsDict = Json.ParseObject(msg.attrs);
|
||||
if (attrsDict == null)
|
||||
return;
|
||||
|
||||
if (attrsDict.TryGetValue("type", out object type))
|
||||
{
|
||||
int messageType = Convert.ToInt32(type);
|
||||
if (messageType == (int)IMLIB_MessageType.RoomMemberChanged)
|
||||
{
|
||||
if (attrsDict.TryGetValue("roomId", out object roomId)
|
||||
&& attrsDict.TryGetValue("changeType", out object changeType)
|
||||
&& attrsDict.TryGetValue("from", out object from))
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRoomMemberChangedCallback?.Invoke(Convert.ToInt64(roomId), Convert.ToInt32(changeType), Convert.ToInt64(from));
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.AddRoomManagers)
|
||||
{
|
||||
if (attrsDict.TryGetValue("roomId", out object roomId)
|
||||
&& attrsDict.TryGetValue("managers", out object managers))
|
||||
{
|
||||
List<long> managerList = new List<long>();
|
||||
List<object> originalList = (List<object>)managers;
|
||||
foreach (object obj in originalList)
|
||||
managerList.Add((long)Convert.ChangeType(obj, TypeCode.Int64));
|
||||
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRoomManagerChangedCallback?.Invoke(Convert.ToInt64(roomId), 0, managerList);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.RemoveGroupManagers)
|
||||
{
|
||||
if (attrsDict.TryGetValue("roomId", out object roomId)
|
||||
&& attrsDict.TryGetValue("managers", out object managers))
|
||||
{
|
||||
List<long> managerList = new List<long>();
|
||||
List<object> originalList = (List<object>)managers;
|
||||
foreach (object obj in originalList)
|
||||
managerList.Add((long)Convert.ChangeType(obj, TypeCode.Int64));
|
||||
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRoomManagerChangedCallback?.Invoke(Convert.ToInt64(roomId), 1, managerList);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (messageType == (int)IMLIB_MessageType.RoomOwnerChanged)
|
||||
{
|
||||
if (attrsDict.TryGetValue("roomId", out object roomId)
|
||||
&& attrsDict.TryGetValue("oldOwner", out object oldOwner)
|
||||
&& attrsDict.TryGetValue("newOwner", out object newOwner))
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
imPushProcessor?.IMLIB_PushRoomOwnerChangedCallback?.Invoke(Convert.ToInt64(roomId), Convert.ToInt64(oldOwner), Convert.ToInt64(newOwner));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
errorRecorder?.RecordError("Parse message attrs error. Full msg: " + msg.attrs, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf5adf1d1d6d03d40a26b5a4529d720a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public class LDEngineConfig
|
||||
{
|
||||
//readonly public static string RTMEndpoint_NX = "rtm-nx-front.ilivedata.com:13321";
|
||||
readonly public static string RTMEndpoint_NX = "161.189.171.91:13321";
|
||||
//readonly public static string RTCEndpoint_NX = "rtc-nx-front.ilivedata.com:13702";
|
||||
readonly public static string RTCEndpoint_NX = "161.189.171.91:13702";
|
||||
readonly public static string RTMEndpoint_INTL = "rtm-intl-frontgate.ilivedata.com:13321";
|
||||
readonly public static string RTCEndpoint_INTL = "rtc-intl-frontgate.ilivedata.com:13702";
|
||||
}
|
||||
|
||||
public enum RTMENDPOINT
|
||||
{
|
||||
RTMENDPOINT_NX,
|
||||
RTMENDPOINT_INTL,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66194afd0d6b3d84084f57165d7830c5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public class BasePushProcessor
|
||||
{
|
||||
public SessionClosedDelegate SessionClosedCallback;
|
||||
public ReloginWillStartDelegate ReloginWillStartCallback;
|
||||
public ReloginCompletedDelegate ReloginCompletedCallback;
|
||||
public KickOutDelegate KickoutCallback;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1eb48c237ec2452488f90dca156f480f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public class IMPushProcessor
|
||||
{
|
||||
public KickoutRoomDelegate KickoutRoomCallback;
|
||||
|
||||
public RTMPushMessageDelegate PushChatMessageCallback;
|
||||
public RTMPushMessageDelegate PushFileMessageCallback;
|
||||
|
||||
//-- IMLIB Friend
|
||||
public IMLIB_PushFriendChangedDelegate IMLIB_PushFriendChangedCallback;
|
||||
public IMLIB_PushAddFriendApplyDelegate IMLIB_PushAddFriendApplyCallback;
|
||||
public IMLIB_PushAcceptFriendApplyDelegate IMLIB_PushAcceptFriendApplyCallback;
|
||||
public IMLIB_PushRefuseFriendApplyDelegate IMLIB_PushRefuseFriendApplyCallback;
|
||||
|
||||
//-- IMLIB Group
|
||||
public IMLIB_PushEnterGroupApplyDelegate IMLIB_PushEnterGroupApplyCallback;
|
||||
public IMLIB_PushAcceptEnterGroupApplyDelegate IMLIB_PushAcceptEnterGroupApplyCallback;
|
||||
public IMLIB_PushRefuseEnterGroupApplyDelegate IMLIB_PushRefuseEnterGroupApplyCallback;
|
||||
public IMLIB_PushInvitedIntoGroupDelegate IMLIB_PushInvitedIntoGroupCallback;
|
||||
public IMLIB_PushAccpetInvitedIntoGroupDelegate IMLIB_PushAccpetInvitedIntoGroupCallback;
|
||||
public IMLIB_PushRefuseInvitedIntoGroupDelegate IMLIB_PushRefuseInvitedIntoGroupCallback;
|
||||
public IMLIB_PushGroupChangedDelegate IMLIB_PushGroupChangedCallback;
|
||||
public IMLIB_PushGroupMemberChangedDelegate IMLIB_PushGroupMemberChangedCallback;
|
||||
public IMLIB_PushGroupOwnerChangedDelegate IMLIB_PushGroupOwnerChangedCallback;
|
||||
public IMLIB_PushGroupManagerChangedDelegate IMLIB_PushGroupManagerChangedCallback;
|
||||
|
||||
//-- IMLIB Room
|
||||
public IMLIB_PushEnterRoomApplyDelegate IMLIB_PushEnterRoomApplyCallback;
|
||||
public IMLIB_PushAcceptEnterRoomApplyDelegate IMLIB_PushAcceptEnterRoomApplyCallback;
|
||||
public IMLIB_PushRefuseEnterRoomApplyDelegate IMLIB_PushRefuseEnterRoomApplyCallback;
|
||||
public IMLIB_PushInvitedIntoRoomDelegate IMLIB_PushInvitedIntoRoomCallback;
|
||||
public IMLIB_PushAccpetInvitedIntoRoomDelegate IMLIB_PushAccpetInvitedIntoRoomCallback;
|
||||
public IMLIB_PushRefuseInvitedIntoRoomDelegate IMLIB_PushRefuseInvitedIntoRoomCallback;
|
||||
public IMLIB_PushRoomChangedDelegate IMLIB_PushRoomChangedCallback;
|
||||
public IMLIB_PushRoomMemberChangedDelegate IMLIB_PushRoomMemberChangedCallback;
|
||||
public IMLIB_PushRoomOwnerChangedDelegate IMLIB_PushRoomOwnerChangedCallback;
|
||||
public IMLIB_PushRoomManagerChangedDelegate IMLIB_PushRoomManagerChangedCallback;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 696f31a8105a1314e90eeb4029b2c486
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public delegate void RTMPushMessageDelegate(MessageCategory messageCategory, RTMMessage message);
|
||||
public class RTMPushProcessor
|
||||
{
|
||||
public KickoutRoomDelegate KickoutRoomCallback;
|
||||
|
||||
public RTMPushMessageDelegate PushBasicMessageCallback;
|
||||
public RTMPushMessageDelegate PushChatMessageCallback;
|
||||
public RTMPushMessageDelegate PushCmdMessageCallback;
|
||||
public RTMPushMessageDelegate PushFileMessageCallback;
|
||||
public RTMPushMessageDelegate PushAudioMessageCallback;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 229bdc9e47671a249b471333975e6903
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,222 @@
|
||||
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 SendChatMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, string message, string attrs = "", int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendChat((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupChat((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomChat((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendCMDMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, string message, string attrs = "", int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendCmd((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupCmd((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomCmd((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, message, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetMessage(Action<RetrievedMessage, int> callback, MessageCategory messageCategory, long fromUid, long toId, long messageId, int timeout = 0)
|
||||
{
|
||||
return client.GetMessage((RetrievedMessage message, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(message, errorCode);
|
||||
});
|
||||
}, fromUid, toId, messageId, messageCategory, timeout);
|
||||
}
|
||||
|
||||
public bool DeleteMessage(DoneDelegate callback, MessageCategory messageCategory, long fromUid, long toId, long messageId, int timeout = 0)
|
||||
{
|
||||
return client.DeleteMessage((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, fromUid, toId, messageId, messageCategory, timeout);
|
||||
}
|
||||
|
||||
public bool GetHitoryChatMessage(HistoryMessageDelegate callback, MessageCategory messageCategory, long id, bool desc, int count, long beginMsec = 0, long endMsec = 0, long lastId = 0, int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.GetP2PMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, new List<byte>((byte)MessageType.Chat), timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.GetGroupMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, new List<byte>((byte)MessageType.Chat), timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.GetRoomMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, new List<byte>((byte)MessageType.Chat), timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.BroadcastMessage)
|
||||
{
|
||||
return client.GetBroadcastMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, desc, count, beginMsec, endMsec, lastId, new List<byte>((byte)MessageType.Chat), timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, 0, 0, 0, null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetHitoryChatMessageByMessageId(HistoryMessageDelegate callback, MessageCategory messageCategory, long id, bool desc, int count, long messageId, long beginMsec = 0, long endMsec = 0, List<byte> mtypes = null, int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.GetP2PMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, messageId, beginMsec, endMsec, mtypes, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.GetGroupMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, messageId, beginMsec, endMsec, mtypes, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.GetRoomMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, messageId, beginMsec, endMsec, mtypes, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.BroadcastMessage)
|
||||
{
|
||||
return client.GetBroadcastMessageByMessageId((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, desc, count, messageId, beginMsec, endMsec, mtypes, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, 0, 0, 0, null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a1a9cd4fde351e47a0d211cb6e90cb7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
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 GetConversation(Action<List<Conversation>, int> callback, ConversationType conversationType, HashSet<byte> mTypes = null, long startTime = 0, int timeout = 0)
|
||||
{
|
||||
if (conversationType == ConversationType.P2P)
|
||||
{
|
||||
return client.GetP2PConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else if (conversationType == ConversationType.GROUP)
|
||||
{
|
||||
return client.GetGroupConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetAllUnreadConversation(Action<List<Conversation>, List<Conversation>, int> callback, bool clear = true, HashSet<byte> mTypes = null, long startTime = 0, int timeout = 0)
|
||||
{
|
||||
return client.GetUnreadConversationList((List<Conversation> groupConversationList, List<Conversation> p2pConversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(groupConversationList, p2pConversationList, errorCode);
|
||||
});
|
||||
}, clear, mTypes, startTime, timeout);
|
||||
}
|
||||
|
||||
public bool GetUnreadConversation(Action<List<Conversation>, int> callback, ConversationType conversationType, HashSet<byte> mTypes = null, long startTime = 0, int timeout = 0)
|
||||
{
|
||||
if (conversationType == ConversationType.P2P)
|
||||
{
|
||||
return client.GetP2PUnreadConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else if (conversationType == ConversationType.GROUP)
|
||||
{
|
||||
return client.GetGroupUnreadConversationList((List<Conversation> conversationList, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(conversationList, errorCode);
|
||||
});
|
||||
}, mTypes, startTime, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ClearUnread(DoneDelegate callback, int timeout = 0)
|
||||
{
|
||||
return client.ClearUnread((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool RemoveP2PConversation(DoneDelegate callback, long uid, bool oneway = false, int timeout = 0)
|
||||
{
|
||||
return client.RemoveSession((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uid, oneway, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 767b49128c56d794fa42f772c702231a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public delegate void GetFriendListDelegate(HashSet<long> friendList, int errorCode);
|
||||
public delegate void GetBlackListDelegate(HashSet<long> blackList, int errorCode);
|
||||
|
||||
public delegate void GetDevicePushOptionDelegate(DevicePushOption option, int errorCode);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ecb4f9aed657b7a4d8b07a5f3c094950
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,106 @@
|
||||
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 SendFile(MessageIdDelegate callback, MessageCategory messageCategory, long id, MessageType type, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, type, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, type, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, type, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendAudioMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, RTMAudioData audioData, string attrs = "", int timeout = 120)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, audioData, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, audioData, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendRoomFile((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, audioData, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool UploadFile(Action<string, uint, int> callback, MessageType type, byte[] fileContent, string filename, string fileExtension = "", string attrs = "", int timeout = 120)
|
||||
{
|
||||
return client.UploadFile((string url, uint size, int errorCode) => {
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(url, size, errorCode);
|
||||
});
|
||||
}, type, fileContent, filename, fileExtension, attrs, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d800f9a77daa1549b20a5be263a3269
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,78 @@
|
||||
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 AddFriends(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.AddFriends((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool DeleteFriends(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.DeleteFriends((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetFriends(Action<HashSet<long>, int> callback, int timeout = 0)
|
||||
{
|
||||
return client.GetFriends((HashSet<long> uids, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(uids, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool AddBlacklist(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.AddBlacklist((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool DeleteBlacklist(DoneDelegate callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.DeleteBlacklist((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetBlacklist(Action<HashSet<long>, int> callback, int timeout = 0)
|
||||
{
|
||||
return client.GetBlacklist((HashSet<long> uids, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(uids, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6837ea3221fc752448c19a2cac50dc0a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,113 @@
|
||||
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<int, int> 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<long>, HashSet<long>, int> callback, long groupId, bool online = true, int timeout = 0)
|
||||
{
|
||||
if (online)
|
||||
{
|
||||
return client.GetGroupMembers((HashSet<long> members, HashSet<long> onlineMembers, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(members, onlineMembers, errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
return client.GetGroupMembers((HashSet<long> members, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(members, null, errorCode);
|
||||
});
|
||||
}, groupId, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
public bool AddGroupMembers(DoneDelegate callback, long groupId, HashSet<long> 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<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.DeleteGroupMembers((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, groupId, uids, timeout);
|
||||
}
|
||||
|
||||
public bool GetGroupInfo(Action<string, string, int> 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<Dictionary<long, string>, int> callback, HashSet<long> groupIds, int timeout = 0)
|
||||
{
|
||||
return client.GetGroupsPublicInfo((Dictionary<long, string> 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<HashSet<long>, int> callback, int timeout = 0)
|
||||
{
|
||||
return client.GetUserGroups((HashSet<long> groupIds, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(groupIds, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ecb88a920fedbe4b8c70eab4c2797cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,147 @@
|
||||
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 SendBasicMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte mtype, string message, string attrs = "", int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendMessage((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, mtype, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupMessage((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, mtype, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendGroupMessage((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, mtype, message, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SendBinaryMessage(MessageIdDelegate callback, MessageCategory messageCategory, long id, byte mtype, byte[] message, string attrs = "", int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.SendMessage((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, mtype, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.SendGroupMessage((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, mtype, message, attrs, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.SendGroupMessage((long messageId, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(messageId, errorCode);
|
||||
});
|
||||
}, id, mtype, message, attrs, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetHitoryBasicMessage(HistoryMessageDelegate callback, MessageCategory messageCategory, long id, bool desc, int count, long beginMsec = 0, long endMsec = 0, long lastId = 0, List<byte> mtypes = null, int timeout = 0)
|
||||
{
|
||||
if (messageCategory == MessageCategory.P2PMessage)
|
||||
{
|
||||
return client.GetP2PMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, mtypes, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.GroupMessage)
|
||||
{
|
||||
return client.GetGroupMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, mtypes, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.RoomMessage)
|
||||
{
|
||||
return client.GetRoomMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, id, desc, count, beginMsec, endMsec, lastId, mtypes, timeout);
|
||||
}
|
||||
else if (messageCategory == MessageCategory.BroadcastMessage)
|
||||
{
|
||||
return client.GetBroadcastMessage((int count, long lastCursorId, long beginMsec, long endMsec, List<HistoryMessage> messages, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(count, lastCursorId, beginMsec, endMsec, messages, errorCode);
|
||||
});
|
||||
}, desc, count, beginMsec, endMsec, lastId, mtypes, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(0, 0, 0, 0, null, rtm.ErrorCode.RTM_EC_INVALID_PARAMETER);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31bf59e70da800d44bf63e6ec379641d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,100 @@
|
||||
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 EnterRoom(DoneDelegate callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.EnterRoom((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool LeaveRoom(DoneDelegate callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.LeaveRoom((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomMembers(Action<HashSet<long>, int> callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.GetRoomMembers((HashSet<long> uids, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(uids, errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomMemberCount(Action<Dictionary<long, int>, int> callback, HashSet<long> roomIds, int timeout = 0)
|
||||
{
|
||||
return client.GetRoomMemberCount((Dictionary<long, int> roomMemberCountDict, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(roomMemberCountDict, errorCode);
|
||||
});
|
||||
}, roomIds, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomInfo(Action<string, string, int> callback, long roomId, int timeout = 0)
|
||||
{
|
||||
return client.GetRoomInfo((string publicInfo, string privateInfo, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(publicInfo, privateInfo, errorCode);
|
||||
});
|
||||
}, roomId, timeout);
|
||||
}
|
||||
|
||||
public bool GetRoomsPublicInfo(Action<Dictionary<long, string>, int> callback, HashSet<long> roomIds, int timeout = 0)
|
||||
{
|
||||
return client.GetRoomsPublicInfo((Dictionary<long, string> publicInfos, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(publicInfos, errorCode);
|
||||
});
|
||||
}, roomIds, timeout);
|
||||
}
|
||||
|
||||
public bool SetRoomInfo(DoneDelegate callback, long roomId, string publicInfo = null, string privateInfo = null, int timeout = 0)
|
||||
{
|
||||
return client.SetRoomInfo((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, roomId, publicInfo, privateInfo, timeout);
|
||||
}
|
||||
|
||||
public bool GetUserRooms(Action<HashSet<long>, int> callback, int timeout = 0)
|
||||
{
|
||||
return client.GetUserRooms((HashSet<long> roomIds, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(roomIds, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1e3021d4184dca4d844af546c73f708
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public class DevicePushOption
|
||||
{
|
||||
public Dictionary<long, HashSet<byte>> p2p;
|
||||
public Dictionary<long, HashSet<byte>> group;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9be0e3dc49f5a1c45976eb9d66cf76c7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,100 @@
|
||||
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<byte> 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<byte> mTypes = null, int timeout = 0)
|
||||
{
|
||||
return client.RemoveDevicePushOption((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, messageCategory, targetId, mTypes, timeout);
|
||||
}
|
||||
|
||||
public bool GetDevicePushOption(Action<Dictionary<long, HashSet<byte>>, Dictionary<long, HashSet<byte>>, int> callback, int timeout = 0)
|
||||
{
|
||||
return client.GetDevicePushOption((Dictionary<long, HashSet<byte>> p2p, Dictionary<long, HashSet<byte>> group, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(p2p, group, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool DataGet(Action<string, int> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c4f192948cf5f24080e062a86a4447e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,56 @@
|
||||
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 GetUserInfo(Action<string, string, int> callback, int timeout = 0)
|
||||
{
|
||||
return client.GetUserInfo((string publicInfo, string privateInfo, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(publicInfo, privateInfo, errorCode);
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
public bool GetUsersPublicInfo(Action<Dictionary<long, string>, int> callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.GetUserPublicInfo((Dictionary<long, string> userInfoDict, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(userInfoDict, errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
|
||||
public bool SetUserInfo(DoneDelegate callback, string publicInfo = null, string privateInfo = null, int timeout = 0)
|
||||
{
|
||||
return client.SetUserInfo((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, publicInfo, privateInfo, timeout);
|
||||
}
|
||||
|
||||
public bool GetUsersOnlineStatus(Action<HashSet<long>, int> callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
return client.GetOnlineUsers((HashSet<long> onlineUids, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(onlineUids, errorCode);
|
||||
});
|
||||
}, uids, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 698baad5f967ad64ea85c0260d10712a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.common;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class RTM
|
||||
{
|
||||
RTMClient client;
|
||||
|
||||
public RTM(in RTMClient client)
|
||||
{
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public bool Login(AuthDelegate callback, string token, int timeout = 0)
|
||||
{
|
||||
return client.Login((long projectId, long uid, bool successful, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(projectId, uid, successful, errorCode);
|
||||
});
|
||||
}, token, timeout);
|
||||
}
|
||||
|
||||
public bool LoginV2(AuthDelegate callback, string token, long ts, int timeout = 0)
|
||||
{
|
||||
return client.Login((long projectId, long uid, bool successful, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(projectId, uid, successful, errorCode);
|
||||
});
|
||||
}, token, ts, timeout);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd15e87539935e24bac09fff3fb9875f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 842f3d4df075b544491bfb29d4d27df7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,426 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using com.fpnn.livedata;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using com.fpnn.proto;
|
||||
|
||||
namespace com.fpnn.rtm
|
||||
{
|
||||
public partial class RTMClient
|
||||
{
|
||||
//===========================[ IMLIB_AddFriend ]=========================//
|
||||
public bool IMLIB_AddFriend(DoneDelegate callback, long uid, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_addfriend");
|
||||
quest.Param("ouid", uid);
|
||||
if (extra != null)
|
||||
quest.Param("extra", extra);
|
||||
if (attrs != null)
|
||||
quest.Param("attrs", attrs);
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
callback(errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_AddFriend(long uid, string extra = null, string attrs = null, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_addfriend");
|
||||
quest.Param("ouid", uid);
|
||||
if (extra != null)
|
||||
quest.Param("extra", extra);
|
||||
if (attrs != null)
|
||||
quest.Param("attrs", attrs);
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
return answer.ErrorCode();
|
||||
}
|
||||
|
||||
//===========================[ IMLIB_AckAddFriend ]=========================//
|
||||
public bool IMLIB_AckAddFriend(DoneDelegate callback, long uid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_ackaddfriend");
|
||||
quest.Param("ouid", uid);
|
||||
quest.Param("agree", agree);
|
||||
if (attrs != null)
|
||||
quest.Param("attrs", attrs);
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
callback(errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_AckAddFriend(long uid, bool agree, string attrs = null, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_ackaddfriend");
|
||||
quest.Param("ouid", uid);
|
||||
quest.Param("agree", agree);
|
||||
if (attrs != null)
|
||||
quest.Param("attrs", attrs);
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
return answer.ErrorCode();
|
||||
}
|
||||
|
||||
//===========================[ IMLIB_SetFriendAlias ]=========================//
|
||||
public bool IMLIB_SetFriendAlias(DoneDelegate callback, long uid, string alias, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_setfriendalias");
|
||||
quest.Param("target_uid", uid);
|
||||
quest.Param("alias", alias);
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
callback(errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_SetFriendAlias(long uid, string alias, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_setfriendalias");
|
||||
quest.Param("target_uid", uid);
|
||||
quest.Param("alias", alias);
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
return answer.ErrorCode();
|
||||
}
|
||||
|
||||
//===========================[ IMLIB_GetFriendAlias ]=========================//
|
||||
public bool IMLIB_GetFriendAlias(Action<string, int> callback, long uid, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_getfriendalias");
|
||||
quest.Param("target_uid", uid);
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
string val = null;
|
||||
if (errorCode == fpnn.ErrorCode.FPNN_EC_OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
val = answer.Want<string>("val");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
errorCode = fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
callback(val, errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_GetFriendAlias(out string alias, long uid, int timeout = 0)
|
||||
{
|
||||
alias = null;
|
||||
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_getfriendalias");
|
||||
quest.Param("target_uid", uid);
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
|
||||
if (answer.IsException())
|
||||
return answer.ErrorCode();
|
||||
|
||||
try
|
||||
{
|
||||
alias = answer.Want<string>("val");
|
||||
return fpnn.ErrorCode.FPNN_EC_OK;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================[ IMLIB_GetFriendApplyList ]=========================//
|
||||
public bool IMLIB_GetFriendApplyList(Action<List<IMLIB_FriendApply>, int> callback, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_getfriendapplylist");
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
List<IMLIB_FriendApply> applyList = new List<IMLIB_FriendApply>();
|
||||
if (errorCode == fpnn.ErrorCode.FPNN_EC_OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<long> fromUid = GetLongList(answer, "fromUid");
|
||||
List<int> status = GetIntList(answer, "status");
|
||||
List<string> grantExtra = GetStringList(answer, "grantExtra");
|
||||
List<long> createTime = GetLongList(answer, "createTime");
|
||||
List<string> attrs = GetStringList(answer, "attrs");
|
||||
for (int i = 0; i < fromUid.Count && i < status.Count && i < grantExtra.Count && i < createTime.Count && i < attrs.Count; ++i)
|
||||
{
|
||||
IMLIB_FriendApply friendApply = new IMLIB_FriendApply();
|
||||
friendApply.uid = fromUid[i];
|
||||
friendApply.status = status[i];
|
||||
friendApply.extra = grantExtra[i];
|
||||
friendApply.createTime = createTime[i];
|
||||
friendApply.attrs = attrs[i];
|
||||
applyList.Add(friendApply);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
errorCode = fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
callback(applyList, errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_GetFriendApplyList(out List<IMLIB_FriendApply> applyList, int timeout = 0)
|
||||
{
|
||||
applyList = new List<IMLIB_FriendApply>();
|
||||
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_getfriendapplylist");
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
|
||||
if (answer.IsException())
|
||||
return answer.ErrorCode();
|
||||
|
||||
try
|
||||
{
|
||||
List<long> fromUid = GetLongList(answer, "fromUid");
|
||||
List<int> status = GetIntList(answer, "status");
|
||||
List<string> grantExtra = GetStringList(answer, "grantExtra");
|
||||
List<long> createTime = GetLongList(answer, "createTime");
|
||||
List<string> attrs = GetStringList(answer, "attrs");
|
||||
for (int i = 0; i < fromUid.Count && i < status.Count && i < grantExtra.Count && i < createTime.Count && i < attrs.Count; ++i)
|
||||
{
|
||||
IMLIB_FriendApply friendApply = new IMLIB_FriendApply();
|
||||
friendApply.uid = fromUid[i];
|
||||
friendApply.status = status[i];
|
||||
friendApply.extra = grantExtra[i];
|
||||
friendApply.createTime = createTime[i];
|
||||
friendApply.attrs = attrs[i];
|
||||
applyList.Add(friendApply);
|
||||
}
|
||||
return fpnn.ErrorCode.FPNN_EC_OK;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================[ IMLIB_GetFriendRequestList ]=========================//
|
||||
public bool IMLIB_GetFriendRequestList(Action<List<IMLIB_FriendRequest>, int> callback, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_getfriendrequestlist");
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
List<IMLIB_FriendRequest> requestList = new List<IMLIB_FriendRequest>();
|
||||
if (errorCode == fpnn.ErrorCode.FPNN_EC_OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<long> targetXid = GetLongList(answer, "targetXid");
|
||||
List<long> createTime = GetLongList(answer, "createTime");
|
||||
List<string> attrs = GetStringList(answer, "attrs");
|
||||
for (int i = 0; i < targetXid.Count && i < createTime.Count && i < attrs.Count; ++i)
|
||||
{
|
||||
IMLIB_FriendRequest friendRequest = new IMLIB_FriendRequest();
|
||||
friendRequest.uid = targetXid[i];
|
||||
friendRequest.createTime = createTime[i];
|
||||
friendRequest.attrs = attrs[i];
|
||||
requestList.Add(friendRequest);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
errorCode = fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
callback(requestList, errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_GetFriendRequestList(out List<IMLIB_FriendRequest> requestList, int timeout = 0)
|
||||
{
|
||||
requestList = new List<IMLIB_FriendRequest>();
|
||||
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_getfriendrequestlist");
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
|
||||
if (answer.IsException())
|
||||
return answer.ErrorCode();
|
||||
|
||||
try
|
||||
{
|
||||
List<long> targetXid = GetLongList(answer, "targetXid");
|
||||
List<long> createTime = GetLongList(answer, "createTime");
|
||||
List<string> attrs = GetStringList(answer, "attrs");
|
||||
for (int i = 0; i < targetXid.Count && i < createTime.Count && i < attrs.Count; ++i)
|
||||
{
|
||||
IMLIB_FriendRequest friendRequest = new IMLIB_FriendRequest();
|
||||
friendRequest.uid = targetXid[i];
|
||||
friendRequest.createTime = createTime[i];
|
||||
friendRequest.attrs = attrs[i];
|
||||
requestList.Add(friendRequest);
|
||||
}
|
||||
return fpnn.ErrorCode.FPNN_EC_OK;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a87a81a17c23f74280b3a827382bc60
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b45f71c7818dcae409fe51a67379e19c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,208 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using com.fpnn.livedata;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using com.fpnn.proto;
|
||||
|
||||
namespace com.fpnn.rtm
|
||||
{
|
||||
public partial class RTMClient
|
||||
{
|
||||
//===========================[ IMLIB_GetUserInfos ]=========================//
|
||||
public bool IMLIB_GetUserInfos(Action<List<IMLIB_UserInfo>, int> callback, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_getuserinfos");
|
||||
quest.Param("uids", uids);
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
|
||||
List<IMLIB_UserInfo> infos = null;
|
||||
|
||||
if (errorCode == fpnn.ErrorCode.FPNN_EC_OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
infos = new List<IMLIB_UserInfo>();
|
||||
List<long> uids = GetLongList(answer, "uid");
|
||||
List<string> names = GetStringList(answer, "name");
|
||||
List<string> portraitUrls = GetStringList(answer, "portraitUrl");
|
||||
List<string> profiles = GetStringList(answer, "profile");
|
||||
List<string> attrs = GetStringList(answer, "attrs");
|
||||
List<int> applyGrants = GetIntList(answer, "applyGrant");
|
||||
for (int i = 0; i < uids.Count && i < names.Count && i < portraitUrls.Count && i < profiles.Count && i < attrs.Count && i < applyGrants.Count; ++i)
|
||||
{
|
||||
IMLIB_UserInfo info = new IMLIB_UserInfo();
|
||||
info.uid = uids[i];
|
||||
info.name = names[i];
|
||||
info.portraitUrl = portraitUrls[i];
|
||||
info.profile = profiles[i];
|
||||
info.attrs = attrs[i];
|
||||
info.applyGrant = (IMLIB_ApplyGrant)applyGrants[i];
|
||||
infos.Add(info);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
errorCode = fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
callback(infos, errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_GetUserInfos(out List<IMLIB_UserInfo> infos, HashSet<long> uids, int timeout = 0)
|
||||
{
|
||||
infos = null;
|
||||
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_getuserinfos");
|
||||
quest.Param("uids", uids);
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
|
||||
if (answer.IsException())
|
||||
return answer.ErrorCode();
|
||||
|
||||
try
|
||||
{
|
||||
infos = new List<IMLIB_UserInfo>();
|
||||
List<long> uid = GetLongList(answer, "uid");
|
||||
List<string> names = GetStringList(answer, "name");
|
||||
List<string> portraitUrls = GetStringList(answer, "portraitUrl");
|
||||
List<string> profiles = GetStringList(answer, "profile");
|
||||
List<string> attrs = GetStringList(answer, "attrs");
|
||||
List<int> applyGrants = GetIntList(answer, "applyGrant");
|
||||
for (int i = 0; i < uid.Count && i < names.Count && i < portraitUrls.Count && i < profiles.Count && i < attrs.Count && i < applyGrants.Count; ++i)
|
||||
{
|
||||
IMLIB_UserInfo info = new IMLIB_UserInfo();
|
||||
info.uid = uid[i];
|
||||
info.name = names[i];
|
||||
info.portraitUrl = portraitUrls[i];
|
||||
info.profile = profiles[i];
|
||||
info.attrs = attrs[i];
|
||||
info.applyGrant = (IMLIB_ApplyGrant)applyGrants[i];
|
||||
infos.Add(info);
|
||||
}
|
||||
return fpnn.ErrorCode.FPNN_EC_OK;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================[ IMLIB_GetUserInfo ]=========================//
|
||||
public bool IMLIB_GetUserInfo(Action<IMLIB_UserInfo, int> callback, long uid, int timeout = 0)
|
||||
{
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
{
|
||||
if (RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Quest quest = new Quest("imclient_getuserinfo");
|
||||
quest.Param("other_uid", uid);
|
||||
|
||||
bool asyncStarted = client.SendQuest(quest, (Answer answer, int errorCode) =>
|
||||
{
|
||||
IMLIB_UserInfo info = null;
|
||||
|
||||
if (errorCode == fpnn.ErrorCode.FPNN_EC_OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
info = new IMLIB_UserInfo();
|
||||
info.uid = uid;
|
||||
info.name = answer.Want<string>("name");
|
||||
info.portraitUrl = answer.Want<string>("portraitUrl");
|
||||
info.profile = answer.Want<string>("profile");
|
||||
info.attrs = answer.Want<string>("attrs");
|
||||
info.applyGrant = (IMLIB_ApplyGrant)(answer.Want<int>("applyGrant"));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
errorCode = fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
callback(info, errorCode);
|
||||
}, timeout);
|
||||
|
||||
|
||||
if (!asyncStarted && RTMConfig.triggerCallbackIfAsyncMethodReturnFalse)
|
||||
ClientEngine.RunTask(() =>
|
||||
{
|
||||
callback(null, fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION);
|
||||
});
|
||||
|
||||
return asyncStarted;
|
||||
}
|
||||
|
||||
public int IMLIB_GetUserInfo(out IMLIB_UserInfo info, long uid, int timeout = 0)
|
||||
{
|
||||
info = null;
|
||||
|
||||
TCPClient client = GetCoreClient();
|
||||
if (client == null)
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_CONNECTION;
|
||||
|
||||
Quest quest = new Quest("imclient_getuserinfo");
|
||||
quest.Param("other_uid", uid);
|
||||
|
||||
Answer answer = client.SendQuest(quest, timeout);
|
||||
|
||||
if (answer.IsException())
|
||||
return answer.ErrorCode();
|
||||
|
||||
try
|
||||
{
|
||||
info = new IMLIB_UserInfo();
|
||||
info.uid = uid;
|
||||
info.name = answer.Want<string>("name");
|
||||
info.portraitUrl = answer.Want<string>("portraitUrl");
|
||||
info.profile = answer.Want<string>("profile");
|
||||
info.attrs = answer.Want<string>("attrs");
|
||||
info.applyGrant = (IMLIB_ApplyGrant)(answer.Want<int>("applyGrant"));
|
||||
return fpnn.ErrorCode.FPNN_EC_OK;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return fpnn.ErrorCode.FPNN_EC_CORE_INVALID_PACKAGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2032554247f960439c5db97af5c0dec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df886620a86dd2a468d2893ebff298fb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using com.fpnn.rtm;
|
||||
using UnityEngine;
|
||||
using static com.fpnn.rtm.RTMClient;
|
||||
|
||||
namespace com.fpnn.livedata
|
||||
{
|
||||
public partial class ValueAdded
|
||||
{
|
||||
RTMClient client;
|
||||
public ValueAdded(in RTMClient client)
|
||||
{
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public bool SetUserLanguage(DoneDelegate callback, TranslateLanguage language, int timeout = 0)
|
||||
{
|
||||
return client.SetTranslatedLanguage((int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(errorCode);
|
||||
});
|
||||
}, language, timeout);
|
||||
}
|
||||
|
||||
public bool Translate(Action<TranslatedInfo, int> callback, string text,
|
||||
string destinationLanguage, string sourceLanguage = "",
|
||||
TranslateType type = TranslateType.Chat, ProfanityType profanity = ProfanityType.Off,
|
||||
int timeout = 0)
|
||||
{
|
||||
return client.Translate((TranslatedInfo info, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(info, errorCode);
|
||||
});
|
||||
}, text, destinationLanguage, sourceLanguage, type, profanity, timeout);
|
||||
}
|
||||
|
||||
public bool SpeechToText(Action<string, string, int> callback, byte[] audioBinaryContent, string language, string codec = null, int sampleRate = 0, int timeout = 120)
|
||||
{
|
||||
return client.SpeechToText((string text, string resultLanguage, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(text, resultLanguage, errorCode);
|
||||
});
|
||||
}, audioBinaryContent, language, codec, sampleRate, timeout);
|
||||
}
|
||||
|
||||
public bool SpeechTranslate(Action<TranslatedInfo, int> callback, byte[] audioBinaryContent, string speechLanguage, string textLanguage = null, string codec = null, int sampleRate = 0, int timeout = 120)
|
||||
{
|
||||
return client.SpeechTranslate((TranslatedInfo info, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(info, errorCode);
|
||||
});
|
||||
}, audioBinaryContent, speechLanguage, textLanguage, codec, sampleRate, timeout);
|
||||
}
|
||||
|
||||
public bool TextCheck(Action<TextCheckResult, int> callback, string text, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.TextCheck((TextCheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, text, strategyId, timeout);
|
||||
}
|
||||
|
||||
public bool ImageCheck(Action<CheckResult, int> callback, string imageUrl, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.ImageCheck((CheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, imageUrl, strategyId, timeout);
|
||||
}
|
||||
|
||||
public bool ImageCheck(Action<CheckResult, int> callback, byte[] imageContent, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.ImageCheck((CheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, imageContent, strategyId, timeout);
|
||||
}
|
||||
|
||||
public bool AudioCheck(Action<CheckResult, int> callback, string audioUrl, string language, string codec = null, int sampleRate = 0, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.AudioCheck((CheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, audioUrl, language, codec, sampleRate, strategyId, timeout);
|
||||
}
|
||||
|
||||
public bool AudioCheck(Action<CheckResult, int> callback, byte[] audioContent, string language, string codec = null, int sampleRate = 0, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.AudioCheck((CheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, audioContent, language, codec, sampleRate, strategyId, timeout);
|
||||
}
|
||||
|
||||
public bool VideoCheck(Action<CheckResult, int> callback, string videoUrl, string videoName, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.VideoCheck((CheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, videoUrl, videoName, strategyId, timeout);
|
||||
}
|
||||
|
||||
public bool VideoCheck(Action<CheckResult, int> callback, byte[] videoContent, string videoName, string strategyId = null, int timeout = 120)
|
||||
{
|
||||
return client.VideoCheck((CheckResult result, int errorCode) =>
|
||||
{
|
||||
RTMControlCenter.callbackQueue.PostAction(() =>
|
||||
{
|
||||
callback(result, errorCode);
|
||||
});
|
||||
}, videoContent, videoName, strategyId, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61c822ad5186be44ba4463a2bfb7d09f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16d0b61b627b847c4a6faf99aa7f01e9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92b5148fab0b7c14191444fd77f8385d
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f5aaa947385a49c2b853d46cf0e6eef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>21G72</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>RTMNative</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>ilivedata.RTMNative</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>RTMNative</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>14C18</string>
|
||||
<key>DTPlatformName</key>
|
||||
<string>macosx</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>13.1</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>22C55</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx13.1</string>
|
||||
<key>DTXcode</key>
|
||||
<string>1420</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>14C18</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.14</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f20cac30d1534719acfdeca6721e49c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab2a32c5d0b9d4cd2bdfd846e73292c8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89534406b91c84e089a0f29cdbb8296b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac3228a9180f846959b7bf3b94dbd99a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict/>
|
||||
<key>files2</key>
|
||||
<dict/>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^Resources/</key>
|
||||
<true/>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^[^/]+$</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5a7b5015d91b4407b54f80d6ada58cd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84906010c24a646f4ad8acfe1954c41f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user