Skip to content

Commit bbf7cf9

Browse files
Update PNSDK generation, some codacy fixes
1 parent d312fb1 commit bbf7cf9

File tree

9 files changed

+33
-15
lines changed

9 files changed

+33
-15
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace PubNubChatAPI.Entities
2424
public class Chat
2525
{
2626
internal const string INTERNAL_MODERATION_PREFIX = "PUBNUB_INTERNAL_MODERATION";
27-
internal const string INTERNAL_ADMIN_CHANNEL = "PUBNUB_INTERNAL_ADMIN_CHANNEL";
2827
internal const string MESSAGE_THREAD_ID_PREFIX = "PUBNUB_INTERNAL_THREAD";
2928

3029
public Pubnub PubnubInstance { get; }

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ private async Task<List<SuggestedMention>> GenerateSuggestedMentions()
191191
continue;
192192
}
193193
break;
194+
case MentionType.Url:
195+
break;
196+
default:
197+
throw new ArgumentOutOfRangeException();
194198
}
195199
suggestions.Add(suggestion);
196200
}

c-sharp-chat/PubnubChatApi/PubnubChatApi/Utilities/DiffMatchPatch.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ private List<Diff> diff_lineMode(string text1, string text2,
428428
text_delete = string.Empty;
429429
text_insert = string.Empty;
430430
break;
431+
default:
432+
throw new ArgumentOutOfRangeException();
431433
}
432434
pointer++;
433435
}

unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi/Entities/Chat.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace PubNubChatAPI.Entities
2424
public class Chat
2525
{
2626
internal const string INTERNAL_MODERATION_PREFIX = "PUBNUB_INTERNAL_MODERATION";
27-
internal const string INTERNAL_ADMIN_CHANNEL = "PUBNUB_INTERNAL_ADMIN_CHANNEL";
2827
internal const string MESSAGE_THREAD_ID_PREFIX = "PUBNUB_INTERNAL_THREAD";
2928

3029
public Pubnub PubnubInstance { get; }

unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi/Entities/MessageDraft.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ private async Task<List<SuggestedMention>> GenerateSuggestedMentions()
191191
continue;
192192
}
193193
break;
194+
case MentionType.Url:
195+
break;
196+
default:
197+
throw new ArgumentOutOfRangeException();
194198
}
195199
suggestions.Add(suggestion);
196200
}

unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi/Utilities/DiffMatchPatch.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ private List<Diff> diff_lineMode(string text1, string text2,
428428
text_delete = string.Empty;
429429
text_insert = string.Empty;
430430
break;
431+
default:
432+
throw new ArgumentOutOfRangeException();
431433
}
432434
pointer++;
433435
}

unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/UnityChatPNSDKSource.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,31 @@ public class UnityChatPNSDKSource : IPNSDKSource
66
{
77
private const string build = "0.4.5";
88

9-
public string GetPNSDK() {
9+
private string GetPlatformString()
10+
{
1011
#if(UNITY_IOS)
11-
return string.Format("PubNub-CSharp-Chat-UnityIOS/{0}", build);
12+
return "IOS";
1213
#elif(UNITY_STANDALONE_WIN)
13-
return string.Format("PubNub-CSharp-Chat-UnityWin/{0}", build);
14+
return "Win";
1415
#elif(UNITY_STANDALONE_OSX)
15-
return string.Format("PubNub-CSharp-Chat-UnityOSX/{0}", build);
16+
return "OSX";
1617
#elif(UNITY_ANDROID)
17-
return string.Format("PubNub-CSharp-Chat-UnityAndroid/{0}", build);
18+
return "Android";
1819
#elif(UNITY_STANDALONE_LINUX)
19-
return string.Format("PubNub-CSharp-Chat-UnityLinux/{0}", build);
20+
return "Linux";
2021
#elif(UNITY_WEBPLAYER)
21-
return string.Format("PubNub-CSharp-Chat-UnityWeb/{0}", build);
22+
return "Web";
2223
#elif(UNITY_WEBGL)
23-
return string.Format("PubNub-CSharp-Chat-UnityWebGL/{0}", build);
24+
return "WebGL";
2425
#else
25-
return string.Format("PubNub-CSharp-Chat-Unity/{0}", build);
26+
return "";
2627
#endif
2728
}
29+
30+
public string GetPNSDK()
31+
{
32+
var unitySdkVersion = new UnityPNSDKSource().Build;
33+
return $"PubNub-CSharp-Unity{GetPlatformString()}/{unitySdkVersion}/CA-Unity/{build}";
34+
}
2835
}
2936
}

unity-chat/PubnubChatUnity/Packages/manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"com.pubnub.sdk": "https://github.com/pubnub/unity.git?path=/PubNubUnity/Assets/PubNub#c-sharp-7-5-0",
44
"com.unity.collab-proxy": "2.6.0",
55
"com.unity.feature.development": "1.0.1",
6+
"com.unity.ide.rider": "3.0.37",
67
"com.unity.textmeshpro": "3.0.7",
78
"com.unity.timeline": "1.7.6",
89
"com.unity.ugui": "1.0.0",

unity-chat/PubnubChatUnity/Packages/packages-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"com.unity.nuget.newtonsoft-json": "3.0.2"
99
},
10-
"hash": "c7e3f452dc9feee8c3396011e157605119186058"
10+
"hash": "4abedb90b80e8c615425ec4aaa397f4a62b16a98"
1111
},
1212
"com.unity.collab-proxy": {
1313
"version": "2.6.0",
@@ -25,7 +25,7 @@
2525
},
2626
"com.unity.ext.nunit": {
2727
"version": "1.0.6",
28-
"depth": 2,
28+
"depth": 1,
2929
"source": "registry",
3030
"dependencies": {},
3131
"url": "https://packages.unity.com"
@@ -45,8 +45,8 @@
4545
}
4646
},
4747
"com.unity.ide.rider": {
48-
"version": "3.0.34",
49-
"depth": 1,
48+
"version": "3.0.37",
49+
"depth": 0,
5050
"source": "registry",
5151
"dependencies": {
5252
"com.unity.ext.nunit": "1.0.6"

0 commit comments

Comments
 (0)