diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/encodings.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/encodings.xml deleted file mode 100644 index df87cf95..00000000 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/indexLayout.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/indexLayout.xml deleted file mode 100644 index 7b08163c..00000000 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/indexLayout.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/misc.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/misc.xml deleted file mode 100644 index 30bab2ab..00000000 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/projectSettingsUpdater.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/projectSettingsUpdater.xml deleted file mode 100644 index 4bb9f4d2..00000000 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/projectSettingsUpdater.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/vcs.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/vcs.xml deleted file mode 100644 index 6c0b8635..00000000 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml deleted file mode 100644 index ca90cd51..00000000 --- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - Intermediate/ProjectFiles/EndlessVendetta.vcxproj - - - - - - - - - - - - - - { - "customColor": "", - "associatedIndex": 7 -} - - - - - - - - - - - - - - - - - - - - - - - 1706900339638 - - - - - - - - \ No newline at end of file diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..5f0a09c8 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:0258c3c76c6d5af1f9fbc974113fd3dacf20083c1e0d206b4b635f26ac826496 +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index b715cd47..0f990580 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d029060e9a20598861faa739272c3bbf75646095f4811df3347556cdf8606199 -size 66790690 +oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d +size 72364642 diff --git a/EndlessVendetta/EndlessVendetta.sln.DotSettings.user b/EndlessVendetta/EndlessVendetta.sln.DotSettings.user deleted file mode 100644 index 88d9a609..00000000 --- a/EndlessVendetta/EndlessVendetta.sln.DotSettings.user +++ /dev/null @@ -1,5 +0,0 @@ - - - <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> - <Solution /> -</SessionState> \ No newline at end of file diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.cpp index 744fe187..36f320b8 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.cpp @@ -15,7 +15,6 @@ AEndlessVendettaGameMode::AEndlessVendettaGameMode() : Super() // set default pawn class to our Blueprinted character static ConstructorHelpers::FClassFinder PlayerPawnClassFinder(TEXT("/Game/FirstPerson/Blueprints/BP_FirstPersonCharacter")); DefaultPawnClass = PlayerPawnClassFinder.Class; - } void AEndlessVendettaGameMode::KillAllEnemies() @@ -43,21 +42,51 @@ void AEndlessVendettaGameMode::SetLocalAIAlertLevel(int NewAlertLevel) void AEndlessVendettaGameMode::SendEvent(FString EventKey, FString EventData) { - const FString EventID = FGuid::NewGuid().ToString(); + const FString EventID = GenerateUUID(); const FString EventTime = FDateTime::Now().ToString(); + if (EventData.IsEmpty()) EventData = "None"; const auto Request = FHttpModule::Get().CreateRequest(); Request->SetURL(TelemetryURLEvents); Request->SetVerb("POST"); Request->SetHeader("Content-Type", "application/json"); Request->SetHeader("Accept", "application/json"); Request->SetContentAsString("{\"SessionID\":\"" + SessionID + "\",\"PlayerGUID\":\"" + PlayerGUID + "\",\"EventID\":\"" + EventID + "\",\"Timestamp\":\"" + EventTime + "\",\"EventKey\":\"" + EventKey + "\",\"EventData\":\"" + EventData + "\"}"); - Request->OnProcessRequestComplete().BindLambda([](FHttpRequestPtr request, FHttpResponsePtr response, bool success) - { - GLog->Log("Telemetry Event Response: " + response->GetContentAsString()); - }); + Request->OnProcessRequestComplete().BindLambda([EventKey, EventData](FHttpRequestPtr request, FHttpResponsePtr response, bool success) + { + GLog->Log("Telemetry: " + response->GetContentAsString() + "\nEvent Key: " + EventKey + " Event Data: " + EventData); + }); Request->ProcessRequest(); } +FString AEndlessVendettaGameMode::GenerateUUID() +{ + uint8 RandomBytes[16]; + const FDateTime Now = FDateTime::UtcNow(); + const int64 TimeStamp = Now.ToUnixTimestamp(); + FPlatformMath::RandInit(TimeStamp); + + for (int32 Index = 0; Index < 16; ++Index) + { + RandomBytes[Index] = FMath::Rand() % 256; + } + FMemory::Memswap(RandomBytes, &RandomBytes[8], 8); + const uint32 ProcessID = FPlatformProcess::GetCurrentProcessId(); + FMemory::Memcpy(RandomBytes + 12, &ProcessID, sizeof(uint32)); + + // Set version (4) and variant (RFC4122) bits + RandomBytes[6] = (RandomBytes[6] & 0x0F) | 0x40; // version 4 + RandomBytes[8] = (RandomBytes[8] & 0x3F) | 0x80; // variant RFC4122 + + FGuid UUID; + FMemory::Memcpy(&UUID, RandomBytes, 16); + FString UUIDString = UUID.ToString(); + UUIDString = UUIDString.Replace(TEXT("{"), TEXT("")); + UUIDString = UUIDString.Replace(TEXT("}"), TEXT("")); + UUIDString = UUIDString.Replace(TEXT("-"), TEXT("")); + + return UUIDString; +} + void AEndlessVendettaGameMode::BeginPlay() { Super::BeginPlay(); diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.h index 5d015623..6fa4ed8c 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaGameMode.h @@ -32,6 +32,7 @@ public: UFUNCTION(BlueprintCallable, Category = "Telemetry") void SendEvent(FString EventKey, FString EventData); + static FString GenerateUUID(); virtual void BeginPlay() override; };