Skip to content

Commit

Permalink
Merge pull request #815 from PlayEveryWare/release-3.3.1
Browse files Browse the repository at this point in the history
Release 3.3.1
  • Loading branch information
arthur740212 authored Jul 31, 2024
2 parents 9b99c09 + 68d8b07 commit 6ecbcd9
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 99 deletions.
4 changes: 4 additions & 0 deletions Assets/Plugins/Source/Core/EOSManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ public void Init(IEOSCoroutineOwner coroutineOwner, string configFileName)
hasSetLoggingCallback = true;
}

// The log levels are set in the native plugin
// This is here to sync the settings visually in UILogWindow
InitializeLogLevels();

InitializeOverlay(coroutineOwner);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Plugins/Source/Core/EOSPackageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class EOSPackageInfo
* not involve editing source code files.
*/

public const string Version = "3.3.0";
public const string Version = "3.3.1";

public const string PackageName = "com.playeveryware.eos";
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Plugins/Windows/x64/DynamicLibraryLoaderHelper-x64.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Plugins/Windows/x64/GfxPluginNativeRender-x64.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Plugins/Windows/x86/DynamicLibraryLoaderHelper-x86.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Plugins/Windows/x86/GfxPluginNativeRender-x86.dll
Git LFS file not shown
134 changes: 67 additions & 67 deletions Assets/StreamingAssets/EOS/log_level_config.json
Original file line number Diff line number Diff line change
@@ -1,136 +1,136 @@
{
"logCategoryLevelPairs": [
"LogCategoryLevelPairs": [
{
"category": "Core",
"level": "Warning"
"Category": "Core",
"Level": "Warning"
},
{
"category": "Auth",
"level": "Warning"
"Category": "Auth",
"Level": "Warning"
},
{
"category": "Friends",
"level": "Warning"
"Category": "Friends",
"Level": "Warning"
},
{
"category": "Presence",
"level": "Warning"
"Category": "Presence",
"Level": "Warning"
},
{
"category": "UserInfo",
"level": "Warning"
"Category": "UserInfo",
"Level": "Warning"
},
{
"category": "HttpSerialization",
"level": "Warning"
"Category": "HttpSerialization",
"Level": "Warning"
},
{
"category": "Ecom",
"level": "Warning"
"Category": "Ecom",
"Level": "Warning"
},
{
"category": "P2P",
"level": "Warning"
"Category": "P2P",
"Level": "Warning"
},
{
"category": "Sessions",
"level": "Warning"
"Category": "Sessions",
"Level": "Warning"
},
{
"category": "RateLimiter",
"level": "Warning"
"Category": "RateLimiter",
"Level": "Warning"
},
{
"category": "PlayerDataStorage",
"level": "Warning"
"Category": "PlayerDataStorage",
"Level": "Warning"
},
{
"category": "Analytics",
"level": "Warning"
"Category": "Analytics",
"Level": "Warning"
},
{
"category": "Messaging",
"level": "Warning"
"Category": "Messaging",
"Level": "Warning"
},
{
"category": "Connect",
"level": "Warning"
"Category": "Connect",
"Level": "Warning"
},
{
"category": "Overlay",
"level": "Warning"
"Category": "Overlay",
"Level": "Warning"
},
{
"category": "Achievements",
"level": "Warning"
"Category": "Achievements",
"Level": "Warning"
},
{
"category": "Stats",
"level": "Warning"
"Category": "Stats",
"Level": "Warning"
},
{
"category": "Ui",
"level": "Warning"
"Category": "Ui",
"Level": "Warning"
},
{
"category": "Lobby",
"level": "Warning"
"Category": "Lobby",
"Level": "Warning"
},
{
"category": "Leaderboards",
"level": "Warning"
"Category": "Leaderboards",
"Level": "Warning"
},
{
"category": "Keychain",
"level": "Warning"
"Category": "Keychain",
"Level": "Warning"
},
{
"category": "IntegratedPlatform",
"level": "Warning"
"Category": "IntegratedPlatform",
"Level": "Warning"
},
{
"category": "TitleStorage",
"level": "Warning"
"Category": "TitleStorage",
"Level": "Warning"
},
{
"category": "Mods",
"level": "Warning"
"Category": "Mods",
"Level": "Warning"
},
{
"category": "AntiCheat",
"level": "Warning"
"Category": "AntiCheat",
"Level": "Warning"
},
{
"category": "Reports",
"level": "Warning"
"Category": "Reports",
"Level": "Warning"
},
{
"category": "Sanctions",
"level": "Warning"
"Category": "Sanctions",
"Level": "Warning"
},
{
"category": "ProgressionSnapshots",
"level": "Warning"
"Category": "ProgressionSnapshots",
"Level": "Warning"
},
{
"category": "Kws",
"level": "Warning"
"Category": "Kws",
"Level": "Warning"
},
{
"category": "Rtc",
"level": "Warning"
"Category": "Rtc",
"Level": "Warning"
},
{
"category": "RTCAdmin",
"level": "Warning"
"Category": "RTCAdmin",
"Level": "Warning"
},
{
"category": "CustomInvites",
"level": "Warning"
"Category": "CustomInvites",
"Level": "Warning"
},
{
"category": "AllCategories",
"level": "Warning"
"Category": "AllCategories",
"Level": "Warning"
}
]
}
8 changes: 8 additions & 0 deletions etc/PackageTemplate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# Changelog

## [3.3.1] - 2024-07-30

### Fixed
- fix(native,log) : log config error handling to prevent crashing
- fix(ui,log) : show correct log levels in UILogWindow on native initialized platforms
- chore(log,config) : update log config fields to Pascal case
- chore(native,windows) : rebuild libs after fixing log config crash

## [3.3.0] - 2024-07-03

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions etc/PackageTemplate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.playeveryware.eos",
"version": "3.3.0",
"version": "3.3.1",
"unity": "2021.3",
"unityRelease": "8f1",
"displayName": "Epic Online Services Plugin for Unity",
Expand Down Expand Up @@ -31,6 +31,6 @@
}
],
"com_playeveryware": {
"git_build_sha": "dcba58e540ad7611e6369b920c9dcd9609570f02"
"git_build_sha": "9b9229325c93dd7e81461fde387ed5ef012349ec"
}
}
68 changes: 47 additions & 21 deletions lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,6 @@ EOS_ELogLevel eos_loglevel_str_to_enum(const std::string& str)
}
}

void eos_set_loglevel(const LogLevelConfig& log_config)
{
if (EOS_Logging_SetLogLevel_ptr != nullptr)
{
for (size_t i = 0; i < log_config.category.size() - 1; i++)
{
EOS_Logging_SetLogLevel_ptr((EOS_ELogCategory)i, eos_loglevel_str_to_enum(log_config.level[i]));
}
}
}

//-------------------------------------------------------------------------
static void show_log_as_dialog(const char* log_string)
{
Expand Down Expand Up @@ -966,7 +955,7 @@ static LogLevelConfig log_config_from_json_value(json_value_s* config_json)

while (iter != nullptr)
{
if (!strcmp("logCategoryLevelPairs", iter->name->string))
if (!strcmp("LogCategoryLevelPairs", iter->name->string))
{
json_array_s* pairs = json_value_as_array(iter->value);
for (auto e = pairs->start; e != nullptr; e = e->next)
Expand All @@ -975,11 +964,11 @@ static LogLevelConfig log_config_from_json_value(json_value_s* config_json)
struct json_object_element_s* pairs_iter = pairs_json_object->start;
while (pairs_iter != nullptr)
{
if (!strcmp("category", pairs_iter->name->string))
if (!strcmp("Category", pairs_iter->name->string))
{
log_config.category.push_back(json_value_as_string(pairs_iter->value)->string);
}
else if (!strcmp("level", pairs_iter->name->string))
else if (!strcmp("Level", pairs_iter->name->string))
{
log_config.level.push_back(json_value_as_string(pairs_iter->value)->string);
}
Expand Down Expand Up @@ -1252,6 +1241,49 @@ static void eos_call_steam_init(const std::string& steam_dll_path)
}
}

//-------------------------------------------------------------------------
void eos_set_loglevel_via_config()
{
if (EOS_Logging_SetLogLevel_ptr == nullptr)
{
return;
}

auto path_to_log_config_json = get_path_for_eos_service_config(EOS_LOGLEVEL_CONFIG_FILENAME);

if (!std::filesystem::exists(path_to_log_config_json))
{
log_inform("Log level config not found, using default log levels");
return;
}

json_value_s* log_config_as_json = read_config_json_as_json_from_path(path_to_log_config_json);
LogLevelConfig log_config = log_config_from_json_value(log_config_as_json);
free(log_config_as_json);

// Validation to prevent out of range exception
if (log_config.category.size() != log_config.level.size())
{
log_warn("Log level config entries out of range");
return;
}

// Last in the vector is AllCategories, and will not be set
size_t individual_category_size = log_config.category.size() > 0 ? log_config.category.size() - 1 : 0;
if (individual_category_size == 0)
{
log_warn("Log level config entries empty");
return;
}

for (size_t i = 0; i < individual_category_size; i++)
{
EOS_Logging_SetLogLevel_ptr((EOS_ELogCategory)i, eos_loglevel_str_to_enum(log_config.level[i]));
}

log_inform("Log levels set according to config");
}

//-------------------------------------------------------------------------
void eos_create(EOSConfig& eosConfig)
{
Expand Down Expand Up @@ -1519,12 +1551,6 @@ DLL_EXPORT(void) UnityPluginLoad(void*)
EOSConfig eos_config = eos_config_from_json_value(eos_config_as_json);
free(eos_config_as_json);

auto path_to_log_config_json = get_path_for_eos_service_config(EOS_LOGLEVEL_CONFIG_FILENAME);
json_value_s* log_config_as_json = read_config_json_as_json_from_path(path_to_log_config_json);
LogLevelConfig log_config = log_config_from_json_value(log_config_as_json);
free(log_config_as_json);
global_logf("NativePlugin log sonfig size (%d)", log_config.category.size());

#if PLATFORM_WINDOWS
//support sandbox and deployment id override via command line arguments
std::stringstream argStream = std::stringstream(GetCommandLineA());
Expand Down Expand Up @@ -1626,7 +1652,7 @@ DLL_EXPORT(void) UnityPluginLoad(void*)

eos_init(eos_config);

eos_set_loglevel(log_config);
eos_set_loglevel_via_config();
//log_warn("start eos create");
eos_create(eos_config);

Expand Down

0 comments on commit 6ecbcd9

Please sign in to comment.