Skip to content

Commit 03d1fdb

Browse files
Update Unity project with API source code instead of CPP DLL
1 parent 68eada0 commit 03d1fdb

File tree

120 files changed

+9725
-1708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+9725
-1708
lines changed

c-sharp-chat/PubnubChatApi/PubnubChatApi.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Global
1414
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1515
{8D3851D4-6FD7-4DE5-9960-DA386442603E}.Release|Any CPU.ActiveCfg = Release|Any CPU
1616
{8D3851D4-6FD7-4DE5-9960-DA386442603E}.Release|Any CPU.Build.0 = Release|Any CPU
17-
{8D3851D4-6FD7-4DE5-9960-DA386442603E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18-
{8D3851D4-6FD7-4DE5-9960-DA386442603E}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{8D3851D4-6FD7-4DE5-9960-DA386442603E}.Debug|Any CPU.ActiveCfg = Release|Any CPU
18+
{8D3851D4-6FD7-4DE5-9960-DA386442603E}.Debug|Any CPU.Build.0 = Release|Any CPU
1919
{54ACBC4B-510A-499F-9494-24F9F90F7B67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2020
{54ACBC4B-510A-499F-9494-24F9F90F7B67}.Debug|Any CPU.Build.0 = Debug|Any CPU
2121
{54ACBC4B-510A-499F-9494-24F9F90F7B67}.Release|Any CPU.ActiveCfg = Release|Any CPU

c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Chat.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,35 @@ public static async Task<ChatOperationResult<Chat>> CreateInstance(PubnubChatCon
6969
return result;
7070
}
7171

72+
/// <summary>
73+
/// Initializes a new instance of the <see cref="Chat"/> class.
74+
/// <para>
75+
/// Creates a new chat instance.
76+
/// </para>
77+
/// </summary>
78+
/// <param name="chatConfig">Config with Chat specific parameters</param>
79+
/// <param name="pubnub">An existing Pubnub object instance</param>
80+
/// <param name="listenerFactory">Optional injectable listener factory, used in Unity to allow for dispatching Chat callbacks on main thread.</param>
81+
/// <returns>A ChatOperationResult containing the created Chat instance.</returns>
82+
/// <remarks>
83+
/// The constructor initializes the Chat object with an existing Pubnub instance.
84+
/// </remarks>
85+
public static async Task<ChatOperationResult<Chat>> CreateInstance(PubnubChatConfig chatConfig, Pubnub pubnub, ChatListenerFactory? listenerFactory = null)
86+
{
87+
var chat = new Chat(chatConfig, pubnub, listenerFactory);
88+
if (chatConfig.StoreUserActivityTimestamp)
89+
{
90+
chat.StoreActivityTimeStamp();
91+
}
92+
var result = new ChatOperationResult<Chat>("Chat.CreateInstance()", chat){Result = chat};
93+
var getUser = await chat.GetCurrentUser().ConfigureAwait(false);
94+
if (getUser.Error)
95+
{
96+
result.RegisterOperation(await chat.CreateUser(chat.PubnubInstance.GetCurrentUserId()).ConfigureAwait(false));
97+
}
98+
return result;
99+
}
100+
72101
internal Chat(PubnubChatConfig chatConfig, PNConfiguration pubnubConfig, ChatListenerFactory? listenerFactory = null)
73102
{
74103
PubnubInstance = new Pubnub(pubnubConfig);
-154 KB
Binary file not shown.

unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.dll.meta

Lines changed: 0 additions & 33 deletions
This file was deleted.

unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.xml.meta renamed to unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.meta

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)