Skip to content

Commit

Permalink
[SDK-332] Hotfix/v3.1.1 (#102)
Browse files Browse the repository at this point in the history
- fix for analytics going to wrong environment
  • Loading branch information
HarrisonHough authored Aug 11, 2023
1 parent f486150 commit c1a73ff
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.1.1] - 2023.08.11

### Fixed
- fixed an issue causing analytics events being sent to development environmenmt [#102](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/102)
- readded RPM define symbol required for supporting packages [#102](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/102)

## [3.1.0] - 2023.08.08

### Added
* personal avatar loading in quick start by @rYuuk in https://github.com/readyplayerme/rpm-unity-sdk-core/pull/97
* runtime analytics to quick start by @rYuuk in https://github.com/readyplayerme/rpm-unity-sdk-core/pull/98

## [3.0.0] - 2023.07.31

### Added
Expand Down
10 changes: 8 additions & 2 deletions Editor/Module Management/ModuleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class ModuleInstaller

private const int THREAD_SLEEP_TIME = 100;
private const string PROGRESS_BAR_TITLE = "Ready Player Me";
private const string RPM_DEVELOPMENT_SCRIPTING_SYMBOL = "RPM_DEVELOPMENT";
private const string READY_PLAYER_ME_SYMBOL = "READY_PLAYER_ME";
private const string GLTFAST_SYMBOL = "GLTFAST";
private const string CORE_MODULE_NAME = "com.readyplayerme.core";

Expand All @@ -35,19 +35,25 @@ public static class ModuleInstaller
private const float TIMEOUT_FOR_MODULE_INSTALLATION = 20f;
private const string AVATAR_LOADER_SUBSTRING = "avatarloader";


static ModuleInstaller()
{

Events.registeredPackages += OnRegisteredPackages;
Events.registeringPackages += OnRegisteringPackages;
}


/// <summary>
/// Called when a package is added, removed or changed.
/// </summary>
/// <param name="args">Describes the <c>PackageInfo</c> entries of packages that have just been registered.</param>
private static void OnRegisteredPackages(PackageRegistrationEventArgs args)
{
Events.registeredPackages -= OnRegisteredPackages;
#if RPM_DEVELOPMENT
return;
#endif
// Core Module installed
if (args.added != null && args.added.Any(p => p.name == CORE_MODULE_NAME))
{
Expand Down Expand Up @@ -187,7 +193,7 @@ private static void AppendScriptingSymbol()
private static void SetDefineSymbol(BuildTargetGroup target)
{
var defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(target);
var symbols = new HashSet<string>(defineSymbols.Split(';')) { GLTFAST_SYMBOL };
var symbols = new HashSet<string>(defineSymbols.Split(';')) { GLTFAST_SYMBOL, READY_PLAYER_ME_SYMBOL };
var newDefineString = string.Join(";", symbols.ToArray());
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, newDefineString);
}
Expand Down
3 changes: 2 additions & 1 deletion Editor/Module Management/ModuleUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ private class Release
private const string UPDATE_BUTTON_TEXT = "Update";
private const string CANCEL_BUTTON_TEXT = "Cancel";
private const string DONT_ASK_TEXT = "Don't ask";

private const string AVATAR_LOADER_PACKAGE = "com.readyplayerme.avatarloader";


static ModuleUpdater()
{
EntryPoint.Startup += () => Check(true);
Expand Down
8 changes: 4 additions & 4 deletions Runtime/Analytics/AmplitudeEventLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public static class AmplitudeEventLogger
private const string ENDPOINT = "https://analytics-sdk.readyplayer.me/";
private const string NO_INTERNET_CONNECTION = "No internet connection.";
#if RPM_DEVELOPMENT
private const string TARGET_ENVIRONMENT = "unity";
#else
private const string TARGET_ENVIRONMENT = "unity-dev";
#else
private const string TARGET_ENVIRONMENT = "unity";
#endif

private static long sessionId;

private static bool HasInternetConnection => Application.internetReachability != NetworkReachability.NotReachable;
Expand All @@ -38,7 +38,7 @@ public static async void LogEvent(string eventName, Dictionary<string, object> e
{ AmplitudeKeys.EVENT_TYPE, eventName },
{ AmplitudeKeys.PLATFORM, ApplicationData.GetData().UnityPlatform },
{ AmplitudeKeys.SESSION_ID, sessionId },
{ AmplitudeKeys.APP_VERSION,ApplicationData.GetData().SDKVersion },
{ AmplitudeKeys.APP_VERSION, ApplicationData.GetData().SDKVersion },
{ AmplitudeKeys.OPERATING_SYSTEM, SystemInfo.operatingSystem }
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.readyplayerme.core",
"version": "3.1.0",
"version": "3.1.1",
"displayName": "Ready Player Me Core",
"description": "This Module contains all the core functionality required for using Ready Player Me avatars in Unity, including features such as: \n - Module management and automatic package setup logic\n - Avatar loading from .glb files\n - Avatar and 2D render requests\n - Optional Analytics\n - Custom editor windows\n - Sample scenes and assets",
"unity": "2020.3",
Expand Down

0 comments on commit c1a73ff

Please sign in to comment.