Skip to content

Commit 6ecbcd9

Browse files
authored
Merge pull request #815 from PlayEveryWare/release-3.3.1
Release 3.3.1
2 parents 9b99c09 + 68d8b07 commit 6ecbcd9

File tree

10 files changed

+137
-99
lines changed

10 files changed

+137
-99
lines changed

Assets/Plugins/Source/Core/EOSManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ public void Init(IEOSCoroutineOwner coroutineOwner, string configFileName)
586586
hasSetLoggingCallback = true;
587587
}
588588

589+
// The log levels are set in the native plugin
590+
// This is here to sync the settings visually in UILogWindow
591+
InitializeLogLevels();
592+
589593
InitializeOverlay(coroutineOwner);
590594
return;
591595
}

Assets/Plugins/Source/Core/EOSPackageInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static class EOSPackageInfo
3535
* not involve editing source code files.
3636
*/
3737

38-
public const string Version = "3.3.0";
38+
public const string Version = "3.3.1";
3939

4040
public const string PackageName = "com.playeveryware.eos";
4141
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d4ac82cf01e8c8a3d7258318603bfcecfa5dceabb84341d161e845087bc8330c
3-
size 10240
2+
oid sha256:07558df6d592bb39c0d66ec04d9086a9bd5abca4f2c045dbbd9eccfe75ab34f9
3+
size 10752
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:78d27f8ffc6cb3e754fb62799fd74f81092169ee26dc6b4deadb588609c79780
3-
size 103424
2+
oid sha256:3907900986ad2dc1b29f7c2dd66e897d5d3e234d517cabbef7fdbf4e8acd2850
3+
size 98304
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:1ae2e675874bd3ce6f88e6caecdfdb0033e2d0a113b10c35b7e27f6dca6e1e78
3-
size 113152
2+
oid sha256:967443959639623bd8bfe996afa5bab62b43883e2c1f9f2db21c9aec6fe71447
3+
size 98816
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:124337d3a9396514ef98287af91bba69805407b66ed93696e35876684f152469
3-
size 416256
2+
oid sha256:70922bb52c4ab700b2a36cf2159c3c33385bc347bfe54a016c2fdca7767e6680
3+
size 410624
Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
11
{
2-
"logCategoryLevelPairs": [
2+
"LogCategoryLevelPairs": [
33
{
4-
"category": "Core",
5-
"level": "Warning"
4+
"Category": "Core",
5+
"Level": "Warning"
66
},
77
{
8-
"category": "Auth",
9-
"level": "Warning"
8+
"Category": "Auth",
9+
"Level": "Warning"
1010
},
1111
{
12-
"category": "Friends",
13-
"level": "Warning"
12+
"Category": "Friends",
13+
"Level": "Warning"
1414
},
1515
{
16-
"category": "Presence",
17-
"level": "Warning"
16+
"Category": "Presence",
17+
"Level": "Warning"
1818
},
1919
{
20-
"category": "UserInfo",
21-
"level": "Warning"
20+
"Category": "UserInfo",
21+
"Level": "Warning"
2222
},
2323
{
24-
"category": "HttpSerialization",
25-
"level": "Warning"
24+
"Category": "HttpSerialization",
25+
"Level": "Warning"
2626
},
2727
{
28-
"category": "Ecom",
29-
"level": "Warning"
28+
"Category": "Ecom",
29+
"Level": "Warning"
3030
},
3131
{
32-
"category": "P2P",
33-
"level": "Warning"
32+
"Category": "P2P",
33+
"Level": "Warning"
3434
},
3535
{
36-
"category": "Sessions",
37-
"level": "Warning"
36+
"Category": "Sessions",
37+
"Level": "Warning"
3838
},
3939
{
40-
"category": "RateLimiter",
41-
"level": "Warning"
40+
"Category": "RateLimiter",
41+
"Level": "Warning"
4242
},
4343
{
44-
"category": "PlayerDataStorage",
45-
"level": "Warning"
44+
"Category": "PlayerDataStorage",
45+
"Level": "Warning"
4646
},
4747
{
48-
"category": "Analytics",
49-
"level": "Warning"
48+
"Category": "Analytics",
49+
"Level": "Warning"
5050
},
5151
{
52-
"category": "Messaging",
53-
"level": "Warning"
52+
"Category": "Messaging",
53+
"Level": "Warning"
5454
},
5555
{
56-
"category": "Connect",
57-
"level": "Warning"
56+
"Category": "Connect",
57+
"Level": "Warning"
5858
},
5959
{
60-
"category": "Overlay",
61-
"level": "Warning"
60+
"Category": "Overlay",
61+
"Level": "Warning"
6262
},
6363
{
64-
"category": "Achievements",
65-
"level": "Warning"
64+
"Category": "Achievements",
65+
"Level": "Warning"
6666
},
6767
{
68-
"category": "Stats",
69-
"level": "Warning"
68+
"Category": "Stats",
69+
"Level": "Warning"
7070
},
7171
{
72-
"category": "Ui",
73-
"level": "Warning"
72+
"Category": "Ui",
73+
"Level": "Warning"
7474
},
7575
{
76-
"category": "Lobby",
77-
"level": "Warning"
76+
"Category": "Lobby",
77+
"Level": "Warning"
7878
},
7979
{
80-
"category": "Leaderboards",
81-
"level": "Warning"
80+
"Category": "Leaderboards",
81+
"Level": "Warning"
8282
},
8383
{
84-
"category": "Keychain",
85-
"level": "Warning"
84+
"Category": "Keychain",
85+
"Level": "Warning"
8686
},
8787
{
88-
"category": "IntegratedPlatform",
89-
"level": "Warning"
88+
"Category": "IntegratedPlatform",
89+
"Level": "Warning"
9090
},
9191
{
92-
"category": "TitleStorage",
93-
"level": "Warning"
92+
"Category": "TitleStorage",
93+
"Level": "Warning"
9494
},
9595
{
96-
"category": "Mods",
97-
"level": "Warning"
96+
"Category": "Mods",
97+
"Level": "Warning"
9898
},
9999
{
100-
"category": "AntiCheat",
101-
"level": "Warning"
100+
"Category": "AntiCheat",
101+
"Level": "Warning"
102102
},
103103
{
104-
"category": "Reports",
105-
"level": "Warning"
104+
"Category": "Reports",
105+
"Level": "Warning"
106106
},
107107
{
108-
"category": "Sanctions",
109-
"level": "Warning"
108+
"Category": "Sanctions",
109+
"Level": "Warning"
110110
},
111111
{
112-
"category": "ProgressionSnapshots",
113-
"level": "Warning"
112+
"Category": "ProgressionSnapshots",
113+
"Level": "Warning"
114114
},
115115
{
116-
"category": "Kws",
117-
"level": "Warning"
116+
"Category": "Kws",
117+
"Level": "Warning"
118118
},
119119
{
120-
"category": "Rtc",
121-
"level": "Warning"
120+
"Category": "Rtc",
121+
"Level": "Warning"
122122
},
123123
{
124-
"category": "RTCAdmin",
125-
"level": "Warning"
124+
"Category": "RTCAdmin",
125+
"Level": "Warning"
126126
},
127127
{
128-
"category": "CustomInvites",
129-
"level": "Warning"
128+
"Category": "CustomInvites",
129+
"Level": "Warning"
130130
},
131131
{
132-
"category": "AllCategories",
133-
"level": "Warning"
132+
"Category": "AllCategories",
133+
"Level": "Warning"
134134
}
135135
]
136136
}

etc/PackageTemplate/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
44

55
# Changelog
66

7+
## [3.3.1] - 2024-07-30
8+
9+
### Fixed
10+
- fix(native,log) : log config error handling to prevent crashing
11+
- fix(ui,log) : show correct log levels in UILogWindow on native initialized platforms
12+
- chore(log,config) : update log config fields to Pascal case
13+
- chore(native,windows) : rebuild libs after fixing log config crash
14+
715
## [3.3.0] - 2024-07-03
816

917
### Fixed

etc/PackageTemplate/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.playeveryware.eos",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"unity": "2021.3",
55
"unityRelease": "8f1",
66
"displayName": "Epic Online Services Plugin for Unity",
@@ -31,6 +31,6 @@
3131
}
3232
],
3333
"com_playeveryware": {
34-
"git_build_sha": "dcba58e540ad7611e6369b920c9dcd9609570f02"
34+
"git_build_sha": "9b9229325c93dd7e81461fde387ed5ef012349ec"
3535
}
3636
}

lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/dllmain.cpp

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,6 @@ EOS_ELogLevel eos_loglevel_str_to_enum(const std::string& str)
428428
}
429429
}
430430

431-
void eos_set_loglevel(const LogLevelConfig& log_config)
432-
{
433-
if (EOS_Logging_SetLogLevel_ptr != nullptr)
434-
{
435-
for (size_t i = 0; i < log_config.category.size() - 1; i++)
436-
{
437-
EOS_Logging_SetLogLevel_ptr((EOS_ELogCategory)i, eos_loglevel_str_to_enum(log_config.level[i]));
438-
}
439-
}
440-
}
441-
442431
//-------------------------------------------------------------------------
443432
static void show_log_as_dialog(const char* log_string)
444433
{
@@ -966,7 +955,7 @@ static LogLevelConfig log_config_from_json_value(json_value_s* config_json)
966955

967956
while (iter != nullptr)
968957
{
969-
if (!strcmp("logCategoryLevelPairs", iter->name->string))
958+
if (!strcmp("LogCategoryLevelPairs", iter->name->string))
970959
{
971960
json_array_s* pairs = json_value_as_array(iter->value);
972961
for (auto e = pairs->start; e != nullptr; e = e->next)
@@ -975,11 +964,11 @@ static LogLevelConfig log_config_from_json_value(json_value_s* config_json)
975964
struct json_object_element_s* pairs_iter = pairs_json_object->start;
976965
while (pairs_iter != nullptr)
977966
{
978-
if (!strcmp("category", pairs_iter->name->string))
967+
if (!strcmp("Category", pairs_iter->name->string))
979968
{
980969
log_config.category.push_back(json_value_as_string(pairs_iter->value)->string);
981970
}
982-
else if (!strcmp("level", pairs_iter->name->string))
971+
else if (!strcmp("Level", pairs_iter->name->string))
983972
{
984973
log_config.level.push_back(json_value_as_string(pairs_iter->value)->string);
985974
}
@@ -1252,6 +1241,49 @@ static void eos_call_steam_init(const std::string& steam_dll_path)
12521241
}
12531242
}
12541243

1244+
//-------------------------------------------------------------------------
1245+
void eos_set_loglevel_via_config()
1246+
{
1247+
if (EOS_Logging_SetLogLevel_ptr == nullptr)
1248+
{
1249+
return;
1250+
}
1251+
1252+
auto path_to_log_config_json = get_path_for_eos_service_config(EOS_LOGLEVEL_CONFIG_FILENAME);
1253+
1254+
if (!std::filesystem::exists(path_to_log_config_json))
1255+
{
1256+
log_inform("Log level config not found, using default log levels");
1257+
return;
1258+
}
1259+
1260+
json_value_s* log_config_as_json = read_config_json_as_json_from_path(path_to_log_config_json);
1261+
LogLevelConfig log_config = log_config_from_json_value(log_config_as_json);
1262+
free(log_config_as_json);
1263+
1264+
// Validation to prevent out of range exception
1265+
if (log_config.category.size() != log_config.level.size())
1266+
{
1267+
log_warn("Log level config entries out of range");
1268+
return;
1269+
}
1270+
1271+
// Last in the vector is AllCategories, and will not be set
1272+
size_t individual_category_size = log_config.category.size() > 0 ? log_config.category.size() - 1 : 0;
1273+
if (individual_category_size == 0)
1274+
{
1275+
log_warn("Log level config entries empty");
1276+
return;
1277+
}
1278+
1279+
for (size_t i = 0; i < individual_category_size; i++)
1280+
{
1281+
EOS_Logging_SetLogLevel_ptr((EOS_ELogCategory)i, eos_loglevel_str_to_enum(log_config.level[i]));
1282+
}
1283+
1284+
log_inform("Log levels set according to config");
1285+
}
1286+
12551287
//-------------------------------------------------------------------------
12561288
void eos_create(EOSConfig& eosConfig)
12571289
{
@@ -1519,12 +1551,6 @@ DLL_EXPORT(void) UnityPluginLoad(void*)
15191551
EOSConfig eos_config = eos_config_from_json_value(eos_config_as_json);
15201552
free(eos_config_as_json);
15211553

1522-
auto path_to_log_config_json = get_path_for_eos_service_config(EOS_LOGLEVEL_CONFIG_FILENAME);
1523-
json_value_s* log_config_as_json = read_config_json_as_json_from_path(path_to_log_config_json);
1524-
LogLevelConfig log_config = log_config_from_json_value(log_config_as_json);
1525-
free(log_config_as_json);
1526-
global_logf("NativePlugin log sonfig size (%d)", log_config.category.size());
1527-
15281554
#if PLATFORM_WINDOWS
15291555
//support sandbox and deployment id override via command line arguments
15301556
std::stringstream argStream = std::stringstream(GetCommandLineA());
@@ -1626,7 +1652,7 @@ DLL_EXPORT(void) UnityPluginLoad(void*)
16261652

16271653
eos_init(eos_config);
16281654

1629-
eos_set_loglevel(log_config);
1655+
eos_set_loglevel_via_config();
16301656
//log_warn("start eos create");
16311657
eos_create(eos_config);
16321658

0 commit comments

Comments
 (0)